Miscellaneous

Get Token Pairs

GET /api/get_token_pairs

Get available trading pairs with metadata on available exchanges

Name
Type
Description

market_type

string

[Optional] MarketType

Response

```json
{
    "pairs": {
        "JFI-USDC": {
            "OKX": "JFI-USDC",
            "MockExchange": "JFI-USDC"
        },
        "SHIBI-USDT": {
            "Bybit": "SHIBIUSDT"
        },
        "ICX-USDC": {
            "OKX": "ICX-USDC",
            "MockExchange": "ICX-USDC"
        },
        ...
    }
}
```

Get Order Book

GET /api/get_order_book

Get snapshot of order book from exchange

Name
Type
Description

pair*

string

name of trading pair

exchange_name*

string

name of supported exchange

Response

```json
{
    "bids": [
        {
            "price": 100425.3,
            "size": 550.82
        },
        ...
    ],
    "asks": [
        {
            "price": 100425.4,
            "size": 562.54
        },
        ...
    ]
}
```

Get Order Form Data

GET /api/order_form_data

Data that is likely needed for an order form on the UI

Response

```json
{
    "accounts": [
        {
            "id": "b77d27fc-27d2-43a6-8ffc-ce6717097b11",
            "name": "blockchain_test_bybit",
            "user": 13,
            "username": "integ_test",
            "exchange": "Bybit",
            "hashed_api_key": "71744a6a0f3178224c8b245dac64a0d1ca1dd1dd39b7aa79875488816f9fd5fa",
            "valid": true,
            "authorized_groups": [],
            "margin_mode": "CROSS",
            "created_at": "2024-12-18T08:03:53.399795Z",
            "credential_options": {},
            "api_key": "KAM7Tm2k7LBuqjy8gK",
            "api_secret": "********************",
            "password": "********************"
        },
        ...
    ]
    "exchanges": [
        "Binance",
        "Bybit",
        "Deribit",
        "OKX",
        "Gate",
    ],
    "user_id": 13,
    "pairs": [
        {
            "name": "0DOG-USDT",
            "base": "0DOG",
            "quote": "USDT",
            "market_type": "spot",
            "is_inverse": false,
            "is_contract": false,
            "exchanges": [
                "Gate"
            ]
        },
        ...
    ],    
    "strategies": [
        {
            "id": "a1e31843-cb6c-46aa-bca7-6216ef5739d8",
            "name": "VWAP",
            "params": {},
            "engine_passiveness": "0.10000000000000000555",
            "schedule_discretion": "0.08000000000000000167",
            "alpha_tilt": null,
            "strategy_params": {},
            "system": true,
            "schedule": "VWAP",
            "description": "Volume Weighted Average Price",
            "user": "admin"
        },
        ...
    ],
    "super_strategies": [
        {
            "id": "d960c28f-a6bd-4f55-9c5c-fc561cc95640",
            "strategy_id": "a1e31843-cb6c-46aa-bca7-6216ef5739d8",
            "name": "Impact Minimization",
            "presets": {
                "notes": null,
                "duration": 300,
                "discretion": 0.08,
                "limitPrice": null,
                "orderCondition": null
            },
            "is_super_strategy": true
        },
        ...
    ],
   "strategy_params": [
        "passive_only",
        "active_limit",
        "reduce_only",
        "strict_duration",
        "spot_leverage",
        "max_clip_size"
    ],
    "order_templates": [
        {
            "id": "94e5a389-90c2-4edc-9c24-b6a58350b7e9",
            "user_id": 13,
            "name": "pov",
            "values": {
                "pair": {
                    "id": "ETH:PERP-USDT",
                    "base": "ETH",
                    "label": "ETH:PERP-USDT",
                    "quote": "USDT",
                    "exchanges": [
                        "OKX",
                        "Deribit",
                        "Binance",
                        "Bybit",
                        "MockExchange"
                    ],
                    "is_inverse": false,
                    "is_contract": true,
                    "market_type": "perp"
                },
                "side": "buy",
                "accounts": [
                    "test_okx"
                ],
                "strategy": "a1e31843-cb6c-46aa-bca7-6216ef5739d8",
                "pov_target": "5",
                "base_asset_qty": "5",
                "super_strategy": "d960c28f-a6bd-4f55-9c5c-fc561cc95640",
                "strategy_params": {
                    "ool_pause": false
                },
                "engine_passiveness": 0.02,
                "schedule_discretion": 0.08
            },
            "created_at": "2024-06-23T21:37:27.825932Z"
        },
        ...
    ],
    "auto_order_urgencies": [
        {
            "key": "ULTRA_LOW",
            "name": "Very Low"
        },
        {
            "key": "LOW",
            "name": "Low"
        },
        {
            "key": "MEDIUM",
            "name": "Medium"
        },
        {
            "key": "HIGH",
            "name": "High"
        },
        {
            "key": "ULTRA_HIGH",
            "name": "Very High"
        }
    ]
}
```

Validate Order Condition

POST /api/validate_order_condition/

Validate the correctness of the order condition syntax

Name
Type
Description

order_condition

string

Response

```json
{
    "order_condition": "( ETH-USDT@Binance - ETH:PERP-USDT@Binance ) > 1",
    "order_condition_vars": {},
    "postfix_condition": "ETH-USDT@Binance ETH:PERP-USDT@Binance - 1 >",
    "is_valid": true
}
```

Was this helpful?