Trading

Executions

GET /executions


Get a list of all executions

Query String

  • state
  • created_at_from
  • created_at_to
  • customer_id
  • client_ref

Response

OK

{
  "success": true,
  "data": model.Execution
}

Error

  • error.BadRequestError
  • error.InternalServerError

GET /executions/:execution_id


Get an execution by ID

Response

OK

{
  "success": true,
  "data": model.Execution
}

Error

  • error.InternalServerError

GET /executions/:execution_id/quote


Get the quote for an execution

Response

OK

{
  "success": true,
  "data": model.Execution
}

Error

  • error.InternalServerError

POST /executions


This request creates a new execution

Request

{
  "route_id": "0f17b573-72cf-4e1f-bd32-85f76c67e1bc",
  "amount": "50",
  "side": enum.Side,
  "execution_type": enum.ExecutionType,
  "tif_mode": enum.ExecutionTifMode,
  "stop_order_condition": enum.StopOrderCondition,
  "risk": "0.0007900794119694884",
  "quote_id": "3684ba5b-6c7a-461a-b5fb-b44c20b10611",
  "client_ref": "f01eea1c-c8ec-435b-9b63-0c049a5c3be0",
  "customers": [
    {
      "customer_id": "2825e222-177c-4bb6-994a-da980eefc6e2"
    }
  ],
  "margin": "0.005"
}

or:

{
  "route_id": "2eaff736-2b40-48fb-aaf7-993528740b99",
  "amount": "50",
  "side": enum.Side,
  "execution_type": enum.ExecutionType,
  "risk": "0.0007900794119694884",
  "client_ref": "",
  "customers": [
    {
      "customer_id": "2825e222-177c-4bb6-994a-da980eefc6e2",
      "quantity_absolute": "40"
    },
    {
      "customer_id": "aac60026-164b-4696-aec0-9123bd86be4d",
      "quantity_absolute": "10"
    }
  ],
  "margin": "0.005"
}

Executing a Volume Order:

{
  "route_id": "e04be5e0-613b-4878-8d95-9f7b3e189aec",
  "volume": "50000",
  "side": enum.Side,
  "execution_type": enum.ExecutionType,
  "mode": Enum.ExecutionRequestMode,
  "risk": "0.0002",
  "customers": [
    {
      "customer_id": "aac60026-164b-4696-aec0-9123bd86be4d"
    }
  ]
}

Best Execution:

{
  "symbol": "SOL/EUR",
  "amount": "5",
  "side": enum.Side,
  "execution_type": enum.ExecutionType,
  "risk": "0.0001",
  "client_ref": "",
  "customers": [
    {
      "customer_id": "2825e222-177c-4bb6-994a-da980eefc6e2"
    }
  ],
  "margin": "0.005"
}

Attributes

  • execution_type: Distinguishes the type of order. Market, limit, stop,…
  • route_id: ID string of the price stream route that should be used. Not required if symbol is passed.
  • symbol: The symbol for which a ‘Best Execution’ is to be executed. Not required if a route_id is passed.
  • amount: The requested quantity of the asset to be bought or sold. This parameter must not be included in a volume order.
  • volume: In the case of a volume order, this is the desired target price. The amount the customer wants to spend. Only mandatory if mode is VOLUME.
  • side: BUY or SELL enum.Side
  • customers: List of customer IDs

optional

  • mode: Enum.ExecutionRequestMode. The default value is AMOUNT. Must be set to VOLUME if a volume order is to be executed.
  • risk: Factor for risk premium (0.00079 = 0.079%). On a volume order on the BUY side, it makes no sense to include a risk.
  • price: For LIMIT or STOP orders a price is necessary.
  • stop_order_condition: Defines the type of the STOP order.
  • tif_mode: enum.ExecutionTifMode, used for LIMIT and STOP orders.
  • quote_id: A reference to the quote.
  • margin: Factor for margin (0.005 = 0.5%). Overwrites the margin configured in the route. If this field is missing the margin configured in the route is used.
  • client_ref: Can be used to retrieve the status of the request later. works like a foreign_id

Response

OK

{
	"success": true,
	"data": model.Execution
}

Error

  • error.BadRequestError
  • error.InternalServerError

DELETE /executions/:execution_id


Deletes execution by ID

where type = LIMIT and state = PROCESSING

or

type = STOP_MARKET and state = WAITING_FOR_TRIGGER

Response

OK

{
  "success": true,
  "data": model.Execution
}

Error

  • error.InternalServerError

GET /executions/:execution_id/orders

Response

OK

{
  "success": true,
  "data": []model.ExecutionOrder
}

Error

  • error.InternalServerError

GET /executions/:execution_id/orders/fills

Response

OK

{
  "success": true,
  "data": []model.ExecutionFill
}

Error

  • error.InternalServerError

Fills

GET /toms/:service_id/fills

Attributes

  • service_id: a unique identifier assigned to a specific service (WOMS, TOMS, pricestream) offered by a trading venue

Get a list of all fills for a service

Query parameters

  • from
  • to

Response

OK

{
  "success": true,
  "data": []model.Fill
}

Error

  • error.BadRequestError
  • error.InternalServerError

Quotes

GET /price-stream/quotes


Get a list of all active quotes in a workspace

Response

OK

{
  "success": true,
  "data": []model.Quote
}

Error

  • error.InternalServerError

POST /price-stream/quotes


This request creates a new quote

Request

{
  "route_id": "e09a3da4-f1ca-422b-b7d1-cc1aab46cbc8",
  "request_asset": "BTC",
  "request_quantity": "1",
  "request_side": enum.Side,
  "execution_type": enum.ExecutionType,
  "risk_duration_ms": 0,
  "customer_id": "19e7b075-a119-47a7-bcc2-b133f599dbc4",
  "margin": "0.005"
}

Attributes

  • route_id: ID of the price stream route for requesting a quote
  • request_asset: Asset for requesting a quote. This could either base asset or quote asset of the price stream route. Otherwise, an error is returned
  • request_quantity: Quantity for requesting a quote. If the requested quantity is larger then the current market liquidity, the maximum available amount and volume is returned for buy and sell
  • request_side: Side of execution for the returned quote. This information is optional and can be overridden in POST /executions
  • execution_type: Type of execution for the returned quote. This information is optional and can be overridden in POST /executions call
  • risk_duration_ms: Duration of risk premium. 0, 10000, 30000 and 60000 is supported
  • customer_id: ID of the customer for assigning the execution and its transactions to

optional

  • margin: add a margin to overwrite the margin set in the route. Don’t forget to use the same margin in the execution

Response

OK

{
  "success": true,
  "data": model.Quote
}
  • error.BadRequestError
    • error_code: 3001
    • error_description: error decoding string ‘""’: can’t convert "" to decimal margin or request_quantity have to be convertible to decimal values
  • NewResourceNotFoundError
    • error_code: 4004
    • error_description: error fetching price stream topic: error getting price stream route: error during database transaction: transaction failed: error getting database value: error querying price stream route: query returned no results route_id doesn’t exist
    • error_code: 4004
    • error_description: error fetching price stream topic: error getting price stream route: error during database transaction: transaction failed: error getting database value: error querying price stream route: query returned no results customer_id doesn’t exist
  • error.InternalServerError
    • error_code: 2001
    • error_description: error fetching price stream topic: invalid single quote request: invalid request asset request_asset doesn’t match the base asset in the route

Routes

GET /price-stream/routes


Get a list of configured routes

Response

OK

{
  "success": true,
  "data": []model.PriceStreamRoute
}

Error

  • error.InternalServerError