Analytics

Get aggregate TCA statistics

GET /api/tca_stats/

Retrieves aggregate statistics for a set of orders, as filtered by query parameters below. Note that the output is a subset of the data shown on TaaS's Analytics page.

Query Parameters

Name
Type
Description

accounts__name

string

Account to include in aggregation

pair

string

Example: BTC-USDT

side

string

buy or sell

strategy

string

Trajectory to include (VWAP, TWAP, IS)

super_strategy

string

Strategy to include (Impact Minimization, Aggressive Maker, etc.) Note that only one of (strategy, super_strategy) should be specified in a call

created_at__gte

ISO 8601 date

Include only orders created on or after this date, e.g., 2024-09-13

created_at__lte

ISO 8601 date

Include only orders created on or before this date, e.g., 2024-09-14

{'summary': {'num_orders': 1000,
  'num_pairs': 8,
  'avg_duration': 175.74219266221795,
  'sum_notional': 12436204.142881382,
  'orders_value': '$12.44M',
  'sum_fee': 4741.834601611435,
  'exch_fee': '$4.74K',
  'fee_cost': 3.8129276000392065,
  'pov': 0.0,
  'departure_cost': 0.7686062896022027,
  'arrival_cost': 0.6356043187543811,
  'vwap_cost': 0.6395291279757329,
  'interval_returns': -0.13300197084782164},
 'breakdowns': {'fill_role': {'cutbys': ['role'],
   'labels': ['TAKE', 'MAKE', 'OTC'],
   'data': {'TAKE': [58.74792384940719],
    'MAKE': [40.844465220094875],
    'OTC': [0.4076109304979441]}},
  'fill_exchange': {'cutbys': ['exchange'],
   'labels': ['OKX', 'OKXOTC', 'Bybit'],
   'data': {'OKX': [99.51157408033795],
    'OKXOTC': [0.4076109304979441],
    'Bybit': [0.08081498916409907]}}}}

Get orders with detailed stats (TCA data)

GET /api/orders_with_stats/

Similar to data from GET /orders endpoint, but includes more detailed execution info: list of fills and relevant transaction cost analysis data such as arrival and departure price.

Query Parameters

Name
Type
Description

page_size

number

size of paginated orders, max 1000

default: 500

page

number

1-indexed page number

default: 1

{
    "orders": [
        {
            "id": "8cb8b3f6-d0ed-4dcc-97cb-d46baab928c9",
            "custom_order_id": "",
            "notes": "",
            "pair": "1INCH:PERP-USDT",
            "side": "buy",
            "buy_token": "1INCH:PERP",
            "sell_token": "USDT",
            "sell_token_amount": 376.4,
            "executed_qty": 376.5159,
            "average_executed_price": 0.37651596708133706,
            "executed_notional": 376.5159,
            "total_fee": 0.17899986,
            "strategy": "TWAP",
            "super_strategy": "Impact Minimization",
            "duration": 120,
            "accounts": [
                "8640fa74-c66f-44a9-8686-c71bf0491ec4"
            ],
            "account_names": [
                "okxtest"
            ],
            "engine_passiveness": 0.02,
            "schedule_discretion": 0.08,
            "strategy_params": {
                "reduce_only": true,
                "passive_only": false
            },
            "user": "2",
            "status": "COMPLETE",
            "is_simple": false,
            "failure_reason": "",
            "limit_price": -1.0,
            "time_start": "2024-01-25T23:25:54.712402Z",
            "time_end": "2024-01-25T23:27:54.712402Z",
            "created_at": "2024-01-25T23:25:54.762625Z",
            "updated_at": "2024-01-25T23:30:49.646518Z",
            "fills": [
                {
                    "placement_id": "a5b2018a-173e-4972-b1c9-c4bbca81e7b6",
                    "role": "TAKE",
                    "executed_price": 0.3765,
                    "executed_qty": 17.6955,
                    "executed_notional": 17.6955,
                    "fee": 0.00884775,
                    "fill_time": "2024-01-25T23:26:13.346000Z"
                },
                //...
            ],
            "stats": {
                      "order_id": "8cb8b3f6-d0ed-4dcc-97cb-d46baab928c9",
                      "stat_id": 233531,
                      "interval_volume": 544.5882,
                      "vwap": 3214.6546467955054,
                      "arrival_price": 3214.81,
                      "departure_price": 3215.08
                      }
        },
        //...
    ],
    "page_number": 1,
    "page_size": 500,
    "num_pages": 1,
    "order_count": 73
}

Get multi order TCA

GET /api/multi_order_tca

Similar to data from GET /orders endpoint, but includes more detailed execution info: list of fills and relevant transaction cost analysis data such as arrival and departure price. Refer to Benchmark Costs for detailed explanations on some of the metrics.

Query Parameters

Need either multi_order_id or custom_order_id

Name
Type
Description

multi_order_id

string

UUID of multi order

custom_order_id

string

specified multi order

{
  "notional_exposure": 57.451, // in USD
  "fee_notional": 9.94468e-7, // in USD
  "fee_cost": 0.00004, // in bps
  "vwap_cost": 39.23477228401562, // in bps
  "arrival_cost": 40.250532544640556, // in bps
  "pov": 0.19167316910751267 // participation rate in percent i.e. this is 0.19%
}

Last updated

Was this helpful?