NAV
http python

CHANGE LOG

2024-02-08

/private/batch_cancel_fixed_orders and /private/batch_cancel_floating_orders are combined into one endpoint POST /api/trade/cancel-batch-orders

accountId parameter is now required in POST /api/trade/cancel-order

2024-01-12

/private/cancel_fixed_order and /private/cancel_floating_order are combined into one endpoint POST /api/trade/cancel-order

Obsoleted API GET /private/get_positions_and_dv01. Users can use GET /private/get_all_positions to get the user's positions, dv01, mtm for a given account ID.

Updated response for GET /private/get_all_positions

2023-12-21

TESTNET migrated from Goerli to Sepolia. Make sure to connect to Sepolia for deposit to function.

2023-12-18

WebSocket channel /ws/user removed. All events can now be subscribed via /ws. Authentication is required for user events.

2023-12-07

APIs no longer use market ID; instead use instrument ID which can be found from GET /public/get_all_markets

2023-10-30

Revised for Testnet v2 launch

INTRODUCTION

Welcome

Welcome to Infinity Exchange API reference! Our WebSocket and REST APIs provide seamless access to market data, order placement, and more.

We offer REST API call examples in HTTP requests and Python language. You can view the code examples in the panel to the right, and toggle between programming languages with the tabs in upper right corner.

Infinity Exchange APIs can be used in different languages via community supported packages:

Please contact us via email or on our Telegram channel if you've any questions or suggestions. We'd love to hear from you!

Environments

Environment RPC URL Chain ID API base URL
Mainnet Coming soon Coming soon Coming soon
Testnet https://rpc.sepolia.org 11155111 https://api.testnet.infinity.exchange

Connecting to Infinity Exchange

Endpoints are divided into two categories: public and private.

public endpoints provide access to market data, order book snapshots, trade history, and more; information that is available to all users. These endpoints are open and do not require authentication, allowing developers to retrieve real-time market data for analysis or display purposes. On the other hand, private endpoints require authentication and provide access to account-specific information and trading functionality.

For interacting with our private endpoints, a login is required. The login workflow is as follows:

  1. Get the login sign message by calling the endpoint /login with the appropriate addr and chainId.
  2. Sign the login message and call the endpoint /verify_login with the addr, nonceHash, and signature. You will now receive the JWT access token, as well as user-related data, and now be able to call any private endpoints.
  3. Before the access token has expired, call /refresh_login to get a new access token.

Example python code showing this workflow is on the right under the python tab.

REST API

Response structure

Every API response contains a success flag and a response body.

Name Type Description
success boolean Whether API call is successful or not
data object Response body

Authentication

POST /login

Code sample:

Copy to Clipboard
POST /login { "addr": "0x5eF1B2c02f5E39C0fF667611C5d7EfFb0E7df305", "chainId": "7a6a" }

Example response:

Copy to Clipboard
{ "success": true, "data": { "status": "verify", "eip712Message": "{\"types\":{\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}],\"data\":[{\"name\":\"hash\",\"type\":\"string\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"domain\",\"type\":\"string\"}]},\"primaryType\":\"data\",\"message\":{\"hash\":\"52a90c73\",\"message\":\"Please sign this message to verify account ownership\",\"domain\":\"infinity.exchange\"},\"domain\":{\"name\":\"Infinity Exchange Login\",\"version\":\"1\",\"chainId\":31338,\"verifyingContract\":\"0x0000000000000000000000000000000000000000\"}}", "nonceHash": "52a90c73" } }

Log in.

Request

Parameter Required Type Description
addr YES string User's EOA account (wallet) address
chainId YES string Chain ID

Response Body

Name Type Description
status string Login status
eip712Message object EIP712 message
nonceHash string A unique four-byte nonce to identify this particular login request

POST /verify_login

Code sample:

Copy to Clipboard
POST /verify_login { "addr": "0xe61f536f031f77C854b21652aB0F4fBe7CF3196F", "nonceHash": "517d9272", "signature": "0xc046037ec795f4cfe7aca33a0c283c0152bae91008b3e14b84be50f91f0e2db714054dee85b840e3edf0e26480231a684447f48337de64ea6697a3552aa9351a1b" }

Example response:

Copy to Clipboard
{ "success": true, "data": { "user": { "userId": 78, "address": "0xe61f536f031f77c854b21652ab0f4fbe7cf3196f", "status": 1, "userType": 1, "userClass": 1, "accounts": [ { "accountId": 242, "userId": 78, "type": 1, "name": "Current", "status": 1, "healthScore": 10000.0, "asset": 0.0, "assetLtv": 0.0, "liability": 0.0, "ratesMargin": 0.0, "ltvType": 1, "updateDate": 1698127521000 }, { "accountId": 243, "userId": 78, "type": 2, "name": "Trading", "status": 1, "healthScore": 10000.0, "asset": 0.0, "assetLtv": 0.0, "liability": 0.0, "ratesMargin": 0.0, "ltvType": 1, "updateDate": 1698127521000 } ] }, "accessToken": { "data": { "header": { "alg": "ES256", "typ": "JWT" }, "payload": { "user": { "userId": 78, "address": "0xe61f536f031f77c854b21652ab0f4fbe7cf3196f", "roles": [ "ROLE_USER" ] }, "access_type": "access_token", "iat": 1698633225, "exp": 1698636825 } }, "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJJZCI6NzgsImFkZHJlc3MiOiIweGU2MWY1MzZmMDMxZjc3Yzg1NGIyMTY1MmFiMGY0ZmJlN2NmMzE5NmYiLCJyb2xlcyI6WyJST0xFX1VTRVIiXX0sImFjY2Vzc190eXBlIjoiYWNjZXNzX3Rva2VuIiwiaWF0IjoxNjk4NjMzMjI1LCJleHAiOjE2OTg2MzY4MjV9.E3aIKqqFsHVBYedAuqn6Jw6bymsWy6RQ6gf_lDXnYNorjngA05uFLaTM0A2ZrN4kJ8nTXEjlrdhLU8crisJcdA" } } }

Verify login.

Request

Parameter Required Type Description
addr YES string User's EOA account (wallet) address
nonceHash YES string Nonce Hash
signature YES string Signature

Response Body

Name Type Description
user User User details
accessToken string Access token

POST /refresh_login

Code sample:

Copy to Clipboard
POST /refresh_login { "refreshToken": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJJZCI6MzEsImFkZHJlc3MiOiIweDVjODEyYzlhNjdlNjkwMGViMjBmM2YzMWQwZWNjZTUyM2Q2YTVjMDMiLCJyb2xlcyI6WyJST0xFX1VTRVIiXX0sImFjY2Vzc190eXBlIjoicmVmcmVzaF90b2tlbiIsImlhdCI6MTY5NzQyNDM0MCwiZXhwIjoxNjk4MDI5MTQwfQ.Y5dtx_VXGDZ4EDt4e6qtaVd811XumXjtDtVMiQeibNCai5zvV1PJJ3R8WCTSZb6NbbxAtFsTglYRD10aigDECA" }

Example response:

Copy to Clipboard
{ "success": true, "data": { "user": { "userId": 31, "address": "0x5c812c9a67e6900eb20f3f31d0ecce523d6a5c03", "userType": 1, "status": 1, "accounts": [ { "accountId": 127, "type": 1, "cashTokenIds": [ 1 ], "irTokenIds": [ 1 ] }, { "accountId": 128, "type": 2, "cashTokenIds": [ 1, 2, 3, 4, 5 ], "irTokenIds": [ 1, 3, 2, 4, 5 ] } ] }, "accessToken": { "data": { "header": { "alg": "ES256", "typ": "JWT" }, "payload": { "user": { "userId": 31, "address": "0x5c812c9a67e6900eb20f3f31d0ecce523d6a5c03", "roles": [ "ROLE_USER" ] }, "access_type": "access_token", "iat": 1697449134, "exp": 1697452734 } }, "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJJZCI6MzEsImFkZHJlc3MiOiIweDVjODEyYzlhNjdlNjkwMGViMjBmM2YzMWQwZWNjZTUyM2Q2YTVjMDMiLCJyb2xlcyI6WyJST0xFX1VTRVIiXX0sImFjY2Vzc190eXBlIjoiYWNjZXNzX3Rva2VuIiwiaWF0IjoxNjk3NDQ5MTM0LCJleHAiOjE2OTc0NTI3MzR9.reUyFbhlJ6ZXSUypWiWeikaPQdbcRB_ZgB2k4NxcKbJS1K9J1GZnfXl9GrYOmS67L19gC-wfKqSPN4-7T3Xk0w" } } }

Get access token by non-expired refresh token.

Request

Parameter Required Type Description
refreshToken YES string Refresh token

Response Body

Name Type Description
user User User details
accessToken object Access token used for authentication:

See Connecting to Infinity section

POST /logout

Code sample:

Copy to Clipboard
POST /logout

Example response:

Copy to Clipboard
{}

Log out.

Request

No parameters for this endpoint.

Response Body

No response data for this endpoint.

Funding

GET /private/deposit

Code sample:

Copy to Clipboard
GET /private/deposit

Example response:

Copy to Clipboard
{ "success": true, "data": { "deposits": [] } }

Get fund deposits history.

Request

Parameter Required Type Description
limit NO integer Maximum number of deposits to return
startBlockId NO integer Block start ID

Response Body

Name Type Description
deposits object[] List of deposits

GET /private/get_withdraw_status

Code sample:

Copy to Clipboard
GET /private/get_withdraw_status?requestIds=123%2c456

Example response:

Copy to Clipboard
{ "success": true, "data": { "requests": [] } }

Get fund withdrawal request status (for given list of request IDs).

Request

Parameter Required Type Description
requestIds YES integer[] List of fund withdrawal request IDs

Response Body

Name Type Description
requests object[] List of withdraw requests and their status

GET /private/get_withdraws

Code sample:

Copy to Clipboard
GET /private/get_withdraws

Example response:

Copy to Clipboard
{ "success": true, "data": { "requests": [] } }

Get list of fund withdrawals.

Request

Parameter Required Type Description
limit NO integer Maximum number of withdrawals to return
startId NO integer Fund withdrawal request start ID

Response Body

Name Type Description
requests object[] List of withdraw requests

POST /private/withdraw

Code sample:

Copy to Clipboard
POST /private/withdraw [ { "chainId": 1, "tokenId": 1, "quantity": 0.1 } ]

Example response:

Copy to Clipboard
{ "ids": [ 123 ] }

Request to withdraw funds.

Request

Parameter Required Type Description
requests YES object[] List of withdraw requests
└ chainId YES integer Chain ID
└ tokenId YES integer Token ID
└ quantity YES integer Quantity to be withdrawn

Response Body

Name Type Description
ids integer[] List of request IDs

GET /public/get_blockchain_info

Code sample:

Copy to Clipboard
GET /public/get_blockchain_info?blockChainId=1

Example response:

Copy to Clipboard
{ "success": true, "data": { "blockChain": { "chainId": 1, "name": "Ethereum", "enable": true, "visible": true, "processedBlockNum": 18807982, "processedBlockHash": "0x4d11b95ed254e16045d09dda2ad87a3428d50b051a7599785a60d28205930aaf" } } }

Get block chain details for a given chain ID.

Request

Parameter Required Type Description
blockChainId YES integer Chain ID

Response Body

Name Type Description
blockChain object Block chain details
└ chainId integer Unique ID for the chain, assigned by Infinity Exchange:

Currently only Ethereum (Chain ID 1) is supported.
└ name string Name of the blockchain (e.g. Ethereum)
└ enable boolean Whether this chain is enabled within Infinity Exchange:

This should always return true.
└ visible boolean Whether this chain is visible on Infinity Exchange:

This should always return true.
└ processedBlockNum integer The chain's latest block number
└ processedBlockHash string The chain's latest block hash value

Markets

GET /private/get_market_mtms

Code sample:

Copy to Clipboard
GET /private/get_market_mtms?accountId=128

Example response:

Copy to Clipboard
{ "success": true, "data": { "mtm": [ { "accountId": 128, "instrumentId": 1, "tokenId": 1, "mtm": "1155.2223", "key": { "accountId": 128 } }, { "accountId": 128, "instrumentId": 11829, "tokenId": 1, "mtm": "-65322.24298423901", "key": { "accountId": 128 }, "maturityDate": 1697526000000 }, { "accountId": 128, "instrumentId": 11830, "tokenId": 1, "mtm": "-7036.62774795969", "key": { "accountId": 128 }, "maturityDate": 1697612400000 }, ] } }

Get marked-to-market values (for each floating and fixed rate markets) of a given account ID.

Request

Parameter Required Type Description
accountId YES integer Account ID

Response Body

Name Type Description
mtm object[] List of mark-to-market values
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ tokenId integer Infinity Exchange token ID

See Token IDs section for list of Token IDs
└ mtm string Mark-to-market value in USD for this token ID
└ maturityDate integer Maturity date timestamp
└ key object Key object
 └ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange

GET /private/get_market_summaries

Code sample:

Copy to Clipboard
GET /private/get_market_summaries?tokenId=1

Example response:

Copy to Clipboard
{ "success": true, "data": { "summary": { "position": "181.04904", "dv01": "0.000149070723680844", "carry": "-10229.298693628527759373" }, "ir": { "instrumentId": 1, "bid": "0.0236", "bidQuantity": "148.9785", "bidStepSize": "2", "ask": "0.0261", "askQuantity": "130.1169", "askStepSize": "2", "position": "0.14", "carry": "0.003318" }, "fr": [ { "instrumentId": 11829, "name": "ETH-1D", "daysToMaturity": 1, "marketRate": "0.03625", "bid": "0.0344", "bidQuantity": "2.4132", "bidStepSize": "2", "ask": "0.0404", "askQuantity": "8.5623", "askStepSize": "2", "position": "-40.0897", "pv01Series": "0.0000002739459", "dv01": "-0.00001098240894723" }, { "instrumentId": 11830, "name": "ETH-2D", "daysToMaturity": 2, "marketRate": "0.04515", "bid": "0.0444", "bidQuantity": "4.6622", "bidStepSize": "2", "ask": "0.0472", "askQuantity": "3.174", "askStepSize": "2", "position": "-4.3019", "pv01Series": "0.0000005478523", "dv01": "-0.00000235680580937" }, { "instrumentId": 11832, "name": "ETH-1W", "daysToMaturity": 4, "marketRate": "0.04795", "bid": "0.0469", "bidQuantity": "4.1937", "bidStepSize": "2", "ask": "0.05", "askQuantity": "8.143", "askStepSize": "2", "position": "3.5616", "pv01Series": "0.0000010955544", "dv01": "0.00000390192655104" }, { "instrumentId": 11839, "name": "ETH-2W", "daysToMaturity": 11, "marketRate": "0.04845", "bid": "0.0455", "bidQuantity": "2.1814", "bidStepSize": "2", "ask": "0.0527", "askQuantity": "12.3243", "askStepSize": "2", "position": "417.8205", "pv01Series": "0.0000030113844", "dv01": "0.0012582181357002" }, { "instrumentId": 11839, "name": "ETH-1M", "daysToMaturity": 11, "marketRate": "0.04845", "bid": "0.0455", "bidQuantity": "2.1814", "bidStepSize": "2", "ask": "0.0527", "askQuantity": "12.3243", "askStepSize": "2", "position": "417.8205", "pv01Series": "0.0000030113844", "dv01": "0.0012582181357002" }, { "instrumentId": 11867, "name": "ETH-3W", "daysToMaturity": 18, "marketRate": "0.05045", "bid": "0.0492", "bidQuantity": "4.787", "bidStepSize": "2", "ask": "0.055", "askQuantity": "11.942", "askStepSize": "2", "position": "-19.6343", "pv01Series": "0.0000049253793", "dv01": "-0.00009670637478999" }, { "instrumentId": 11971, "name": "ETH-2M", "daysToMaturity": 39, "marketRate": "0.0499", "bid": "0.0483", "bidQuantity": "9.1411", "bidStepSize": "2", "ask": "0.0557", "askQuantity": "3.3703", "askStepSize": "2", "position": "-234.1911", "pv01Series": "0.0000106563138", "dv01": "-0.00249561385076718" }, { "instrumentId": 12146, "name": "ETH-3M", "daysToMaturity": 74, "marketRate": "0.05385", "bid": "0.0524", "bidQuantity": "4.4707", "bidStepSize": "2", "ask": "0.0587", "askQuantity": "4.1585", "askStepSize": "2", "position": "136.9193", "pv01Series": "0.0000201690199", "dv01": "0.00276152808639407" }, { "instrumentId": 12146, "name": "ETH-1Q", "daysToMaturity": 74, "marketRate": "0.05385", "bid": "0.0524", "bidQuantity": "4.4707", "bidStepSize": "2", "ask": "0.0587", "askQuantity": "4.1585", "askStepSize": "2", "position": "136.9193", "pv01Series": "0.0000201690199", "dv01": "0.00276152808639407" }, { "instrumentId": 12608, "name": "ETH-2Q", "daysToMaturity": 165, "marketRate": "0.0553", "bid": "0.0516", "bidQuantity": "4.51396", "bidStepSize": "2", "ask": "0.0605", "askQuantity": "3.11141", "askStepSize": "2", "position": "-233.68636", "pv01Series": "0.0000446029641", "dv01": "-0.010423104325739676" }, { "instrumentId": 15172, "name": "ETH-3Q", "daysToMaturity": 256, "marketRate": "0.05345", "bid": "0.0519", "bidQuantity": "4.007", "bidStepSize": "2", "ask": "0.0584", "askQuantity": "3.5704", "askStepSize": "2", "position": "215.9911", "pv01Series": "0.0000687194291", "dv01": "0.01484278508268101" }, { "instrumentId": 15632, "name": "ETH-4Q", "daysToMaturity": 347, "marketRate": "0.05565", "bid": "0.0552", "bidQuantity": "2.8427", "bidStepSize": "2", "ask": "0.0588", "askQuantity": "7.8945", "askStepSize": "2", "position": "-61.4801", "pv01Series": "0.0000925274803", "dv01": "-0.00568859874159203" } ] } }

Get order book summaries for a given token ID (and list of fixed rate instrument IDs). Current position will be shown as well.

Request

Parameter Required Type Default value Description
tokenId YES integer Token ID
fixedRateInstrumentIds NO string[] List of fixed rate instrument IDs
minBidAskSize NO number 2 Minimum bid & ask quantity

Response Body

Name Type Description
summary object Summary object
└ position string Sum of all positions returned
└ dv01 string Sum of all dv01 values returned
└ carry string sum of all carry values for the markets returned
ir object Floating rate object
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ bid string Best borrow rate currently being bid on Infinity Exchange for this market
└ bidQuantity string Total quantity available at the best borrow rate currently being bid on Infinity Exchange for this market
└ bidStepSize string Minimum increment between different bid rate levels
└ ask string Best lending rate currently being offered on Infinity Exchange for this market
└ askQuantity string Total quantity available at the best lending rate currently being offered on Infinity Exchange for this market
└ askStepSize string Minimum increment between different offer rate levels
└ position string User's net positions
└ carry string Coupon accrued from last coupon payment time up to now
fr object[] List of fixed rate objects
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ name string Fixed market name
└ daysToMaturity integer Number of days to expiry
└ marketRate string The last traded rate of this market
└ bid string Best borrow rate currently being bid on Infinity Exchange for this market
└ bidQuantity string Total quantity available at the best borrow rate currently being bid on Infinity Exchange for this market
└ bidStepSize string Minimum increment between different bid rate levels
└ ask string Best lending rate currently being offered on Infinity Exchange for this market
└ askQuantity string Total quantity available at the best lending rate currently being offered on Infinity Exchange for this market
└ askStepSize string Minimum increment between different offer rate levels
└ position string User's net positions
└ pv01Series string Price value of a basis point
└ dv01 string DV01 value

GET /public/get_all_fixed_details

Code sample:

Copy to Clipboard
GET /public/get_all_fixed_details

Example response:

Copy to Clipboard
{ "success": true, "data": { "markets": [ { "instrumentId": 11080, "tokenId": 2, "code": "USDT-2023-10-17", "name": "USDT-FIXED", "rate": "0.0284", "bestBid": "0.0272", "midRate": "0.0278", "bestAsk": "0.0284", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": true, "daysToMaturity": 1, "updateDate": 1697450635000, "maturityDate": 1697526000000 }, { "instrumentId": 11445, "tokenId": 4, "code": "DAI-2023-10-17", "name": "DAI-FIXED", "rate": "0.0274", "bestBid": "0.0274", "midRate": "0.0282", "bestAsk": "0.029", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 1, "updateDate": 1697450635000, "maturityDate": 1697526000000 }, { "instrumentId": 11810, "tokenId": 5, "code": "WBTC-2023-10-17", "name": "WBTC-FIXED", "rate": "0.0297", "bestBid": "0.0297", "midRate": "0.0316", "bestAsk": "0.0335", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 1, "updateDate": 1697450634000, "maturityDate": 1697526000000 }, { "instrumentId": 11829, "tokenId": 1, "code": "ETH-2023-10-17", "name": "ETH-FIXED", "rate": "0.0338", "bestBid": "0.0338", "midRate": "0.03505", "bestAsk": "0.0363", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 1, "updateDate": 1697450635000, "maturityDate": 1697526000000 }, { "instrumentId": 11848, "tokenId": 3, "code": "USDC-2023-10-17", "name": "USDC-FIXED", "rate": "0.0408", "bestBid": "0.0408", "midRate": "0.04205", "bestAsk": "0.0433", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 1, "updateDate": 1697450634000, "maturityDate": 1697526000000 }, { "instrumentId": 11081, "tokenId": 2, "code": "USDT-2023-10-18", "name": "USDT-FIXED", "rate": "0.0316", "bestBid": "0.0316", "midRate": "0.03265", "bestAsk": "0.0337", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 2, "updateDate": 1697450633000, "maturityDate": 1697612400000 }, { "instrumentId": 11446, "tokenId": 4, "code": "DAI-2023-10-18", "name": "DAI-FIXED", "rate": "0.0344", "bestBid": "0.0344", "midRate": "0.03475", "bestAsk": "0.0351", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 2, "updateDate": 1697450632000, "maturityDate": 1697612400000 }, { "instrumentId": 11811, "tokenId": 5, "code": "WBTC-2023-10-18", "name": "WBTC-FIXED", "rate": "0.0348", "bestBid": "0.035", "midRate": "0.036", "bestAsk": "0.037", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 2, "updateDate": 1697450637000, "maturityDate": 1697612400000 }, { "instrumentId": 11830, "tokenId": 1, "code": "ETH-2023-10-18", "name": "ETH-FIXED", "rate": "0.0418", "bestBid": "0.0418", "midRate": "0.04265", "bestAsk": "0.0435", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 2, "updateDate": 1697450637000, "maturityDate": 1697612400000 }, { "instrumentId": 11849, "tokenId": 3, "code": "USDC-2023-10-18", "name": "USDC-FIXED", "rate": "0.0455", "bestBid": "0.0455", "midRate": "0.0473", "bestAsk": "0.0491", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 2, "updateDate": 1697450637000, "maturityDate": 1697612400000 }, { "instrumentId": 11083, "tokenId": 2, "code": "USDT-2023-10-20", "name": "USDT-FIXED", "rate": "0.0361", "bestBid": "0.0357", "midRate": "0.0359", "bestAsk": "0.0361", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": true, "daysToMaturity": 4, "updateDate": 1697450635000, "maturityDate": 1697785200000 }, ] } }

Get currently active fixed rate markets for a given token.

Request

Parameter Required Type Description
tokenId NO integer Token ID. Information for all tokens will be provided if absent.

Response Body

Name Type Description
markets object[] List of market objects
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ name string Market type

In format: token code + "-FIXED"
└ rate string Latest traded market rate for this market
└ bestBid string Best borrow rate currently being bid on Infinity Exchange for this market
└ midRate string Mid value between the current best bid rate and best ask rate
└ bestAsk string Best lending rate currently being offered on Infinity Exchange for this market
└ quantityStep string Minimum increment between different order quantities
└ minQuantity string Minimum order quantity
└ maxQuantity string Maximum order quantity
└ rateStep string Minimum increment between valid rate levels
└ enable boolean Whether this market is currently enabled

The value for this field should always be True
└ direction boolean The direction of last trade

false: active lend
true: active borrow
└ daysToMaturity integer Number of days to expiry
└ updateDate intger Datetime (in UNIX time) when the market orderbook was last updated
└ maturityDate integer Maturity datetime (in UNIX time)

GET /public/get_all_floating_details

Code sample:

Copy to Clipboard
GET /public/get_all_floating_details

Example response:

Copy to Clipboard
{ "success": true, "data": { "markets": [ { "instrumentId": "ETH-SPOT", "tokenId": 1, "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0513", "enable": true, "visible": true, "borrowPriceIndex": "1.0412911225706", "lendPriceIndex": "1.0410196410165", "priceIndexDate": 1697450640000, "rate": "0.0238", "updateDate": 1697450641000, "direction": true, "actualRate": "0.0238", "name": "ETH SPOT", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "deposits": 133850, "borrows": 16200, "subscriptions": "85838.88988", "bestRatesUpdated": false }, { "instrumentId": "USDC-SPOT", "tokenId": 3, "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0622", "enable": true, "visible": true, "borrowPriceIndex": "1.0966997737264", "lendPriceIndex": "1.0963864182633", "priceIndexDate": 1697450640000, "rate": "0.0304", "updateDate": 1697450641000, "direction": true, "actualRate": "0.031592", "name": "USDC SPOT", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "deposits": 577410, "borrows": 347497, "subscriptions": "7018736.972351461", "bestRatesUpdated": false }, { "instrumentId": "USDT-SPOT", "tokenId": 2, "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0696", "enable": true, "visible": true, "borrowPriceIndex": "1.0344320454399", "lendPriceIndex": "1.0341308131878", "priceIndexDate": 1697450640000, "rate": "0.018", "updateDate": 1697450641000, "direction": true, "actualRate": "0.017454", "name": "USDT SPOT", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "deposits": 952415, "borrows": 354100, "subscriptions": "23028404.949610823", "bestRatesUpdated": false }, { "instrumentId": "DAI-SPOT", "tokenId": 4, "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0562", "enable": true, "visible": true, "borrowPriceIndex": "1.0759474476082", "lendPriceIndex": "1.0756372764279", "priceIndexDate": 1697450640000, "rate": "0.0186", "updateDate": 1697450641000, "direction": false, "actualRate": "0.0195", "name": "DAI", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "deposits": 1160859, "borrows": 372828, "subscriptions": "15755586.030197157", "bestRatesUpdated": false }, { "instrumentId": "WBTC-SPOT", "tokenId": 5, "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0467", "enable": true, "visible": true, "borrowPriceIndex": "1.0680015975263", "lendPriceIndex": "1.0677007633801", "priceIndexDate": 1697450640000, "rate": "0.0299", "updateDate": 1697450641000, "direction": false, "actualRate": "0.0299", "name": "Wrapped Bitcoin", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "deposits": 14035, "borrows": 8343, "subscriptions": "51166.045934", "bestRatesUpdated": false } ], "tokens": [ { "tokenId": 1, "code": "ETH", "name": "ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "decimals": 18, "nativeToken": false, "withdrawFee": "0.01", "price": "1583.22882023" }, { "tokenId": 2, "code": "USDT", "name": "USDT", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "decimals": 6, "nativeToken": false, "withdrawFee": "5", "price": "1.00018501" }, { "tokenId": 3, "code": "USDC", "name": "USDC", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "decimals": 6, "nativeToken": false, "withdrawFee": "5", "price": "0.999985" }, { "tokenId": 4, "code": "DAI", "name": "DAI", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "tokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f", "decimals": 18, "nativeToken": false, "withdrawFee": "5", "price": "0.99997512" }, { "tokenId": 5, "code": "WBTC", "name": "Wrapped Bitcoin", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "tokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", "decimals": 8, "nativeToken": false, "withdrawFee": "0.001", "price": "27761.51909612" }, { "tokenId": 6, "code": "aUSDT", "name": "Aave interest bearing USDT", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 1, "tokenAddress": "0x3ed3b47dd13ec9a98b44e6204a523e766b225811", "decimals": 6, "nativeToken": false, "withdrawFee": "0", "price": "1.11914753018468015", "underlyingAssets": [ { "underlyingTokenId": 2, "underlyingTokenIndex": "1.118940515" } ] }, { "tokenId": 7, "code": "aUSDC", "name": "Aave interest bearing USDC", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 1, "tokenAddress": "0xbcca60bb61934080951369a648fb03df4f96263c", "decimals": 6, "nativeToken": false, "withdrawFee": "0", "price": "1.09273017080157", "underlyingAssets": [ { "underlyingTokenId": 3, "underlyingTokenIndex": "1.092746562" } ] }, { "tokenId": 8, "code": "aDAI", "name": "Aave interest bearing DAI", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 1, "tokenAddress": "0x028171bca77440897b824ca71d1c56cac55b68a3", "decimals": 18, "nativeToken": false, "withdrawFee": "0", "price": "1.0894173796212132", "underlyingAssets": [ { "underlyingTokenId": 4, "underlyingTokenIndex": "1.089444485" } ] }, { "tokenId": 9, "code": "aWBTC", "name": "Aave interest bearing WBTC", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 1, "tokenAddress": "0x9ff58f4ffb29fa2266ab25e75e2a8b3503311656", "decimals": 8, "nativeToken": false, "withdrawFee": "0", "price": "27864.31006270909594904", "underlyingAssets": [ { "underlyingTokenId": 5, "underlyingTokenIndex": "1.003702642" } ] }, { "tokenId": 10, "code": "aWETH", "name": "Aave interest bearing WETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 1, "tokenAddress": "0x030ba81f1c18d280636f32af80b9aad02cf0854e", "decimals": 18, "nativeToken": false, "withdrawFee": "0", "price": "1627.51360329152743209", "underlyingAssets": [ { "underlyingTokenId": 1, "underlyingTokenIndex": "1.027971183" } ] }, { "tokenId": 11, "code": "UNI-V3-POS", "name": "Uniswap V3 LP Position", "tokenType": 2, "valueType": 1, "tokenValuationProtocol": 2, "tokenAddress": "0xc36442b4a4522e871399cd717abdd847ab11fe88", "decimals": 18, "nativeToken": false, "withdrawFee": "0.001" }, { "tokenId": 12, "code": "cETH", "name": "Compound ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 3, "tokenAddress": "0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5", "decimals": 8, "nativeToken": false, "withdrawFee": "0.01", "price": "31.799625822965619", "underlyingAssets": [ { "underlyingTokenId": 1, "underlyingTokenIndex": "0.0200853" } ] }, { "tokenId": 13, "code": "cUSDC", "name": "Compound USDC", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 3, "tokenAddress": "0x39aa39c021dfbae8fac545936693ac917d5e7563", "decimals": 8, "nativeToken": false, "withdrawFee": "0.01", "price": "0.022878807812735", "underlyingAssets": [ { "underlyingTokenId": 3, "underlyingTokenIndex": "0.022879151" } ] }, { "tokenId": 14, "code": "cDAI", "name": "Compound DAI", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 3, "tokenAddress": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643", "decimals": 8, "nativeToken": false, "withdrawFee": "0.01", "price": "0.02226299408292576", "underlyingAssets": [ { "underlyingTokenId": 4, "underlyingTokenIndex": "0.022263548" } ] }, { "tokenId": 15, "code": "cWBTC", "name": "Compound WBTC", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 3, "tokenAddress": "0xc11b1268c1a384e55c48c2391d8d480264a3a7f4", "decimals": 8, "nativeToken": false, "withdrawFee": "0.01", "price": "560.90727943932738656", "underlyingAssets": [ { "underlyingTokenId": 5, "underlyingTokenIndex": "0.020204488" } ] }, { "tokenId": 16, "code": "cUSDT", "name": "Compound USDT", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 3, "tokenAddress": "0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9", "decimals": 8, "nativeToken": false, "withdrawFee": "0.01", "price": "0.02236609918658962", "underlyingAssets": [ { "underlyingTokenId": 2, "underlyingTokenIndex": "0.022361962" } ] }, { "tokenId": 17, "code": "CRV-TRI", "name": "CRV-TRI", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 4, "tokenAddress": "0xc4ad29ba4b3c580e6d59105fff484999997675ff", "decimals": 18, "nativeToken": false, "withdrawFee": "0.001", "price": "1096.23707833385604752", "underlyingAssets": [ { "underlyingTokenId": 1, "underlyingTokenIndex": "0.204882144" }, { "underlyingTokenId": 2, "underlyingTokenIndex": "374.47003762" }, { "underlyingTokenId": 5, "underlyingTokenIndex": "0.014311985" } ] }, { "tokenId": 18, "code": "CRV-3POOL", "name": "CRV-3POOL", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 4, "tokenAddress": "0x6c3f90f043a72fa612cbac8115ee7e52bde6e490", "decimals": 18, "nativeToken": false, "withdrawFee": "0.001", "price": "1.02596804911137505", "underlyingAssets": [ { "underlyingTokenId": 2, "underlyingTokenIndex": "0.304850233" }, { "underlyingTokenId": 3, "underlyingTokenIndex": "0.368333361" }, { "underlyingTokenId": 4, "underlyingTokenIndex": "0.352742356" } ] }, { "tokenId": 19, "code": "stETH", "name": "Staked ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "tokenAddress": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84", "decimals": 18, "nativeToken": false, "withdrawFee": "0.01", "price": "1582.90198672" }, { "tokenId": 19, "code": "stETH", "name": "Staked ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "tokenAddress": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84", "decimals": 18, "nativeToken": false, "withdrawFee": "0.01", "price": "1583.22882023" } ] } }

Get floating rate market details.

Request

Parameter Required Type Default value Description
simple NO boolean false Return only essential information

Response Body

Name Type Description
markets object[] List of market objects
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ quantityStep string Minimum increment between different order quantities
└ minQuantity string Minimum order quantity
└ maxQuantity string Maximum order quantity
└ rateStep string Minimum increment between valid rate levels
└ category integer Category for this market

The value for this category should always be 1.
└ takerFeeRate string Taker fee rate as a percentage of the order quantity
└ makerFeeRate string Maker fee rate as a percentage of the order quantity
└ interestFeeRate string The fee rate when user receive interest
└ enable boolean Whether this market is currently enabled

The value for this field should always be True
└ visible boolean Whether this market is currently enabled

The value for this field should always be True
└ borrowPriceIndex string Value of borrowing relative to that of inception date
└ lendPriceIndex string Value of lending relative to that of inception date
└ priceIndexDate integer The date of inception of price index (index = 1.0)
└ rate string Latest traded market rate for this market
└ updateDate intger Datetime (in UNIX time) when the market orderbook was last updated
└ direction boolean The direction of last trade

false: active lend
true: active borrow
└ actualRate string The latest rate used to calculate the price index
└ name string Floating market name

In format: token code + " SPOT"
└ deposits integer Lending order book depth
└ borrows integer Borrowing order book depth
└ subscriptions string Current outstanding borrows
tokens object[] List of Token objects
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ code string Token code

See Token IDs section for list of token codes
└ name string Token code

See Token IDs section for list of token names
└ tokenType integer Token type:

Currently all tokens at Infinity Exchange are designated as type 1
└ valueType integer Value type:

1 for non-stablecoin tokens
2 for stablecoin tokens
└ tokenValuationProtocol integer Platform the complex token comes from (if relevant):

See Token Valuation Protocols section
└ tokenAddress string Token chain address
└ decimals integer Number of decimal precision for this token
└ nativeToken boolean Is this a native token?
└ withdrawFee string Withdrawal fee (in number of tokens)
└ price string Latest token price

GET /public/get_all_markets

Code sample:

Copy to Clipboard
GET /public/get_all_markets

Example response:

Copy to Clipboard
{ "success": true, "data": { "markets": [ { "instrumentId": 1, "tokenId": 1, "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0513", "enable": true, "visible": true, "borrowPriceIndex": "1.0412911693631", "lendPriceIndex": "1.0410196874098", "priceIndexDate": 1697450700000, "rate": "0.0238", "updateDate": 1697450709000, "direction": false, "actualRate": "0.0238", "name": "ETH SPOT", "code": "ETH-SPOT", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "deposits": 133773, "borrows": 16215, "subscriptions": "85837.19378", "bestRatesUpdated": false }, { "instrumentId": 2, "tokenId": 3, "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0622", "enable": true, "visible": true, "borrowPriceIndex": "1.0966998401035", "lendPriceIndex": "1.0963864842172", "priceIndexDate": 1697450700000, "rate": "0.0314", "updateDate": 1697450710000, "direction": false, "actualRate": "0.032223", "name": "USDC SPOT", "code": "USDC-SPOT", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "deposits": 585339, "borrows": 371812, "subscriptions": "7018812.402351461", "bestRatesUpdated": false }, { "instrumentId": 5, "tokenId": 2, "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0696", "enable": true, "visible": true, "borrowPriceIndex": "1.0344320798506", "lendPriceIndex": "1.0341308472018", "priceIndexDate": 1697450700000, "rate": "0.0174", "updateDate": 1697450711000, "direction": true, "actualRate": "0.017538", "name": "USDT SPOT", "code": "USDT-SPOT", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "deposits": 858117, "borrows": 364580, "subscriptions": "23029031.729610823", "bestRatesUpdated": false }, { "instrumentId": 7, "tokenId": 4, "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0562", "enable": true, "visible": true, "borrowPriceIndex": "1.0759474877685", "lendPriceIndex": "1.0756373161752", "priceIndexDate": 1697450700000, "rate": "0.0182", "updateDate": 1697450710000, "direction": false, "actualRate": "0.019712", "name": "DAI", "code": "DAI-SPOT", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "deposits": 1190750, "borrows": 365671, "subscriptions": "15756284.020197157", "bestRatesUpdated": false }, { "instrumentId": 8, "tokenId": 5, "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0467", "enable": true, "visible": true, "borrowPriceIndex": "1.0680016575888", "lendPriceIndex": "1.0677008230312", "priceIndexDate": 1697450700000, "rate": "0.0299", "updateDate": 1697450711000, "direction": true, "actualRate": "0.0299", "name": "Wrapped Bitcoin", "code": "WBTC-SPOT", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "deposits": 14038, "borrows": 8342, "subscriptions": "51167.299534", "bestRatesUpdated": false }, { "instrumentId": 11080, "tokenId": 2, "code": "USDT-2023-10-17", "name": "USDT-FIXED", "rate": "0.0271", "bestBid": "0.0271", "midRate": "0.02815", "bestAsk": "0.0292", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 1, "updateDate": 1697450711000, "maturityDate": 1697500800000 }, { "instrumentId": 11445, "tokenId": 4, "code": "DAI-2023-10-17", "name": "DAI-FIXED", "rate": "0.0274", "bestBid": "0.0274", "midRate": "0.02835", "bestAsk": "0.0293", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 1, "updateDate": 1697450709000, "maturityDate": 1697500800000 }, { "instrumentId": 11810, "tokenId": 5, "code": "WBTC-2023-10-17", "name": "WBTC-FIXED", "rate": "0.0296", "bestBid": "0.0296", "midRate": "0.03205", "bestAsk": "0.0345", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 1, "updateDate": 1697450711000, "maturityDate": 1697500800000 }, { "instrumentId": 11829, "tokenId": 1, "code": "ETH-2023-10-17", "name": "ETH-FIXED", "rate": "0.0332", "bestBid": "0.0332", "midRate": "0.0345", "bestAsk": "0.0358", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 1, "updateDate": 1697450709000, "maturityDate": 1697500800000 }, { "instrumentId": 11848, "tokenId": 3, "code": "USDC-2023-10-17", "name": "USDC-FIXED", "rate": "0.0408", "bestBid": "0.0408", "midRate": "0.0421", "bestAsk": "0.0434", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 1, "updateDate": 1697450711000, "maturityDate": 1697500800000 }, { "instrumentId": 11081, "tokenId": 2, "code": "USDT-2023-10-18", "name": "USDT-FIXED", "rate": "0.0316", "bestBid": "0.0316", "midRate": "0.03235", "bestAsk": "0.0331", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 2, "updateDate": 1697450710000, "maturityDate": 1697587200000 }, { "instrumentId": 11446, "tokenId": 4, "code": "DAI-2023-10-18", "name": "DAI-FIXED", "rate": "0.0345", "bestBid": "0.0345", "midRate": "0.0349", "bestAsk": "0.0353", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 2, "updateDate": 1697450709000, "maturityDate": 1697587200000 }, { "instrumentId": 11811, "tokenId": 5, "code": "WBTC-2023-10-18", "name": "WBTC-FIXED", "rate": "0.0348", "bestBid": "0.0348", "midRate": "0.03645", "bestAsk": "0.0381", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 2, "updateDate": 1697450711000, "maturityDate": 1697587200000 }, { "instrumentId": 11830, "tokenId": 1, "code": "ETH-2023-10-18", "name": "ETH-FIXED", "rate": "0.0432", "bestBid": "0.0432", "midRate": "0.04375", "bestAsk": "0.0443", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 2, "updateDate": 1697450711000, "maturityDate": 1697587200000 }, { "instrumentId": 11849, "tokenId": 3, "code": "USDC-2023-10-18", "name": "USDC-FIXED", "rate": "0.0455", "bestBid": "0.0455", "midRate": "0.04695", "bestAsk": "0.0484", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 2, "updateDate": 1697450709000, "maturityDate": 1697587200000 }, { "instrumentId": 11083, "tokenId": 2, "code": "USDT-2023-10-20", "name": "USDT-FIXED", "rate": "0.0347", "bestBid": "0.0347", "midRate": "0.03575", "bestAsk": "0.0368", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 4, "updateDate": 1697450711000, "maturityDate": 1697760000000 }, { "instrumentId": 11448, "tokenId": 4, "code": "DAI-2023-10-20", "name": "DAI-FIXED", "rate": "0.0344", "bestBid": "0.0344", "midRate": "0.03505", "bestAsk": "0.0357", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 4, "updateDate": 1697450711000, "maturityDate": 1697760000000 }, { "instrumentId": 11813, "tokenId": 5, "code": "WBTC-2023-10-20", "name": "WBTC-FIXED", "rate": "0.0375", "bestBid": "0.0375", "midRate": "0.03855", "bestAsk": "0.0396", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 4, "updateDate": 1697450711000, "maturityDate": 1697760000000 }, { "instrumentId": 11832, "tokenId": 1, "code": "ETH-2023-10-20", "name": "ETH-FIXED", "rate": "0.0476", "bestBid": "0.0476", "midRate": "0.0485", "bestAsk": "0.0494", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 4, "updateDate": 1697450710000, "maturityDate": 1697760000000 }, { "instrumentId": 11851, "tokenId": 3, "code": "USDC-2023-10-20", "name": "USDC-FIXED", "rate": "0.0499", "bestBid": "0.0499", "midRate": "0.05105", "bestAsk": "0.0522", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 4, "updateDate": 1697450709000, "maturityDate": 1697760000000 }, { "instrumentId": 11090, "tokenId": 2, "code": "USDT-2023-10-27", "name": "USDT-FIXED", "rate": "0.0383", "bestBid": "0.0367", "midRate": "0.0375", "bestAsk": "0.0383", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": true, "daysToMaturity": 11, "updateDate": 1697450711000, "maturityDate": 1698364800000 }, { "instrumentId": 11455, "tokenId": 4, "code": "DAI-2023-10-27", "name": "DAI-FIXED", "rate": "0.0369", "bestBid": "0.0369", "midRate": "0.0371", "bestAsk": "0.0373", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 11, "updateDate": 1697450708000, "maturityDate": 1698364800000 }, { "instrumentId": 11820, "tokenId": 5, "code": "WBTC-2023-10-27", "name": "WBTC-FIXED", "rate": "0.0468", "bestBid": "0.0413", "midRate": "0.0426", "bestAsk": "0.0439", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": true, "daysToMaturity": 11, "updateDate": 1697450712000, "maturityDate": 1698364800000 }, { "instrumentId": 11839, "tokenId": 1, "code": "ETH-2023-10-27", "name": "ETH-FIXED", "rate": "0.0486", "bestBid": "0.0486", "midRate": "0.0498", "bestAsk": "0.051", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 11, "updateDate": 1697450711000, "maturityDate": 1698364800000 }, { "instrumentId": 11858, "tokenId": 3, "code": "USDC-2023-10-27", "name": "USDC-FIXED", "rate": "0.0494", "bestBid": "0.0494", "midRate": "0.0509", "bestAsk": "0.0524", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 11, "updateDate": 1697450708000, "maturityDate": 1698364800000 }, { "instrumentId": 11865, "tokenId": 4, "code": "DAI-2023-11-03", "name": "DAI-FIXED", "rate": "0.0402", "bestBid": "0.0402", "midRate": "0.042", "bestAsk": "0.0438", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 18, "updateDate": 1697450711000, "maturityDate": 1698969600000 }, { "instrumentId": 11867, "tokenId": 1, "code": "ETH-2023-11-03", "name": "ETH-FIXED", "rate": "0.0477", "bestBid": "0.0477", "midRate": "0.0506", "bestAsk": "0.0535", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 18, "updateDate": 1697450711000, "maturityDate": 1698969600000 }, { "instrumentId": 11869, "tokenId": 3, "code": "USDC-2023-11-03", "name": "USDC-FIXED", "rate": "0.0549", "bestBid": "0.0549", "midRate": "0.0555", "bestAsk": "0.0561", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 18, "updateDate": 1697450711000, "maturityDate": 1698969600000 }, { "instrumentId": 11871, "tokenId": 2, "code": "USDT-2023-11-03", "name": "USDT-FIXED", "rate": "0.0386", "bestBid": "0.0386", "midRate": "0.0394", "bestAsk": "0.0402", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 18, "updateDate": 1697450709000, "maturityDate": 1698969600000 }, { "instrumentId": 11873, "tokenId": 5, "code": "WBTC-2023-11-03", "name": "WBTC-FIXED", "rate": "0.0433", "bestBid": "0.0433", "midRate": "0.04475", "bestAsk": "0.0462", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 18, "updateDate": 1697450711000, "maturityDate": 1698969600000 }, { "instrumentId": 11970, "tokenId": 4, "code": "DAI-2023-11-24", "name": "DAI-FIXED", "rate": "0.0426", "bestBid": "0.0426", "midRate": "0.04325", "bestAsk": "0.0439", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 39, "updateDate": 1697450712000, "maturityDate": 1700784000000 }, { "instrumentId": 11971, "tokenId": 1, "code": "ETH-2023-11-24", "name": "ETH-FIXED", "rate": "0.0525", "bestBid": "0.0525", "midRate": "0.053", "bestAsk": "0.0535", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 39, "updateDate": 1697450712000, "maturityDate": 1700784000000 }, { "instrumentId": 11972, "tokenId": 3, "code": "USDC-2023-11-24", "name": "USDC-FIXED", "rate": "0.0533", "bestBid": "0.0533", "midRate": "0.05665", "bestAsk": "0.06", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 39, "updateDate": 1697450712000, "maturityDate": 1700784000000 }, { "instrumentId": 11973, "tokenId": 2, "code": "USDT-2023-11-24", "name": "USDT-FIXED", "rate": "0.0426", "bestBid": "0.0426", "midRate": "0.04325", "bestAsk": "0.0439", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 39, "updateDate": 1697450712000, "maturityDate": 1700784000000 }, { "instrumentId": 11974, "tokenId": 5, "code": "WBTC-2023-11-24", "name": "WBTC-FIXED", "rate": "0.0516", "bestBid": "0.0441", "midRate": "0.04785", "bestAsk": "0.0516", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": true, "daysToMaturity": 39, "updateDate": 1697450711000, "maturityDate": 1700784000000 }, { "instrumentId": 12145, "tokenId": 4, "code": "DAI-2023-12-29", "name": "DAI-FIXED", "rate": "0.0426", "bestBid": "0.0435", "midRate": "0.0458", "bestAsk": "0.0481", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 74, "updateDate": 1697450711000, "maturityDate": 1703808000000 }, { "instrumentId": 12146, "tokenId": 1, "code": "ETH-2023-12-29", "name": "ETH-FIXED", "rate": "0.0531", "bestBid": "0.0531", "midRate": "0.0544", "bestAsk": "0.0557", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 74, "updateDate": 1697450711000, "maturityDate": 1703808000000 }, { "instrumentId": 12147, "tokenId": 3, "code": "USDC-2023-12-29", "name": "USDC-FIXED", "rate": "0.0545", "bestBid": "0.0545", "midRate": "0.05575", "bestAsk": "0.057", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 74, "updateDate": 1697450711000, "maturityDate": 1703808000000 }, { "instrumentId": 12148, "tokenId": 2, "code": "USDT-2023-12-29", "name": "USDT-FIXED", "rate": "0.0407", "bestBid": "0.0407", "midRate": "0.0418", "bestAsk": "0.0429", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 74, "updateDate": 1697450709000, "maturityDate": 1703808000000 }, { "instrumentId": 12149, "tokenId": 5, "code": "WBTC-2023-12-29", "name": "WBTC-FIXED", "rate": "0.0469", "bestBid": "0.0469", "midRate": "0.04745", "bestAsk": "0.048", "quantityStep": "0.000001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 74, "updateDate": 1697450712000, "maturityDate": 1703808000000 }, { "instrumentId": 12607, "tokenId": 4, "code": "DAI-2024-03-29", "name": "DAI-FIXED", "rate": "0.0451", "bestBid": "0.0451", "midRate": "0.04625", "bestAsk": "0.0474", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 165, "updateDate": 1697450710000, "maturityDate": 1711670400000 }, { "instrumentId": 12608, "tokenId": 1, "code": "ETH-2024-03-29", "name": "ETH-FIXED", "rate": "0.0545", "bestBid": "0.0545", "midRate": "0.05635", "bestAsk": "0.0582", "quantityStep": "0.00001", "minQuantity": "0.001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 165, "updateDate": 1697450709000, "maturityDate": 1711670400000 }, { "instrumentId": 12609, "tokenId": 3, "code": "USDC-2024-03-29", "name": "USDC-FIXED", "rate": "0.0574", "bestBid": "0.0574", "midRate": "0.05805", "bestAsk": "0.0587", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 165, "updateDate": 1697450711000, "maturityDate": 1711670400000 }, { "instrumentId": 12610, "tokenId": 2, "code": "USDT-2024-03-29", "name": "USDT-FIXED", "rate": "0.0427", "bestBid": "0.0422", "midRate": "0.04245", "bestAsk": "0.0427", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": true, "daysToMaturity": 165, "updateDate": 1697450711000, "maturityDate": 1711670400000 }, { "instrumentId": 12611, "tokenId": 5, "code": "WBTC-2024-03-29", "name": "WBTC-FIXED", "rate": "0.0453", "bestBid": "0.0453", "midRate": "0.0487", "bestAsk": "0.0521", "quantityStep": "0.000001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 165, "updateDate": 1697450712000, "maturityDate": 1711670400000 }, { "instrumentId": 15172, "tokenId": 1, "code": "ETH-2024-06-28", "name": "ETH-FIXED", "rate": "0.0527", "bestBid": "0.0527", "midRate": "0.05445", "bestAsk": "0.0562", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 256, "updateDate": 1697450712000, "maturityDate": 1719532800000 }, { "instrumentId": 15173, "tokenId": 2, "code": "USDT-2024-06-28", "name": "USDT-FIXED", "rate": "0.0452", "bestBid": "0.0452", "midRate": "0.04705", "bestAsk": "0.0489", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 256, "updateDate": 1697450711000, "maturityDate": 1719532800000 }, { "instrumentId": 15174, "tokenId": 3, "code": "USDC-2024-06-28", "name": "USDC-FIXED", "rate": "0.056", "bestBid": "0.056", "midRate": "0.05965", "bestAsk": "0.0633", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 256, "updateDate": 1697450709000, "maturityDate": 1719532800000 }, { "instrumentId": 15175, "tokenId": 4, "code": "DAI-2024-06-28", "name": "DAI-FIXED", "rate": "0.046", "bestBid": "0.046", "midRate": "0.047", "bestAsk": "0.048", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 256, "updateDate": 1697450709000, "maturityDate": 1719532800000 }, { "instrumentId": 15176, "tokenId": 5, "code": "WBTC-2024-06-28", "name": "WBTC-FIXED", "rate": "0.047", "bestBid": "0.047", "midRate": "0.0507", "bestAsk": "0.0544", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 256, "updateDate": 1697450712000, "maturityDate": 1719532800000 }, { "instrumentId": 15632, "tokenId": 1, "code": "ETH-2024-09-27", "name": "ETH-FIXED", "rate": "0.0555", "bestBid": "0.0555", "midRate": "0.0572", "bestAsk": "0.0589", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 347, "updateDate": 1697450710000, "maturityDate": 1727395200000 }, { "instrumentId": 15633, "tokenId": 2, "code": "USDT-2024-09-27", "name": "USDT-FIXED", "rate": "0.0427", "bestBid": "0.0427", "midRate": "0.0439", "bestAsk": "0.0451", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 347, "updateDate": 1697450710000, "maturityDate": 1727395200000 }, { "instrumentId": 15634, "tokenId": 3, "code": "USDC-2024-09-27", "name": "USDC-FIXED", "rate": "0.0557", "bestBid": "0.0557", "midRate": "0.05875", "bestAsk": "0.0618", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 347, "updateDate": 1697450710000, "maturityDate": 1727395200000 }, { "instrumentId": 15635, "tokenId": 4, "code": "DAI-2024-09-27", "name": "DAI-FIXED", "rate": "0.0451", "bestBid": "0.0446", "midRate": "0.04485", "bestAsk": "0.0451", "quantityStep": "0.01", "minQuantity": "1", "maxQuantity": "10000000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": true, "daysToMaturity": 347, "updateDate": 1697450711000, "maturityDate": 1727395200000 }, { "instrumentId": 15636, "tokenId": 5, "code": "WBTC-2024-09-27", "name": "WBTC-FIXED", "rate": "0.0488", "bestBid": "0.0488", "midRate": "0.05035", "bestAsk": "0.0519", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "10000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 347, "updateDate": 1697450706000, "maturityDate": 1727395200000 } ] } }

Get all market details.

Request

Parameter Required Type Description
simple NO boolean Return only essential information

Response Body

Name Type Description
markets object[] List of Market objects
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ quantityStep string Minimum increment between different order quantities
└ minQuantity string Minimum order quantity
└ maxQuantity string Maximum order quantity
└ rateStep string Minimum increment between valid rate levels
└ category integer Category for this market

The value for this category should always be 1.
└ takerFeeRate string Taker fee rate as a percentage of the order quantity
└ makerFeeRate string Maker fee rate as a percentage of the order quantity
└ interestFeeRate string The fee rate when user receive interest
└ enable boolean Whether this market is currently enabled

The value for this field should always be True
└ visible boolean Whether this market is currently enabled

The value for this field should always be True
└ borrowPriceIndex string Value of borrowing relative to that of inception date
└ lendPriceIndex string Value of lending relative to that of inception date
└ priceIndexDate integer The date of inception of price index (index = 1.0)
└ rate string Latest traded market rate for this market
└ updateDate intger Datetime (in UNIX time) when the market orderbook was last updated
└ direction boolean The direction of last trade

false: active lend
true: active borrow
└ actualRate string The latest rate used to calculate the price index
└ name string Floating market name

In format: token code + " SPOT"
└ deposits integer Lending order book depth
└ borrows integer Borrowing order book depth
└ subscriptions string Current outstanding borrows

GET /public/get_all_order_buckets

Code sample:

Copy to Clipboard
GET /public/get_all_order_buckets?instrumentIds=ETH-SPOT,BTC-SPOT,BTC-2023-11-24

Example response:

Copy to Clipboard
{ "success": true, "data": { "rateBuckets": { "1": [ { "instrumentId": 1, "rate": "0.0237", "quantity": "186.9172", "side": true }, { "instrumentId": 1, "rate": "0.0236", "quantity": "130.1166", "side": true }, { "instrumentId": 1, "rate": "0.0235", "quantity": "139.326", "side": true } { "instrumentId": 1, "rate": "0.0262", "quantity": "130.1166", "side": false }, { "instrumentId": 1, "rate": "0.024", "quantity": "130.1168", "side": false }, { "instrumentId": 1, "rate": "0.0239", "quantity": "130.1167", "side": false }, { "instrumentId": 1, "rate": "0.0238", "quantity": "73.3152", "side": false } ], "15172": [ { "instrumentId": 15172, "rate": "0.0526", "quantity": "4.6974", "side": true }, { "instrumentId": 15172, "rate": "0.0525", "quantity": "5.1741", "side": true }, { "instrumentId": 15172, "rate": "0.0521", "quantity": "4.78", "side": true }, { "instrumentId": 15172, "rate": "0.0566", "quantity": "4.7876", "side": false }, { "instrumentId": 15172, "rate": "0.0565", "quantity": "7.5503", "side": false }, { "instrumentId": 15172, "rate": "0.0563", "quantity": "2.4465", "side": false } ] } } }

Get orders (floating and fixed) in rate buckets for a given token ID and list of fixed rate instrument IDs.

Request

Parameter Required Type Description
instrumentIds YES string[] List of instrument IDs

Response Body

Name Type Description
rateBuckets object[] List of trade objects
└ trxId integer Unique ID for the trade, assigned by Infinity Exchange
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ side boolean Original order side - Borrow (true) or lend (false)
└ rate string Rate executed
└ quantity string Transaction quantity
└ borrowOrderId integer Unique order ID, assigned by Infinity Exchange
└ lendOrderId integer Unique order ID, assigned by Infinity Exchange
└ date integer Datetime (in UNIX time) executed

GET /public/get_bba

Code sample:

Copy to Clipboard
GET /public/get_bba?tokenId=1

Example response:

Copy to Clipboard
{ "success": true, "data": { "ir": { "instrumentId": 1, "bid": "0.0238", "bidQuantity": "74.4692", "bidStepSize": "0", "ask": "0.0263", "askQuantity": "130.1169", "askStepSize": "0" }, "fr": [ { "instrumentId": 11829, "name": "ETH-1D", "daysToMaturity": 1, "marketRate": "0.03585", "bid": "0.0351", "bidQuantity": "0.3358", "bidStepSize": "0", "ask": "0.0403", "askQuantity": "5.1909", "askStepSize": "0" }, { "instrumentId": 11830, "name": "ETH-2D", "daysToMaturity": 2, "marketRate": "0.0433", "bid": "0.0424", "bidQuantity": "4.0386", "bidStepSize": "0", "ask": "0.0465", "askQuantity": "1.9026", "askStepSize": "0" }, { "instrumentId": 11832, "name": "ETH-1W", "daysToMaturity": 4, "marketRate": "0.047", "bid": "0.0465", "bidQuantity": "1.7086", "bidStepSize": "0", "ask": "0.0507", "askQuantity": "6.0497", "askStepSize": "0" }, { "instrumentId": 11839, "name": "ETH-2W", "daysToMaturity": 11, "marketRate": "0.04945", "bid": "0.0471", "bidQuantity": "2.0219", "bidStepSize": "0", "ask": "0.0538", "askQuantity": "4.4904", "askStepSize": "0" }, { "instrumentId": 11867, "name": "ETH-3W", "daysToMaturity": 18, "marketRate": "0.0489", "bid": "0.0477", "bidQuantity": "0.768", "bidStepSize": "0", "ask": "0.0554", "askQuantity": "2.008", "askStepSize": "0" }, { "instrumentId": 11839, "name": "ETH-1M", "daysToMaturity": 11, "marketRate": "0.04945", "bid": "0.0471", "bidQuantity": "2.0219", "bidStepSize": "0", "ask": "0.0538", "askQuantity": "4.4904", "askStepSize": "0" }, { "instrumentId": 11971, "name": "ETH-2M", "daysToMaturity": 39, "marketRate": "0.05395", "bid": "0.0536", "bidQuantity": "4.7034", "bidStepSize": "0", "ask": "0.0559", "askQuantity": "4.2084", "askStepSize": "0" }, { "instrumentId": 12146, "name": "ETH-3M", "daysToMaturity": 74, "marketRate": "0.0544", "bid": "0.0527", "bidQuantity": "2.4736", "bidStepSize": "0", "ask": "0.0597", "askQuantity": "10.4417", "askStepSize": "0" }, { "instrumentId": 12146, "name": "ETH-1Q", "daysToMaturity": 74, "marketRate": "0.0544", "bid": "0.0527", "bidQuantity": "2.4736", "bidStepSize": "0", "ask": "0.0597", "askQuantity": "10.4417", "askStepSize": "0" }, { "instrumentId": 12608, "name": "ETH-2Q", "daysToMaturity": 165, "marketRate": "0.05485", "bid": "0.0548", "bidQuantity": "0.73705", "bidStepSize": "0", "ask": "0.0592", "askQuantity": "3.0738", "askStepSize": "0" }, { "instrumentId": 15172, "name": "ETH-3Q", "daysToMaturity": 256, "marketRate": "0.0544", "bid": "0.0526", "bidQuantity": "0.2108", "bidStepSize": "0", "ask": "0.0581", "askQuantity": "3.6912", "askStepSize": "0" }, { "instrumentId": 15632, "name": "ETH-4Q", "daysToMaturity": 347, "marketRate": "0.05545", "bid": "0.054", "bidQuantity": "2.6477", "bidStepSize": "0", "ask": "0.0592", "askQuantity": "4.3362", "askStepSize": "0" } ] } }

Get current best bid & ask (floating and/or fixed) rate details for a given token ID (and list of fixed rate instrument IDs).

Request

Parameter Required Type Default value Description
tokenId YES integer Token ID
fixedRateInstrumentIds NO string[] List of fixed rate instrument IDs
minBidNAskSize NO number 0 Minimum bid & ask quantity

Response Body

Name Type Description
ir object Floating rate object
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ bid string Best borrow rate currently being bid on Infinity Exchange for this market
└ bidQuantity string Total quantity available at the best borrow rate currently being bid on Infinity Exchange for this market
└ bidStepSize string Minimum increment between different bid rate levels
└ ask string Best lending rate currently being offered on Infinity Exchange for this market
└ askQuantity string Total quantity available at the best lending rate currently being offered on Infinity Exchange for this market
└ askStepSize string Minimum increment between different offer rate levels
fr object[] List of fixed rate objects
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ name string Fixed market name
└ daysToMaturity integer Number of days to expiry
└ marketRate string The last traded rate of this market
└ bid string Best borrow rate currently being bid on Infinity Exchange for this market
└ bidQuantity string Total quantity available at the best borrow rate currently being bid on Infinity Exchange for this market
└ bidStepSize string Minimum increment between different bid rate levels
└ ask string Best lending rate currently being offered on Infinity Exchange for this market
└ askQuantity string Total quantity available at the best lending rate currently being offered on Infinity Exchange for this market
└ askStepSize string Minimum increment between different offer rate levels

GET /public/get_fixed_details

Code sample:

Copy to Clipboard
GET /public/get_fixed_details?instrumentId=ETH-2023-11-24

Example response:

Copy to Clipboard
{ "success": true, "data": { "market": { "instrumentId": 15172, "tokenId": 1, "code": "ETH-2024-06-28", "name": "ETH-FIXED", "rate": "0.043", "bestBid": "0.043", "midRate": "0.04425", "bestAsk": "0.0455", "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "enable": true, "creating": false, "expiring": false, "visible": true, "direction": false, "daysToMaturity": 256, "updateDate": 1697514115000, "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "maturityDate": 1719558000000 } } }

Get fixed rate market details for a given fixed rate instrument ID.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID

Response Body

Name Type Description
market object Market object
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ name string Market type

In format: token code + "-FIXED"
└ rate string Latest traded market rate for this market
└ bestBid string Best borrow rate currently being bid on Infinity Exchange for this market
└ midRate string Mid value between the current best bid rate and best ask rate
└ bestAsk string Best lending rate currently being offered on Infinity Exchange for this market
└ quantityStep string Minimum increment between different order quantities
└ minQuantity string Minimum order quantity
└ maxQuantity string Maximum order quantity
└ rateStep string Minimum increment between valid rate levels
└ enable boolean Whether this market is currently enabled

The value for this field should always be True
└ direction boolean The direction of last trade

false: active lend
true: active borrow
└ daysToMaturity integer Number of days to expiry
└ updateDate intger Datetime (in UNIX time) when the market orderbook was last updated
└ maturityDate integer Maturity datetime (in UNIX time)

GET /public/get_fixed_fees

Code sample:

Copy to Clipboard
GET /public/get_fixed_fees?instrumentId=ETH-2023-11-24&orderQty=1

Example response:

Copy to Clipboard
{ "success": true, "data": { "estimatedTrxFee": "0.0001" } }

Get fixed rate transaction fee estimates for a given instrument ID.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID
orderQty YES number Order Quantity

Response Body

Name Type Description
estimatedTrxFee string Estimated transaction fee as fraction of transaction amount

GET /public/get_fixed_history

Code sample:

Copy to Clipboard
GET /public/get_fixed_history?instrumentId=ETH-2023-11-24&start=20230131&end=20230831&interval=86400000

Example response:

Copy to Clipboard
{ "date": 20221022, "open": "0", "close": "0", "high": "0", "low": "0", "volume": "0", "totalValue": "309278.7355", "lendDepth": 344, "borrowDepth": 214 }

Get fixed rate market history.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID
start YES string Start date
end YES string End date
interval YES string Time interval (in milliseconds)

Response Body

Name Type Description
date string Historical date
open string First mid rate of the day
close string Last mid rate of the day
high string Highest mid rate during the day
low string Lowest mid rate during the day
volume string Total quantity of borrow/lend orders executed during the day
totalValue string Total value in USD (quantity times rate level) of borrow/lend orders executed during the day

GET /public/get_fixed_orderbook

Code sample:

Copy to Clipboard
GET /public/get_fixed_orderbook?instrumentId=ETH-2023-11-24

Example response:

Copy to Clipboard
{ "success": true, "data": { "bids": [ { "rate": "0.0238", "quantity": "138.0319", }, { "rate": "0.0237", "quantity": "130.1166", }, { "rate": "0.0236", "quantity": "130.1166", }, { "rate": "0.0235", "quantity": "132.9572", }, { "rate": "0.0234", "quantity": "130.1167", }, { "rate": "0.0233", "quantity": "130.1169", }, { "rate": "0.0232", "quantity": "137.5218", }, { "rate": "0.0231", "quantity": "132.6903", }, { "rate": "0.023", "quantity": "138.4648", }, { "rate": "0.0229", "quantity": "133.4601", } ], "asks": [ { "rate": "0.0263", "quantity": "130.1169", }, { "rate": "0.0262", "quantity": "130.1166", }, { "rate": "0.0261", "quantity": "130.1169", }, { "rate": "0.026", "quantity": "130.1165", }, { "rate": "0.0259", "quantity": "130.1166", }, { "rate": "0.0258", "quantity": "130.1171", }, { "rate": "0.0257", "quantity": "130.1167", }, { "rate": "0.0256", "quantity": "130.1169", }, { "rate": "0.0255", "quantity": "130.1165", }, { "rate": "0.0254", "quantity": "130.1166", } ] } }

Get fixed rate order book details for a given fixed rate instrument ID.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID
limit NO integer Maximum Number Of Orders To Return

Response Body

Name Type Description
bids object[] List of order book levels on the bid side
└ rate string Rate level in the order book
└ quantity string Total size of limit orders at this order book rate level
asks object[] List of order book levels on the ask side
└ rate string Rate level in the order book
└ quantity string Total size of limit orders at this order book rate level

GET /public/get_fixed_rate

Code sample:

Copy to Clipboard
GET /public/get_fixed_rate?instrumentId=ETH-2023-11-24

Example response:

Copy to Clipboard
{ "success": true, "data": { "marketInfo": { "instrumentId": 15172, "rate": "0.045", "midRate": "0.0489", "direction": false, "updateDate": 1697986145161 } } }

Get latest fixed rate market information for a given instrument ID.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID

Response Body

Name Type Description
marketInfo object Market Info object
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ rate string Latest traded market rate for this market
└ direction boolean The direction of last trade

false: active lend
true: active borrow
└ borrowPriceIndex string Value of borrowing relative to that of inception date
└ lendPriceIndex string Value of lending relative to that of inception date
└ priceIndexDate integer The date of inception of price index (index = 1.0)
└ updateDate intger Datetime (in UNIX time) when the market orderbook was last updated

GET /public/get_fixed_trades

Code sample:

Copy to Clipboard
GET /public/get_fixed_trades?instrumentId=ETH-2023-11-24

Example response:

Copy to Clipboard
{ "trxs": [ { "side": false, "rate": "0.0501", "quantity": "3.697", "date": 1689833397180 }, { "side": false, "rate": "0.0493", "quantity": "3.9288", "date": 1689833043675 }, { "side": true, "rate": "0.0487", "quantity": "2.651", "date": 1689832827936 }, { "side": false, "rate": "0.0478", "quantity": "3.8613", "date": 1689832426057 }, { "side": false, "rate": "0.0339", "quantity": "3.0605", "date": 1689799385952 } ] }

Get recent fixed rate transaction details for a given fixed rate instrument ID.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID
limit NO integer Maximum number of transactions to return

Response Body

Name Type Description
trxs object[] List of trades

GET /public/get_floating_details

Code sample:

Copy to Clipboard
GET /public/get_floating_details?instrumentId=ETH-SPOT

Example response:

Copy to Clipboard
{ "success": true, "data": { "market": { "instrumentId": 1, "tokenId": 1, "quantityStep": "0.0001", "minQuantity": "0.0001", "maxQuantity": "100000", "rateStep": "0.0001", "category": 1, "takerFeeRate": "0.0001", "makerFeeRate": "0.001", "interestFeeRate": "0.0513", "enable": true, "visible": true, "borrowPriceIndex": "1.0412914504412", "lendPriceIndex": "1.0410199660928", "priceIndexDate": 1697451060000, "rate": "0.0239", "updateDate": 1697451087000, "direction": true, "actualRate": "0.0239", "name": "ETH SPOT", "code": "ETH-SPOT", "high24": "0", "low24": "0", "volume24": "0", "rate24": "0", "totalValue": "0", "bestRatesUpdated": false } } }

Get floating rate market details for a given instrument ID.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID

Response Body

Name Type Description
market object Market object
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ quantityStep string Minimum increment between different order quantities
└ minQuantity string Minimum order quantity
└ maxQuantity string Maximum order quantity
└ rateStep string Minimum increment between valid rate levels
└ category integer Category for this market

The value for this category should always be 1.
└ takerFeeRate string Taker fee rate as a percentage of the order quantity
└ makerFeeRate string Maker fee rate as a percentage of the order quantity
└ interestFeeRate string The fee rate when user receive interest
└ enable boolean Whether this market is currently enabled

The value for this field should always be True
└ visible boolean Whether this market is currently enabled

The value for this field should always be True
└ borrowPriceIndex string Value of borrowing relative to that of inception date
└ lendPriceIndex string Value of lending relative to that of inception date
└ priceIndexDate integer The date of inception of price index (index = 1.0)
└ rate string Latest traded market rate for this market
└ updateDate intger Datetime (in UNIX time) when the market orderbook was last updated
└ direction boolean The direction of last trade

false: active lend
true: active borrow
└ actualRate string The latest rate used to calculate the price index
└ name string Floating market name

In format: token code + " SPOT"

GET /public/get_floating_history

Code sample:

Copy to Clipboard
GET /public/get_floating_history?instrumentId=ETH-SPOT&start=20230131&end=20230831&interval=86400000

Example response:

Copy to Clipboard
{ "date": 20221022, "open": "0", "close": "0", "high": "0", "low": "0", "volume": "0", "totalValue": "85814.42378", "lendDepth": 4333, "borrowDepth": 375 }

Get floating rate market history.

Request

Parameter Required Type Description
instruemtnId YES string Instrument ID
start YES string Start DateTime
end YES string End DateTime
interval YES string Time Interval (in milliseconds)

Response Body

Name Type Description
date string Historical date
open string First mid rate of the day
close string Last mid rate of the day
high string Highest mid rate during the day
low string Lowest mid rate during the day
volume string Total quantity of borrow/lend orders executed during the day
totalValue string Total value in USD (quantity times rate level) of borrow/lend orders executed during the day
lendDepth integer Total quantity of lend limit orders in market
borrowDepth integer Total quantity of borrow limit orders in market

GET /public/get_floating_orderbook

Code sample:

Copy to Clipboard
GET /public/get_floating_orderbook?instrumentId=ETH-SPOT

Example response:

Copy to Clipboard
{ "success": true, "data": { "bids": [ { "rate": "0.0239", "quantity": "66.6335", }, { "rate": "0.0238", "quantity": "133.0304", }, { "rate": "0.0237", "quantity": "133.5965", }, { "rate": "0.0236", "quantity": "130.1166", }, { "rate": "0.0235", "quantity": "130.1168", }, { "rate": "0.0234", "quantity": "130.1167", }, { "rate": "0.0233", "quantity": "131.8568", }, { "rate": "0.0232", "quantity": "133.6964", }, { "rate": "0.0231", "quantity": "132.6903", }, { "rate": "0.023", "quantity": "143.5676", } ], "asks": [ { "rate": "0.0264", "quantity": "130.1166", }, { "rate": "0.0263", "quantity": "130.1169", }, { "rate": "0.0262", "quantity": "130.1166", }, { "rate": "0.0261", "quantity": "130.1169", }, { "rate": "0.026", "quantity": "130.1165", }, { "rate": "0.0259", "quantity": "130.1166", }, { "rate": "0.0258", "quantity": "130.1171", }, { "rate": "0.0257", "quantity": "130.1167", }, { "rate": "0.0256", "quantity": "130.1169", }, { "rate": "0.0255", "quantity": "130.1165", } ] } }

Get current floating rate order book details for a given instrument ID.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID
limit NO integer Maximum Number of Orders To Return

Response Body

Name Type Description
bids object[] List of order book levels on the bid side
└ rate string Rate level in the order book
└ quantity string Total size of limit orders at this order book rate level
asks object[] List of order book levels on the ask side
└ rate string Rate level in the order book
└ quantity string Total size of limit orders at this order book rate level

GET /public/get_floating_rate

Code sample:

Copy to Clipboard
GET /public/get_floating_rate?instrumentId=ETH-SPOT

Example response:

Copy to Clipboard
{ "success": true, "data": { "marketInfo": { "instrumentId": 1, "rate": "0.0239", "direction": false, "borrowPriceIndex": "1.0412915913992", "lendPriceIndex": "1.0410201058532", "priceIndexDate": 1697451240000, "updateDate": 1697451241033 } } }

Get latest market info for a given instrument ID.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID

Response Body

Name Type Description
marketInfo object Market Info object
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ rate string Latest traded market rate for this market
└ direction boolean The direction of last trade

false: active lend
true: active borrow
└ borrowPriceIndex string Value of borrowing relative to that of inception date
└ lendPriceIndex string Value of lending relative to that of inception date
└ priceIndexDate integer The date of inception of price index (index = 1.0)
└ updateDate intger Datetime (in UNIX time) when the market orderbook was last updated

GET /public/get_floating_trades

Code sample:

Copy to Clipboard
GET /public/get_floating_trades?instrumentId=ETH-SPOT

Example response:

Copy to Clipboard
{ "success": true, "data": { "trxs": [] } }

Get recent floating rate transaction details for a given instrument ID.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID
limit NO integer Maximum Number of Transactions To Return

Response Body

Name Type Description
trxs object[] List of trades

GET /public/get_historical_mid

Code sample:

Copy to Clipboard
GET /public/get_historical_mid?tokenId=1&daysToInclude=2

Example response:

Copy to Clipboard
{ "success": true, "data": { "1": [ { "instrumentId": 1, "tokenId": 1, "rate": "0.0239", "midRate": "0.0239", "volume24": "47584", "rate24": "0.0241", "midRate24": "0.0241", "rateDelta24": "-0.0002", "midRateDelta24": "-0.0002" }, { "instrumentId": 11829, "tokenId": 1, "daysToMaturity": 1, "rate": "0.0369", "midRate": "0.03605", "volume24": "22417", "rate24": "0.0414", "midRate24": "0.0414", "rateDelta24": "-0.0045", "midRateDelta24": "-0.00535", "maturityDate": 1697526000000 }, { "instrumentId": 11830, "tokenId": 1, "daysToMaturity": 2, "rate": "0.0436", "midRate": "0.04235", "volume24": "2958", "rate24": "0", "midRate24": "0", "rateDelta24": "0.0436", "midRateDelta24": "0.04235", "maturityDate": 1697612400000 }, { "instrumentId": 11832, "tokenId": 1, "daysToMaturity": 4, "rate": "0.0447", "midRate": "0.0459", "volume24": "22488", "rate24": "0.04565", "midRate24": "0.04475", "rateDelta24": "-0.00095", "midRateDelta24": "0.00115", "maturityDate": 1697785200000 }, { "instrumentId": 11839, "tokenId": 1, "daysToMaturity": 11, "rate": "0.0506", "midRate": "0.04885", "volume24": "22496", "rate24": "0.0487", "midRate24": "0.0473", "rateDelta24": "0.0019", "midRateDelta24": "0.00155", "maturityDate": 1698390000000 }, { "instrumentId": 11867, "tokenId": 1, "daysToMaturity": 18, "rate": "0.0477", "midRate": "0.04955", "volume24": "22421", "rate24": "0.0514", "midRate24": "0.05145", "rateDelta24": "-0.0037", "midRateDelta24": "-0.0019", "maturityDate": 1698994800000 }, { "instrumentId": 11839, "tokenId": 1, "daysToMaturity": 11, "rate": "0.0506", "midRate": "0.04885", "volume24": "22496", "rate24": "0.0487", "midRate24": "0.0473", "rateDelta24": "0.0019", "midRateDelta24": "0.00155", "maturityDate": 1698390000000 }, { "instrumentId": 11971, "tokenId": 1, "daysToMaturity": 39, "rate": "0.056", "midRate": "0.0542", "volume24": "22553", "rate24": "0.05295", "midRate24": "0.0529", "rateDelta24": "0.00305", "midRateDelta24": "0.0013", "maturityDate": 1700809200000 }, { "instrumentId": 12146, "tokenId": 1, "daysToMaturity": 74, "rate": "0.0573", "midRate": "0.054", "volume24": "22371", "rate24": "0.0526", "midRate24": "0.0526", "rateDelta24": "0.0047", "midRateDelta24": "0.0014", "maturityDate": 1703833200000 }, { "instrumentId": 12146, "tokenId": 1, "daysToMaturity": 74, "rate": "0.0573", "midRate": "0.054", "volume24": "22371", "rate24": "0.0526", "midRate24": "0.0526", "rateDelta24": "0.0047", "midRateDelta24": "0.0014", "maturityDate": 1703833200000 }, { "instrumentId": 12608, "tokenId": 1, "daysToMaturity": 165, "rate": "0.0526", "midRate": "0.05435", "volume24": "22524", "rate24": "0.05335", "midRate24": "0.05345", "rateDelta24": "-0.00075", "midRateDelta24": "0.0009", "maturityDate": 1711695600000 }, { "instrumentId": 15172, "tokenId": 1, "daysToMaturity": 256, "rate": "0.0577", "midRate": "0.05695", "volume24": "22519", "rate24": "0.05585", "midRate24": "0.05665", "rateDelta24": "0.00185", "midRateDelta24": "0.0003", "maturityDate": 1719558000000 }, { "instrumentId": 15632, "tokenId": 1, "daysToMaturity": 347, "rate": "0.0544", "midRate": "0.05615", "volume24": "22557", "rate24": "0.0545", "midRate24": "0.05345", "rateDelta24": "-0.0001", "midRateDelta24": "0.0027", "maturityDate": 1727420400000 } ], "3": [ { "instrumentId": 2, "tokenId": 3, "rate": "0.0307", "midRate": "0.0307", "volume24": "35319695", "rate24": "0.03105", "midRate24": "0.03105", "rateDelta24": "-0.00035", "midRateDelta24": "-0.00035" }, { "instrumentId": 11848, "tokenId": 3, "daysToMaturity": 1, "rate": "0.0399", "midRate": "0.04065", "volume24": "35166851", "rate24": "0.04605", "midRate24": "0.0448", "rateDelta24": "-0.00615", "midRateDelta24": "-0.00415", "maturityDate": 1697526000000 }, { "instrumentId": 11849, "tokenId": 3, "daysToMaturity": 2, "rate": "0.0463", "midRate": "0.0455", "volume24": "4758500", "rate24": "0", "midRate24": "0", "rateDelta24": "0.0463", "midRateDelta24": "0.0455", "maturityDate": 1697612400000 }, { "instrumentId": 11851, "tokenId": 3, "daysToMaturity": 4, "rate": "0.0488", "midRate": "0.04965", "volume24": "35325987", "rate24": "0.05035", "midRate24": "0.04895", "rateDelta24": "-0.00155", "midRateDelta24": "0.0007", "maturityDate": 1697785200000 }, { "instrumentId": 11858, "tokenId": 3, "daysToMaturity": 11, "rate": "0.0508", "midRate": "0.05215", "volume24": "35463929", "rate24": "0.05255", "midRate24": "0.0516", "rateDelta24": "-0.00175", "midRateDelta24": "0.00055", "maturityDate": 1698390000000 }, { "instrumentId": 11869, "tokenId": 3, "daysToMaturity": 18, "rate": "0.0542", "midRate": "0.0553", "volume24": "35382104", "rate24": "0.05585", "midRate24": "0.05215", "rateDelta24": "-0.00165", "midRateDelta24": "0.00315", "maturityDate": 1698994800000 }, { "instrumentId": 11858, "tokenId": 3, "daysToMaturity": 11, "rate": "0.0508", "midRate": "0.05215", "volume24": "35463929", "rate24": "0.05255", "midRate24": "0.0516", "rateDelta24": "-0.00175", "midRateDelta24": "0.00055", "maturityDate": 1698390000000 }, { "instrumentId": 11972, "tokenId": 3, "daysToMaturity": 39, "rate": "0.0548", "midRate": "0.05355", "volume24": "35053223", "rate24": "0.0544", "midRate24": "0.05415", "rateDelta24": "0.0004", "midRateDelta24": "-0.0006", "maturityDate": 1700809200000 }, { "instrumentId": 12147, "tokenId": 3, "daysToMaturity": 74, "rate": "0.052", "midRate": "0.0546", "volume24": "34859253", "rate24": "0.05535", "midRate24": "0.05645", "rateDelta24": "-0.00335", "midRateDelta24": "-0.00185", "maturityDate": 1703833200000 }, { "instrumentId": 12147, "tokenId": 3, "daysToMaturity": 74, "rate": "0.052", "midRate": "0.0546", "volume24": "34859253", "rate24": "0.05535", "midRate24": "0.05645", "rateDelta24": "-0.00335", "midRateDelta24": "-0.00185", "maturityDate": 1703833200000 }, { "instrumentId": 12609, "tokenId": 3, "daysToMaturity": 165, "rate": "0.0576", "midRate": "0.0595", "volume24": "35020292", "rate24": "0.05905", "midRate24": "0.057", "rateDelta24": "-0.00145", "midRateDelta24": "0.0025", "maturityDate": 1711695600000 }, { "instrumentId": 15174, "tokenId": 3, "daysToMaturity": 256, "rate": "0.0563", "midRate": "0.05505", "volume24": "34909307", "rate24": "0.0564", "midRate24": "0.05745", "rateDelta24": "-0.0001", "midRateDelta24": "-0.0024", "maturityDate": 1719558000000 }, { "instrumentId": 15634, "tokenId": 3, "daysToMaturity": 347, "rate": "0.0578", "midRate": "0.0563", "volume24": "34848926", "rate24": "0.057", "midRate24": "0.0568", "rateDelta24": "0.0008", "midRateDelta24": "-0.0005", "maturityDate": 1727420400000 } ], "2": [ { "instrumentId": 5, "tokenId": 2, "rate": "0.0178", "midRate": "0.0178", "volume24": "36135699", "rate24": "0.01815", "midRate24": "0.01815", "rateDelta24": "-0.00035", "midRateDelta24": "-0.00035" }, { "instrumentId": 11080, "tokenId": 2, "daysToMaturity": 1, "rate": "0.0261", "midRate": "0.0265", "volume24": "35293217", "rate24": "0.03095", "midRate24": "0.03095", "rateDelta24": "-0.00485", "midRateDelta24": "-0.00445", "maturityDate": 1697526000000 }, { "instrumentId": 11081, "tokenId": 2, "daysToMaturity": 2, "rate": "0.0308", "midRate": "0.03175", "volume24": "4727471", "rate24": "0", "midRate24": "0", "rateDelta24": "0.0308", "midRateDelta24": "0.03175", "maturityDate": 1697612400000 }, { "instrumentId": 11083, "tokenId": 2, "daysToMaturity": 4, "rate": "0.0337", "midRate": "0.0342", "volume24": "34947359", "rate24": "0.0351", "midRate24": "0.0351", "rateDelta24": "-0.0014", "midRateDelta24": "-0.0009", "maturityDate": 1697785200000 }, { "instrumentId": 11090, "tokenId": 2, "daysToMaturity": 11, "rate": "0.0403", "midRate": "0.0391", "volume24": "35069993", "rate24": "0.03935", "midRate24": "0.0386", "rateDelta24": "0.00095", "midRateDelta24": "0.0005", "maturityDate": 1698390000000 }, { "instrumentId": 11871, "tokenId": 2, "daysToMaturity": 18, "rate": "0.0402", "midRate": "0.0387", "volume24": "34959883", "rate24": "0.04035", "midRate24": "0.04125", "rateDelta24": "-0.00015", "midRateDelta24": "-0.00255", "maturityDate": 1698994800000 }, { "instrumentId": 11090, "tokenId": 2, "daysToMaturity": 11, "rate": "0.0403", "midRate": "0.0391", "volume24": "35069993", "rate24": "0.03935", "midRate24": "0.0386", "rateDelta24": "0.00095", "midRateDelta24": "0.0005", "maturityDate": 1698390000000 }, { "instrumentId": 11973, "tokenId": 2, "daysToMaturity": 39, "rate": "0.0429", "midRate": "0.0441", "volume24": "35187942", "rate24": "0.0433", "midRate24": "0.04155", "rateDelta24": "-0.0004", "midRateDelta24": "0.00255", "maturityDate": 1700809200000 }, { "instrumentId": 12148, "tokenId": 2, "daysToMaturity": 74, "rate": "0.04", "midRate": "0.042", "volume24": "35145692", "rate24": "0.042", "midRate24": "0.0434", "rateDelta24": "-0.002", "midRateDelta24": "-0.0014", "maturityDate": 1703833200000 }, { "instrumentId": 12148, "tokenId": 2, "daysToMaturity": 74, "rate": "0.04", "midRate": "0.042", "volume24": "35145692", "rate24": "0.042", "midRate24": "0.0434", "rateDelta24": "-0.002", "midRateDelta24": "-0.0014", "maturityDate": 1703833200000 }, { "instrumentId": 12610, "tokenId": 2, "daysToMaturity": 165, "rate": "0.0404", "midRate": "0.0418", "volume24": "35184712", "rate24": "0.0425", "midRate24": "0.04375", "rateDelta24": "-0.0021", "midRateDelta24": "-0.00195", "maturityDate": 1711695600000 }, { "instrumentId": 15173, "tokenId": 2, "daysToMaturity": 256, "rate": "0.0455", "midRate": "0.0447", "volume24": "35323627", "rate24": "0.04365", "midRate24": "0.04155", "rateDelta24": "0.00185", "midRateDelta24": "0.00315", "maturityDate": 1719558000000 }, { "instrumentId": 15633, "tokenId": 2, "daysToMaturity": 347, "rate": "0.0481", "midRate": "0.04575", "volume24": "35070694", "rate24": "0.04585", "midRate24": "0.04555", "rateDelta24": "0.00225", "midRateDelta24": "0.0002", "maturityDate": 1727420400000 } ], "4": [ { "instrumentId": 7, "tokenId": 4, "rate": "0.0192", "midRate": "0.0192", "volume24": "35465281", "rate24": "0.0187", "midRate24": "0.0187", "rateDelta24": "0.0005", "midRateDelta24": "0.0005" }, { "instrumentId": 11445, "tokenId": 4, "daysToMaturity": 1, "rate": "0.0261", "midRate": "0.0267", "volume24": "35208851", "rate24": "0.03475", "midRate24": "0.03335", "rateDelta24": "-0.00865", "midRateDelta24": "-0.00665", "maturityDate": 1697526000000 }, { "instrumentId": 11446, "tokenId": 4, "daysToMaturity": 2, "rate": "0.0364", "midRate": "0.0351", "volume24": "4668200", "rate24": "0", "midRate24": "0", "rateDelta24": "0.0364", "midRateDelta24": "0.0351", "maturityDate": 1697612400000 }, { "instrumentId": 11448, "tokenId": 4, "daysToMaturity": 4, "rate": "0.0338", "midRate": "0.03525", "volume24": "35184484", "rate24": "0.0359", "midRate24": "0.0367", "rateDelta24": "-0.0021", "midRateDelta24": "-0.00145", "maturityDate": 1697785200000 }, { "instrumentId": 11455, "tokenId": 4, "daysToMaturity": 11, "rate": "0.0389", "midRate": "0.0377", "volume24": "35102477", "rate24": "0.0386", "midRate24": "0.04045", "rateDelta24": "0.0003", "midRateDelta24": "-0.00275", "maturityDate": 1698390000000 }, { "instrumentId": 11865, "tokenId": 4, "daysToMaturity": 18, "rate": "0.0387", "midRate": "0.0393", "volume24": "35359987", "rate24": "0.0404", "midRate24": "0.0419", "rateDelta24": "-0.0017", "midRateDelta24": "-0.0026", "maturityDate": 1698994800000 }, { "instrumentId": 11455, "tokenId": 4, "daysToMaturity": 11, "rate": "0.0389", "midRate": "0.0377", "volume24": "35102477", "rate24": "0.0386", "midRate24": "0.04045", "rateDelta24": "0.0003", "midRateDelta24": "-0.00275", "maturityDate": 1698390000000 }, { "instrumentId": 11970, "tokenId": 4, "daysToMaturity": 39, "rate": "0.0428", "midRate": "0.0416", "volume24": "35075508", "rate24": "0.0417", "midRate24": "0.043", "rateDelta24": "0.0011", "midRateDelta24": "-0.0014", "maturityDate": 1700809200000 }, { "instrumentId": 12145, "tokenId": 4, "daysToMaturity": 74, "rate": "0.0442", "midRate": "0.0449", "volume24": "35081982", "rate24": "0.0446", "midRate24": "0.04395", "rateDelta24": "-0.0004", "midRateDelta24": "0.00095", "maturityDate": 1703833200000 }, { "instrumentId": 12145, "tokenId": 4, "daysToMaturity": 74, "rate": "0.0442", "midRate": "0.0449", "volume24": "35081982", "rate24": "0.0446", "midRate24": "0.04395", "rateDelta24": "-0.0004", "midRateDelta24": "0.00095", "maturityDate": 1703833200000 }, { "instrumentId": 12607, "tokenId": 4, "daysToMaturity": 165, "rate": "0.0465", "midRate": "0.0449", "volume24": "35097506", "rate24": "0.04315", "midRate24": "0.0426", "rateDelta24": "0.00335", "midRateDelta24": "0.0023", "maturityDate": 1711695600000 }, { "instrumentId": 15175, "tokenId": 4, "daysToMaturity": 256, "rate": "0.0431", "midRate": "0.04645", "volume24": "35039359", "rate24": "0.0464", "midRate24": "0.04545", "rateDelta24": "-0.0033", "midRateDelta24": "0.001", "maturityDate": 1719558000000 }, { "instrumentId": 15635, "tokenId": 4, "daysToMaturity": 347, "rate": "0.0473", "midRate": "0.0456", "volume24": "35257960", "rate24": "0.0464", "midRate24": "0.0474", "rateDelta24": "0.0009", "midRateDelta24": "-0.0018", "maturityDate": 1727420400000 } ], "5": [ { "instrumentId": 8, "tokenId": 5, "rate": "0.0298", "midRate": "0.0298", "volume24": "2785", "rate24": "0.02975", "midRate24": "0.02975", "rateDelta24": "0.00005", "midRateDelta24": "0.00005" }, { "instrumentId": 11810, "tokenId": 5, "daysToMaturity": 1, "rate": "0.028", "midRate": "0.02885", "volume24": "1272", "rate24": "0.03735", "midRate24": "0.0371", "rateDelta24": "-0.00935", "midRateDelta24": "-0.00825", "maturityDate": 1697526000000 }, { "instrumentId": 11811, "tokenId": 5, "daysToMaturity": 2, "rate": "0.0364", "midRate": "0.03745", "volume24": "165", "rate24": "0", "midRate24": "0", "rateDelta24": "0.0364", "midRateDelta24": "0.03745", "maturityDate": 1697612400000 }, { "instrumentId": 11813, "tokenId": 5, "daysToMaturity": 4, "rate": "0.0396", "midRate": "0.04135", "volume24": "1279", "rate24": "0.04095", "midRate24": "0.04095", "rateDelta24": "-0.00135", "midRateDelta24": "0.0004", "maturityDate": 1697785200000 }, { "instrumentId": 11820, "tokenId": 5, "daysToMaturity": 11, "rate": "0.0405", "midRate": "0.0423", "volume24": "1287", "rate24": "0.0419", "midRate24": "0.03965", "rateDelta24": "-0.0014", "midRateDelta24": "0.00265", "maturityDate": 1698390000000 }, { "instrumentId": 11873, "tokenId": 5, "daysToMaturity": 18, "rate": "0.0416", "midRate": "0.0427", "volume24": "1285", "rate24": "0.0432", "midRate24": "0.0451", "rateDelta24": "-0.0016", "midRateDelta24": "-0.0024", "maturityDate": 1698994800000 }, { "instrumentId": 11820, "tokenId": 5, "daysToMaturity": 11, "rate": "0.0405", "midRate": "0.0423", "volume24": "1287", "rate24": "0.0419", "midRate24": "0.03965", "rateDelta24": "-0.0014", "midRateDelta24": "0.00265", "maturityDate": 1698390000000 }, { "instrumentId": 11974, "tokenId": 5, "daysToMaturity": 39, "rate": "0.0448", "midRate": "0.04375", "volume24": "1286", "rate24": "0.0439", "midRate24": "0.04535", "rateDelta24": "0.0009", "midRateDelta24": "-0.0016", "maturityDate": 1700809200000 }, { "instrumentId": 12149, "tokenId": 5, "daysToMaturity": 74, "rate": "0.0444", "midRate": "0.0456", "volume24": "1271", "rate24": "0.04545", "midRate24": "0.04425", "rateDelta24": "-0.00105", "midRateDelta24": "0.00135", "maturityDate": 1703833200000 }, { "instrumentId": 12149, "tokenId": 5, "daysToMaturity": 74, "rate": "0.0444", "midRate": "0.0456", "volume24": "1271", "rate24": "0.04545", "midRate24": "0.04425", "rateDelta24": "-0.00105", "midRateDelta24": "0.00135", "maturityDate": 1703833200000 }, { "instrumentId": 12611, "tokenId": 5, "daysToMaturity": 165, "rate": "0.049", "midRate": "0.0486", "volume24": "1276", "rate24": "0.04915", "midRate24": "0.04605", "rateDelta24": "-0.00015", "midRateDelta24": "0.00255", "maturityDate": 1711695600000 }, { "instrumentId": 15176, "tokenId": 5, "daysToMaturity": 256, "rate": "0.0454", "midRate": "0.0463", "volume24": "1286", "rate24": "0.04705", "midRate24": "0.0475", "rateDelta24": "-0.00165", "midRateDelta24": "-0.0012", "maturityDate": 1719558000000 }, { "instrumentId": 15636, "tokenId": 5, "daysToMaturity": 347, "rate": "0.0467", "midRate": "0.04995", "volume24": "1288", "rate24": "0.0502", "midRate24": "0.04805", "rateDelta24": "-0.0035", "midRateDelta24": "0.0019", "maturityDate": 1727420400000 } ] } }

Get historical (floating and/or fixed) rate mid rate details (for a given token ID and/or list of fixed rate instrument IDs).

Request

Parameter Required Type Description
tokenId NO integer Token ID
fixedRateInstrumentIds NO integer[] List of fixed rate instrument IDs

Response Body

Name Type Description
instrumentId (as value)
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ daysToMaturity
(Fixed markets only)
integer Number of days to expiry
└ rate string Latest traded market rate for this market
└ midRate string Mid value between the current best bid rate and best ask rate
└ volume24 string The total volume lent/borrowed in the last 24 hours
└ rate24 string The average market rate, weighted by time, traded in the last 24 hours
└ midRate24 string The average mid rate, weighted by time, over the last 24 hours
└ rateDelta24 string The change in the market rate between now and 24 hours ago

rate - rate24
└ midRateDelta24 string The change in the mid rate between now and 24 hours ago

midRate - midRate24
└ maturityDate
(Fixed markets only)
integer Maturity datetime (in UNIX time)

GET /public/get_historical_rates

Code sample:

Copy to Clipboard
GET /public/get_historical_rates?tokenId=1&daysToInclude=2

Example response:

Copy to Clipboard
{ "success": true, "data": { "floating": [ { "date": 1697500800000, "open": "0.0089", "close": "0.0088", "high": "0.0251", "low": "0.0086", "volume": "47490", "totalValue": "0", "usdValue": "1565.27251499", "lendDepth": 137945, "borrowDepth": 12080, "numDaysAgo": 2, "code": "ETH-SPOT", "tokenId": 1 }, { "date": 1697587200000, "open": "0.0088", "close": "0.0087", "high": "0.0253", "low": "0.0082", "volume": "50172", "totalValue": "0", "usdValue": "1563.642515", "lendDepth": 138016, "borrowDepth": 11995, "numDaysAgo": 1, "code": "ETH-SPOT", "tokenId": 1 } ], "fixed": { "1": [ { "date": 1697500800000, "open": "0.0299", "close": "0.03", "high": "0.0506", "low": "0.0237", "volume": "22321", "totalValue": "53437", "usdValue": "1565.27251499", "lendDepth": 320, "borrowDepth": 296, "numDaysAgo": 2, "daysToMaturity": 1 }, { "date": 1697587200000, "open": "0.0286", "close": "0.0264", "high": "0.0476", "low": "0.0204", "volume": "24133", "totalValue": "53316", "usdValue": "1563.642515", "lendDepth": 321, "borrowDepth": 290, "numDaysAgo": 1, "daysToMaturity": 1 } ], "2": [ { "date": 1697500800000, "open": "0", "close": "0", "high": "0", "low": "0", "volume": "0", "totalValue": "0", "usdValue": "1563.642515", "lendDepth": 0, "borrowDepth": 0, "numDaysAgo": 2, "daysToMaturity": 2 }, { "date": 1697587200000, "open": "0", "close": "0", "high": "0", "low": "0", "volume": "0", "totalValue": "0", "usdValue": "1563.642515", "lendDepth": 0, "borrowDepth": 0, "numDaysAgo": 1, "daysToMaturity": 2 } ], "8": [ { "date": 1697500800000, "open": "0.0308", "close": "0.0323", "high": "0.0533", "low": "0.0256", "volume": "22345", "totalValue": "228781", "usdValue": "1565.27251499", "lendDepth": 316, "borrowDepth": 292, "numDaysAgo": 2, "daysToMaturity": 8 }, { "date": 1697587200000, "open": "0.0303", "close": "0.0295", "high": "0.0506", "low": "0.0237", "volume": "24199", "totalValue": "228744", "usdValue": "1563.642515", "lendDepth": 316, "borrowDepth": 285, "numDaysAgo": 1, "daysToMaturity": 8 } ], "15": [ { "date": 1697500800000, "open": "0.0323", "close": "0.0301", "high": "0.0565", "low": "0.0279", "volume": "22277", "totalValue": "23522", "usdValue": "1565.27251499", "lendDepth": 327, "borrowDepth": 294, "numDaysAgo": 2, "daysToMaturity": 15 }, { "date": 1697587200000, "open": "0.033", "close": "0.0303", "high": "0.0534", "low": "0.0256", "volume": "24236", "totalValue": "26052", "usdValue": "1563.642515", "lendDepth": 313, "borrowDepth": 293, "numDaysAgo": 1, "daysToMaturity": 15 } ], "36": [ { "date": 1697500800000, "open": "0.0349", "close": "0.035", "high": "0.0577", "low": "0.029", "volume": "22428", "totalValue": "186889", "usdValue": "1565.27251499", "lendDepth": 317, "borrowDepth": 286, "numDaysAgo": 2, "daysToMaturity": 36 }, { "date": 1697587200000, "open": "0.0328", "close": "0.0305", "high": "0.0564", "low": "0.028", "volume": "24290", "totalValue": "190375", "usdValue": "1563.642515", "lendDepth": 323, "borrowDepth": 294, "numDaysAgo": 1, "daysToMaturity": 36 } ], "71": [ { "date": 1697500800000, "open": "0.0375", "close": "0.0357", "high": "0.0595", "low": "0.03", "volume": "22582", "totalValue": "287894", "usdValue": "1565.27251499", "lendDepth": 326, "borrowDepth": 291, "numDaysAgo": 2, "daysToMaturity": 71 }, { "date": 1697587200000, "open": "0.0377", "close": "0.0314", "high": "0.0577", "low": "0.0292", "volume": "23818", "totalValue": "291809", "usdValue": "1563.642515", "lendDepth": 322, "borrowDepth": 308, "numDaysAgo": 1, "daysToMaturity": 71 } ], "162": [ { "date": 1697500800000, "open": "0.0385", "close": "0.0387", "high": "0.0595", "low": "0.0309", "volume": "22438", "totalValue": "292953", "usdValue": "1565.27251499", "lendDepth": 311, "borrowDepth": 287, "numDaysAgo": 2, "daysToMaturity": 162 }, { "date": 1697587200000, "open": "0.0374", "close": "0.0381", "high": "0.059", "low": "0.0301", "volume": "23960", "totalValue": "297139", "usdValue": "1563.642515", "lendDepth": 315, "borrowDepth": 292, "numDaysAgo": 1, "daysToMaturity": 162 } ], "253": [ { "date": 1697500800000, "open": "0.0353", "close": "0.0327", "high": "0.0606", "low": "0.0313", "volume": "22481", "totalValue": "292297", "usdValue": "1565.27251499", "lendDepth": 314, "borrowDepth": 288, "numDaysAgo": 2, "daysToMaturity": 253 }, { "date": 1697587200000, "open": "0.0359", "close": "0.0391", "high": "0.0599", "low": "0.031", "volume": "24088", "totalValue": "297228", "usdValue": "1563.642515", "lendDepth": 308, "borrowDepth": 289, "numDaysAgo": 1, "daysToMaturity": 253 } ] } } }

Get historical (floating and/or fixed) rate details for a given token ID (and list of fixed rate instrument IDs).

Request

Parameter Required Type Description
tokenId YES integer Token ID
fixedRateInstrumentIds NO integer[] List of fixed rate instrument IDs
daysToInclude NO integer Number of Days To Include

Response Body

Name Type Description
floating object[] History of a floating market
└ date integer Historical date (in UNIX time)
└ open string First mid rate of the day
└ close string Last mid rate of the day
└ high string Highest mid rate during the day
└ low string Lowest mid rate during the day
└ volume string Total quantity of borrow/lend orders executed during the day
└ totalValue string Total value in USD (quantity times rate level) of borrow/lend orders executed during the day
└ usdValue string Token price in USD
└ lendDepth integer Total quantity of lend limit orders in market
└ borrowDepth integer Total quantity of borrow limit orders in market
└ numDaysAgo integer Number of days back between this historical date and today
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ tokenId
(Floating markets only)
integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ daysToMaturity
(Fixed markets only)
integer Number of days to expiry
fixed object Collection of fixed market histories based on daysToMaturity
└ daysToMaturity (as value) object[] History of a fixed market
 └ date string Historical date (in UNIX time)
 └ open string First mid rate of the day
 └ close string Last mid rate of the day
 └ high string Highest mid rate during the day
 └ low string Lowest mid rate during the day
 └ volume string Total quantity of borrow/lend orders executed during the day
 └ totalValue string Total value in USD (quantity times rate level) of borrow/lend orders executed during the day
 └ usdValue string Token price in USD
 └ lendDepth integer Total quantity of lend limit orders in market
 └ borrowDepth integer Total quantity of borrow limit orders in market
 └ numDaysAgo integer Number of days back between this historical date and today
 └ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs

GET /public/get_historical_total_value

Code sample:

Copy to Clipboard
GET /public/get_historical_total_value

Example response:

Copy to Clipboard
{ "success": true, "data": { "data": [ { "date": 1697587200000, "totalValue": "14037781892.13158244" }, { "date": 1697500800000, "totalValue": "13890334704.92648643" }, { "date": 1697414400000, "totalValue": "13669241014.61700799" }, { "date": 1697328000000, "totalValue": "13186506822.39017029" }, { "date": 1697241600000, "totalValue": "12885321599.1002221" } ] } }

Get historical total USD value.

Request

Parameter Required Type Description
limit NO integer Maximum Number of Days Back

Response Body

Name Type Description
data object[] Historical total value objects
└ date integer Historical date (in UNIX time)
└ totalValue string Total lending volume of the day in USD

GET /public/get_historical_yield_curve

Code sample:

Copy to Clipboard
GET /public/get_historical_yield_curve?tokenId=1&daysToInclude=2

Example response:

Copy to Clipboard
{ "success": true, "data": { "historicalCurve": { "2023-10-18": [ { "instrumentId": 11831, "rate": "0.03435", "label": "1D", "xpos": 0 }, { "instrumentId": 11832, "rate": "0.0406", "label": "2D", "xpos": 1 }, { "instrumentId": 11832, "rate": "0.0406", "label": "1W", "xpos": 2 }, { "instrumentId": 11839, "rate": "0.0442", "label": "2W", "xpos": 3 }, { "instrumentId": 11867, "rate": "0.04415", "label": "3W", "xpos": 4 }, { "instrumentId": 11839, "rate": "0.0442", "label": "1M", "xpos": 5 }, { "instrumentId": 11971, "rate": "0.0496", "label": "2M", "xpos": 6 }, { "instrumentId": 12146, "rate": "0.04945", "label": "3M", "xpos": 7 }, { "instrumentId": 12146, "rate": "0.04945", "label": "1Q", "xpos": 8 }, { "instrumentId": 12608, "rate": "0.05125", "label": "2Q", "xpos": 9 }, { "instrumentId": 15172, "rate": "0.05165", "label": "3Q", "xpos": 10 }, { "instrumentId": 15632, "rate": "0.0518", "label": "4Q", "xpos": 11 } ], "2023-10-19": [ { "instrumentId": 11832, "rate": "0.03525", "label": "1D", "xpos": 0 }, { "instrumentId": 11833, "rate": "0.0422", "label": "2D", "xpos": 1 }, { "instrumentId": 11832, "rate": "0.03525", "label": "1W", "xpos": 2 }, { "instrumentId": 11839, "rate": "0.04555", "label": "2W", "xpos": 3 }, { "instrumentId": 11867, "rate": "0.0469", "label": "3W", "xpos": 4 }, { "instrumentId": 11839, "rate": "0.04555", "label": "1M", "xpos": 5 }, { "instrumentId": 11971, "rate": "0.04915", "label": "2M", "xpos": 6 }, { "instrumentId": 12146, "rate": "0.0501", "label": "3M", "xpos": 7 }, { "instrumentId": 12146, "rate": "0.0501", "label": "1Q", "xpos": 8 }, { "instrumentId": 12608, "rate": "0.05315", "label": "2Q", "xpos": 9 }, { "instrumentId": 15172, "rate": "0.0543", "label": "3Q", "xpos": 10 }, { "instrumentId": 15632, "rate": "0.0532", "label": "4Q", "xpos": 11 } ] } } }

Get historical yield curve data for a given token ID.

Request

Parameter Required Type Description
tokenId YES integer Token ID
daysToInclude NO integer Number of Days To Include

Response Body

Name Type Description
historicalCurve object List of historical date yield curve objects
└ date (as value) object[] List of historical yield curves
 └ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
 └ rate string Latest traded market rate for this market on this particular date
 └ label string Fixed market name in format: number + letter code

(where D = day, W = week, M = month, Q = quarter)
 └ xpos integer Cardinal numbers

(to facilitate plotting the rates on a graph)

GET /public/get_yield_curve

Code sample:

Copy to Clipboard
GET /public/get_yield_curve?tokenId=1

Example response:

Copy to Clipboard
{ "success": true, "data": { "interpolatedRates": [ { "instrumentId": 1, "tokenId": 1, "interpolatedPx": "0.024", "pv01Series": "0", "daysToMaturity": 0, "enable": true }, { "instrumentId": 11829, "tokenId": 1, "interpolatedPx": "0.0365", "pv01Series": "0.0000005478608", "daysToMaturity": 1, "enable": true, "maturityDate": 1697526000000 }, { "instrumentId": 11830, "tokenId": 1, "interpolatedPx": "0.0418", "pv01Series": "0.0000008217411", "daysToMaturity": 2, "enable": true, "maturityDate": 1697612400000 }, { "instrumentId": 11832, "tokenId": 1, "interpolatedPx": "0.04485", "pv01Series": "0.0000013693974", "daysToMaturity": 4, "enable": true, "maturityDate": 1697785200000 }, { "instrumentId": 11839, "tokenId": 1, "interpolatedPx": "0.0504", "pv01Series": "0.0000032850664", "daysToMaturity": 11, "enable": true, "maturityDate": 1698390000000 }, { "instrumentId": 11867, "tokenId": 1, "interpolatedPx": "0.0493", "pv01Series": "0.0000051989704", "daysToMaturity": 18, "enable": true, "maturityDate": 1698994800000 }, { "instrumentId": 11971, "tokenId": 1, "interpolatedPx": "0.0546", "pv01Series": "0.0000109298786", "daysToMaturity": 39, "enable": true, "maturityDate": 1700809200000 }, { "instrumentId": 12146, "tokenId": 1, "interpolatedPx": "0.05275", "pv01Series": "0.0000204423538", "daysToMaturity": 74, "enable": true, "maturityDate": 1703833200000 }, { "instrumentId": 12608, "tokenId": 1, "interpolatedPx": "0.0527", "pv01Series": "0.0000448787513", "daysToMaturity": 165, "enable": true, "maturityDate": 1711695600000 }, { "instrumentId": 15172, "tokenId": 1, "interpolatedPx": "0.0567", "pv01Series": "0.0000690223622", "daysToMaturity": 256, "enable": true, "maturityDate": 1719558000000 }, { "instrumentId": 15632, "tokenId": 1, "interpolatedPx": "0.05515", "pv01Series": "0.0000928587848", "daysToMaturity": 347, "enable": true, "maturityDate": 1727420400000 } ] } }

List estimated yield curve.

Request

Parameter Required Type Description
tokenId YES integer
fullYieldCurve NO boolean

Response Body

Name Type Description
interpolatedRates object[] List of yield curve objects
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ interpolatedPx string Latest traded market rate for this market
└ pv01Series string pv01 value for this market (i.e. the impact in PV by shifting this market rate alone by 1 basis point per annum. and leaving the rest of the yield curve unchanged)
└ daysToMaturity integer Number of days to expiry
└ enable boolean Whether this market is currently enabled

The value for this field should always be True
└ maturityDate
(Fixed markets only)
integer Maturity datetime (in UNIX time)

Tokens

GET /private/get_token_mtms

Code sample:

Copy to Clipboard
GET /private/get_token_mtms?accountId=128

Example response:

Copy to Clipboard
{ "success": true, "data": { "mtm": [ { "accountId": 128, "tokenId": 1, "mtm": "-4848878.666424261", "key": { "accountId": 128 } }, { "accountId": 128, "tokenId": 2, "mtm": "-31368038.221844167", "key": { "accountId": 128 } }, { "accountId": 128, "tokenId": 3, "mtm": "-10528721.98505124", "key": { "accountId": 128 } }, { "accountId": 128, "tokenId": 4, "mtm": "-22298575.7645344", "key": { "accountId": 128 } }, { "accountId": 128, "tokenId": 5, "mtm": "-10177922.353423893", "key": { "accountId": 128 } } ] } }

Get user's marked-to-market values (for floating and fixed rate markets) for each token for a given account ID.

Request

Parameter Required Type Description
accountId YES integer account ID

Response Body

Name Type Description
mtm object[] List of Mark-to-market objects
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ mtm string Mark-to-market value in USD for this Token ID
└ key object Key object
 └ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange

GET /public/get_token_details

Code sample:

Copy to Clipboard
GET /public/get_token_details?tokenId=1

Example response:

Copy to Clipboard
{ "success": true, "data": { "token": { "tokenId": 1, "code": "ETH", "name": "ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "decimals": 18, "nativeToken": false, "withdrawFee": "0.01", "price": "1581.99735389" } } }

Get details for a given token ID.

Request

Parameter Required Type Description
tokenId YES integer Token ID

Response Body

Name Type Description
token object Token object
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ code string Token code

See Token IDs section for list of token codes
└ name string Token code

See Token IDs section for list of token names
└ tokenType integer Token type:

Currently all tokens at Infinity Exchange are designated as type 1
└ valueType integer Value type:

1 for non-stablecoin tokens
2 for stablecoin tokens
└ tokenValuationProtocol integer Platform the complex token comes from (if relevant):

See Token Valuation Protocols section
└ tokenAddress string Token chain address
└ decimals integer Number of decimal precision for this token
└ nativeToken boolean Is this a native token?
└ withdrawFee string Withdrawal fee (in number of tokens)
└ price string Latest token price

GET /public/get_tokens

Code sample:

Copy to Clipboard
GET /public/get_tokens

Example response:

Copy to Clipboard
{ "success": true, "data": { "tokens": [ { "tokenId": 1, "code": "ETH", "name": "ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "decimals": 18, "nativeToken": false, "withdrawFee": "0.01", "price": "1582.09761118" }, { "tokenId": 2, "code": "USDT", "name": "USDT", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "decimals": 6, "nativeToken": false, "withdrawFee": "5", "price": "1.0002" }, { "tokenId": 3, "code": "USDC", "name": "USDC", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "decimals": 6, "nativeToken": false, "withdrawFee": "5", "price": "0.99997476" }, { "tokenId": 4, "code": "DAI", "name": "DAI", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "tokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f", "decimals": 18, "nativeToken": false, "withdrawFee": "5", "price": "0.9999801" }, { "tokenId": 5, "code": "WBTC", "name": "Wrapped Bitcoin", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "tokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", "decimals": 8, "nativeToken": false, "withdrawFee": "0.001", "price": "27724.5" }, { "tokenId": 6, "code": "aUSDT", "name": "Aave interest bearing USDT", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 1, "tokenAddress": "0x3ed3b47dd13ec9a98b44e6204a523e766b225811", "decimals": 6, "nativeToken": false, "withdrawFee": "0", "price": "1.119164303103", "underlyingAssets": [ { "underlyingTokenId": 2, "underlyingTokenIndex": "1.118940515" } ] }, { "tokenId": 7, "code": "aUSDC", "name": "Aave interest bearing USDC", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 1, "tokenAddress": "0xbcca60bb61934080951369a648fb03df4f96263c", "decimals": 6, "nativeToken": false, "withdrawFee": "0", "price": "1.09271898107677512", "underlyingAssets": [ { "underlyingTokenId": 3, "underlyingTokenIndex": "1.092746562" } ] }, { "tokenId": 8, "code": "aDAI", "name": "Aave interest bearing DAI", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 1, "tokenAddress": "0x028171bca77440897b824ca71d1c56cac55b68a3", "decimals": 18, "nativeToken": false, "withdrawFee": "0", "price": "1.0894228050547485", "underlyingAssets": [ { "underlyingTokenId": 4, "underlyingTokenIndex": "1.089444485" } ] }, { "tokenId": 9, "code": "aWBTC", "name": "Aave interest bearing WBTC", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 1, "tokenAddress": "0x9ff58f4ffb29fa2266ab25e75e2a8b3503311656", "decimals": 8, "nativeToken": false, "withdrawFee": "0", "price": "27827.153898129", "underlyingAssets": [ { "underlyingTokenId": 5, "underlyingTokenIndex": "1.003702642" } ] }, { "tokenId": 10, "code": "aWETH", "name": "Aave interest bearing WETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 1, "tokenAddress": "0x030ba81f1c18d280636f32af80b9aad02cf0854e", "decimals": 18, "nativeToken": false, "withdrawFee": "0", "price": "1626.35075298617862594", "underlyingAssets": [ { "underlyingTokenId": 1, "underlyingTokenIndex": "1.027971183" } ] }, { "tokenId": 11, "code": "UNI-V3-POS", "name": "Uniswap V3 LP Position", "tokenType": 2, "valueType": 1, "tokenValuationProtocol": 2, "tokenAddress": "0xc36442b4a4522e871399cd717abdd847ab11fe88", "decimals": 18, "nativeToken": false, "withdrawFee": "0.001" }, { "tokenId": 12, "code": "cETH", "name": "Compound ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 3, "tokenAddress": "0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5", "decimals": 8, "nativeToken": false, "withdrawFee": "0.01", "price": "31.776905149833654", "underlyingAssets": [ { "underlyingTokenId": 1, "underlyingTokenIndex": "0.0200853" } ] }, { "tokenId": 13, "code": "cUSDC", "name": "Compound USDC", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 3, "tokenAddress": "0x39aa39c021dfbae8fac545936693ac917d5e7563", "decimals": 8, "nativeToken": false, "withdrawFee": "0.01", "price": "0.02287857353022876", "underlyingAssets": [ { "underlyingTokenId": 3, "underlyingTokenIndex": "0.022879151" } ] }, { "tokenId": 14, "code": "cDAI", "name": "Compound DAI", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 3, "tokenAddress": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643", "decimals": 8, "nativeToken": false, "withdrawFee": "0.01", "price": "0.0222631049553948", "underlyingAssets": [ { "underlyingTokenId": 4, "underlyingTokenIndex": "0.022263548" } ] }, { "tokenId": 15, "code": "cWBTC", "name": "Compound WBTC", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 3, "tokenAddress": "0xc11b1268c1a384e55c48c2391d8d480264a3a7f4", "decimals": 8, "nativeToken": false, "withdrawFee": "0.01", "price": "560.159327556", "underlyingAssets": [ { "underlyingTokenId": 5, "underlyingTokenIndex": "0.020204488" } ] }, { "tokenId": 16, "code": "cUSDT", "name": "Compound USDT", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 3, "tokenAddress": "0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9", "decimals": 8, "nativeToken": false, "withdrawFee": "0.01", "price": "0.0223664343924", "underlyingAssets": [ { "underlyingTokenId": 2, "underlyingTokenIndex": "0.022361962" } ] }, { "tokenId": 17, "code": "CRV-TRI", "name": "CRV-TRI", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 4, "tokenAddress": "0xc4ad29ba4b3c580e6d59105fff484999997675ff", "decimals": 18, "nativeToken": false, "withdrawFee": "0.001", "price": "1095.48111035586076992", "underlyingAssets": [ { "underlyingTokenId": 1, "underlyingTokenIndex": "0.204882144" }, { "underlyingTokenId": 2, "underlyingTokenIndex": "374.47003762" }, { "underlyingTokenId": 5, "underlyingTokenIndex": "0.014311985" } ] }, { "tokenId": 18, "code": "CRV-3POOL", "name": "CRV-3POOL", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 4, "tokenAddress": "0x6c3f90f043a72fa612cbac8115ee7e52bde6e490", "decimals": 18, "nativeToken": false, "withdrawFee": "0.001", "price": "1.02597060373968396", "underlyingAssets": [ { "underlyingTokenId": 2, "underlyingTokenIndex": "0.304850233" }, { "underlyingTokenId": 3, "underlyingTokenIndex": "0.368333361" }, { "underlyingTokenId": 4, "underlyingTokenIndex": "0.352742356" } ] }, { "tokenId": 19, "code": "stETH", "name": "Staked ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "tokenAddress": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84", "decimals": 18, "nativeToken": false, "withdrawFee": "0.01", "price": "1581.85839174" }, { "tokenId": 19, "code": "stETH", "name": "Staked ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "tokenAddress": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84", "decimals": 18, "nativeToken": false, "withdrawFee": "0.01", "price": "1582.09761118" } ] } }

Get details for all tokens.

Request

No parameters for this endpoint.

Response Body

Name Type Description
tokens object[] List of token objects
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ code string Token code

See Token IDs section for list of token codes
└ name string Token code

See Token IDs section for list of token names
└ tokenType integer Token type:

Currently all tokens at Infinity Exchange are designated as type 1
└ valueType integer Value type:

1 for non-stablecoin tokens
2 for stablecoin tokens
└ tokenValuationProtocol integer Platform the complex token comes from (if relevant):

See Token Valuation Protocols section
└ tokenAddress string Token chain address
└ decimals integer Number of decimal precision for this token
└ nativeToken boolean Is this a native token?
└ withdrawFee string Withdrawal fee (in number of tokens)
└ price string Latest token price

POST /public/get_underlying_tokens

Code sample:

Copy to Clipboard
POST /public/get_underlying_tokens [ { "tokenId": 1, "quantity": 1 }, { "tokenId": 2, "quantity": 1 } ]

Example response:

Copy to Clipboard
{ "success": true, "data": { "tokens": [ { "tokenId": 1, "code": "ETH", "name": "ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "decimals": 18, "nativeToken": false, "withdrawFee": "0.01", "price": "1582.04398141" }, { "tokenId": 2, "code": "USDT", "name": "USDT", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "decimals": 6, "nativeToken": false, "withdrawFee": "5", "price": "1.0002" } ] } }

Get token details for a given set of token balance parameters.

Request

No parameters for this endpoint.

Response Body

Name Type Description
tokens object[] List of token objects
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ code string Token code

See Token IDs section for list of token codes
└ name string Token code

See Token IDs section for list of token names
└ tokenType integer Token type:

Currently all tokens at Infinity Exchange are designated as type 1
└ valueType integer Value type:

1 for non-stablecoin tokens
2 for stablecoin tokens
└ tokenValuationProtocol integer Platform the complex token comes from (if relevant):

See Token Valuation Protocols section
└ tokenAddress string Token chain address
└ decimals integer Number of decimal precision for this token
└ nativeToken boolean Is this a native token?
└ withdrawFee string Withdrawal fee (in number of tokens)
└ price string Latest token price

Trading

GET /private/aggregate_orders_by_rate

Code sample:

Copy to Clipboard
GET /private/aggregate_orders_by_rate?floatRateInstrumentId=ETH-SPOT&fixedRateInstrumentIds=ETH-2023-11-24,ETH-2023-12-01

Example response:

Copy to Clipboard
{ "success": true, "data": { "ir": [ { "instrumentId": 1, "rate": "0.0279", "quantity": "4.3151", "side": false }, { "instrumentId": 1, "rate": "0.033", "quantity": "2.384", "side": false }, { "instrumentId": 1, "rate": "0.0309", "quantity": "2.8531", "side": false }, { "instrumentId": 1, "rate": "0.021", "quantity": "4.1742", "side": true }, { "instrumentId": 1, "rate": "0.0204", "quantity": "3.4571", "side": true }, { "instrumentId": 1, "rate": "0.0176", "quantity": "0.1655", "side": true } ], "fr": [ { "instrumentId": 15172, "rate": "0.0589", "quantity": "4.5022", "side": false }, { "instrumentId": 15172, "rate": "0.0571", "quantity": "4.0823", "side": false }, { "instrumentId": 15172, "rate": "0.0721", "quantity": "1.0851", "side": false }, { "instrumentId": 15172, "rate": "0.0347", "quantity": "0.7719", "side": true }, { "instrumentId": 15172, "rate": "0.0452", "quantity": "4.0287", "side": true }, { "instrumentId": 15172, "rate": "0.0367", "quantity": "0.8654", "side": true } ] } }

Get user's orders in rate buckets for a given floating rate instrument ID and/or list of fixed rate instrument IDs (and account ID).

Request

Parameter Required Type Description
floatRateInstrumentId NO string Floating rate instrument ID
fixedRateInstrumentIds NO string[] List of fixed rate instrument IDs
accountId NO integer account ID

Response Body

Name Type Description
ir object Floating rate object
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ rate string Rate at which user has limit orders
└ quantity string User's total quantity of limit orders at this rate
└ side boolean Borrow order (true) or lend order (false)
fr object[] List of fixed rate objects
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ rate string Rate at which user has limit orders
└ quantity string User's total quantity of limit orders at this rate
└ side boolean Borrow order (true) or lend order (false)

POST /api/trade/cancel-batch-orders

Code sample:

Copy to Clipboard
POST /api/trade/cancel-batch-orders { "instrumentId": "ETH-SPOT", "accountId": 1234, "clientOrderIds": ["b25ab402", "5e885dd"] }

Example response:

Copy to Clipboard
{ "success": true, "data": { "orders": [{ "accountId": 1234, "clientOrderId": "b25ab402", "code": 0 }, { "accountId": 1234, "clientOrderId": "5e885dd", "code": 0 }] } }

Cancel orders in batch.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID
accountId YES integer Account ID
clientOrderIds NO string[] Client order IDs
orderIds NO integer[] Order IDs

Response Body

Name Type Description
orders object Cancel orders result
└ accountId integer Account ID
└ clientOrderId string Client order ID
└ orderId integer Order ID
└ code integer Result code (0 = success)

POST /api/trade/cancel-order

Code sample:

Copy to Clipboard
POST /api/trade/cancel-order { "instrumentId": "ETH-SPOT", "accountId": 1234, "orderId": 204270016 }

Example response:

Copy to Clipboard
{ "success": true, "data": { "orders": [{ "accountId": 1234, "orderId": 204270016, "code": 0 }] } }

Cancel an order.

Request

Parameter Required Type Description
instrumentId YES string Instrument ID
accountId YES integer Account ID
clientOrderId NO string Client order ID
orderId NO integer Order ID

Response Body

Name Type Description
orders object Cancel order result
└ accountId integer Account ID
└ clientOrderId string Client order ID
└ orderId integer Order ID
└ code integer Result code (0 = success)

POST /private/create_fixed_order

Code sample:

Copy to Clipboard
POST /private/create_fixed_order { "instrumentId": 15173, "accountId": 128, "side": 1, "orderType": 2, "quantity": 1, "clientOrderId": "05d61624", "passive": false, "rate": 0.01 }

Example response:

Copy to Clipboard
{ "success": true, "data": { "order": { "orderId": 204415806, "instrumentId": 15173, "accountId": 128, "side": true, "orderType": 2, "quantity": "1", "fulfilled": "0", "rate": "0.01", "status": 1, "clientOrderId": "05d61624", "passive": false, "orderDate": 1697449417659, "source": 1 } } }

Create new fixed rate order.

Request

No parameters for this endpoint.

Response Body

Name Type Description
order object Order object
└ orderId integer Unique order ID, assigned by Infinity Exchange
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ side boolean Borrow order (true) or lend order (false)
└ orderType integer Market order (1) or limit order (2)

If an order is sent with both a rate specified and an orderType of 1, then a maximum slippage order is created
└ quantity string Order quantity
└ fulfilled string Whether the order has already been executed
└ rate string The order rate

The should not be included for a regular market order; however if an order is sent with both a rate specified and an orderType of 1, then a maximum slippage order is created
└ status integer Order status - see the Order Status Codes section for more information
└ clientOrderId string An arbitrary (preferably unique) provided by the client when the order was created
└ passive boolean Whether the order is a maker order only (i.e. can only be lifted, but cannot lift/take any orders from the orderbook itself - in other words, can only add liquidity)

If set to false, there are no such restrictions and the order can immediately lift (i.e. take) existing orders in the orderbook if it is crossing the bid/ask rate spread
└ orderDate integer Datetime (in UNIX time) when the order was placed
└ source integer Where the order is originated

1: User interface
5: TWAP

POST /private/create_floating_order

Code sample:

Copy to Clipboard
POST /private/create_floating_order { "instrumentId": 2, "accountId": 128, "side": 1, "orderType": 2, "quantity": 1, "clientOrderId": "05d61624", "passive": false, "rate": 0.01 }

Example response:

Copy to Clipboard
{ "success": true, "data": { "order": { "orderId": 80387225, "instrumentId": 2, "accountId": 128, "side": true, "orderType": 2, "quantity": "1", "fulfilled": "0", "rate": "0.01", "status": 1, "clientOrderId": "05d61624", "passive": false, "orderDate": 1697449482706, "source": 1, } } }

Create a new floating rate order.

Request

No parameters for this endpoint.

Response Body

Name Type Description
order object Order object
└ orderId integer Unique order ID, assigned by Infinity Exchange
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ side boolean Borrow order (true) or lend order (false)
└ orderType integer Market order (1) or limit order (2)

If an order is sent with both a rate specified and an orderType of 1, then a maximum slippage order is created
└ quantity string Order quantity
└ fulfilled string Whether the order has already been executed
└ rate string The order rate

The should not be included for a regular market order; however if an order is sent with both a rate specified and an orderType of 1, then a maximum slippage order is created
└ status integer Order status - see the Order Status Codes section for more information
└ clientOrderId string An arbitrary (preferably unique) provided by the client when the order was created
└ passive boolean Whether the order is a maker order only (i.e. can only be lifted, but cannot lift/take any orders from the orderbook itself - in other words, can only add liquidity)

If set to false, there are no such restrictions and the order can immediately lift (i.e. take) existing orders in the orderbook if it is crossing the bid/ask rate spread
└ orderDate integer Datetime (in UNIX time) when the order was placed
└ source integer Where the order is originated

1: User interface
5: TWAP

GET /private/get_fixed_orders

Code sample:

Copy to Clipboard
GET /private/get_fixed_orders?accountId=128

Example response:

Copy to Clipboard
{ "success": true, "data": { "orders": [ { "orderId": 204421028, "instrumentId": 12607, "accountId": 128, "side": false, "orderType": 1, "quantity": "994.66", "fulfilled": "994.66", "status": 10, "clientOrderId": "y0xja3Xi", "passive": false, "orderDate": 1697449610000, "source": 1, "updateDate": 1697449609000, "daysToMaturity": 165, "code": "DAI-2024-03-29", "averageTradePrice": "0.047", "trades": [ { "side": false, "rate": "0.047", "quantity": "994.66", "date": 1697449609000 } ], }, { "orderId": 204421027, "instrumentId": 11446, "accountId": 128, "side": true, "orderType": 1, "quantity": "922.58", "fulfilled": "922.58", "status": 10, "clientOrderId": "f5onoOtR", "passive": false, "orderDate": 1697449610000, "source": 1, "updateDate": 1697449609000, "daysToMaturity": 2, "code": "DAI-2023-10-18", "averageTradePrice": "0.0338", "trades": [ { "side": true, "rate": "0.0338", "quantity": "922.58", "date": 1697449609000 } ], }, { "orderId": 204421026, "instrumentId": 12611, "accountId": 128, "side": true, "orderType": 1, "quantity": "0.034416", "fulfilled": "0.034416", "status": 10, "clientOrderId": "wANCmWeP", "passive": false, "orderDate": 1697449610000, "source": 1, "updateDate": 1697449609000, "daysToMaturity": 165, "code": "WBTC-2024-03-29", "averageTradePrice": "0.0493", "trades": [ { "side": true, "rate": "0.0493", "quantity": "0.034416", "date": 1697449609000 } ], } ] } }

Get user fixed rate orders for a given account ID (and instrument ID).

Request

Parameter Required Type Description
instrumentId NO string Instrument ID
accountId YES integer Account ID
pending NO boolean Pending Orders Only?
done NO boolean Done Orders Only?
startId NO integer Order Start ID
limit NO integer Maximum Number of Orders To Return

Response Body

Name Type Description
orders object[] List of order object
└ orderId integer Unique order ID, assigned by Infinity Exchange
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available fixed instrument IDs
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ side boolean Borrow order (true) or lend order (false)
└ orderType integer Market order (1) or limit order (2)

If an order is sent with both a rate specified and an orderType of 1, then a maximum slippage order is created
└ quantity string Order quantity
└ fulfilled string Whether the order has already been executed
└ status integer Order status - see the Order Status Codes section for more information
└ clientOrderId string An arbitrary (preferably unique) provided by the client when the order was created
└ passive boolean Whether the order is a maker order only (i.e. can only be lifted, but cannot lift/take any orders from the orderbook itself - in other words, can only add liquidity)

If set to false, there are no such restrictions and the order can immediately lift (i.e. take) existing orders in the orderbook if it is crossing the bid/ask rate spread
└ orderDate integer Datetime (in UNIX time) when the order was placed
└ source integer Where the order is originated

1: User interface
5: TWAP
└ updateDate integer Datetime (in UNIX time) something last occurred to the order
└ daysToMaturity integer Number of days to expiry
└ averageTradePrice string Average traded rate weighted by quantity
└ trades object[] List of executed trades for this order
 └ side boolean Order side - Borrow (true) or lend (false)
 └ rate string Rate executed
 └ quantity string Quantity executed
 └ date integer Datetime (in UNIX time) executed

GET /private/get_floating_orders

Code sample:

Copy to Clipboard
GET /private/get_floating_orders?accountId=128

Example response:

Copy to Clipboard
{ "success": true, "data": { "orders": [ { "orderId": 80388657, "instrumentId": 7, "accountId": 128, "side": false, "orderType": 1, "quantity": "1155.87", "fulfilled": "1155.87", "status": 10, "clientOrderId": "qCSNaJJM", "passive": false, "orderDate": 1697449646000, "source": 1, "updateDate": 1697449646000, "averageTradePrice": "0.017596635", "trades": [ { "side": false, "rate": "0.0176", "quantity": "815.26", "date": 1697449646000 }, { "side": false, "rate": "0.0176", "quantity": "301.72", "date": 1697449646000 }, { "side": false, "rate": "0.0175", "quantity": "38.89", "date": 1697449646000 } ], }, { "orderId": 80388650, "instrumentId": 8, "accountId": 128, "side": true, "orderType": 1, "quantity": "0.0413", "fulfilled": "0.0413", "status": 10, "clientOrderId": "SkuScoEA", "passive": false, "orderDate": 1697449645000, "source": 1, "updateDate": 1697449645000, "averageTradePrice": "0.03", "trades": [ { "side": true, "rate": "0.03", "quantity": "0.0207", "date": 1697449646000 }, { "side": true, "rate": "0.03", "quantity": "0.0206", "date": 1697449646000 } ], }, { "orderId": 80388647, "instrumentId": 5, "accountId": 128, "side": true, "orderType": 1, "quantity": "1190.25", "fulfilled": "1190.25", "status": 10, "clientOrderId": "5UpiRCbT", "passive": false, "orderDate": 1697449645000, "source": 1, "updateDate": 1697449645000, "averageTradePrice": "0.0193", "trades": [ { "side": true, "rate": "0.0193", "quantity": "1190.25", "date": 1697449645000 } ], }, { "orderId": 80388631, "instrumentId": 7, "accountId": 128, "side": true, "orderType": 1, "quantity": "1205.85", "fulfilled": "1205.85", "status": 10, "clientOrderId": "lrWk2mJs", "passive": false, "orderDate": 1697449644000, "source": 1, "updateDate": 1697449644000, "averageTradePrice": "0.0196", "trades": [ { "side": true, "rate": "0.0196", "quantity": "865.24", "date": 1697449644000 }, { "side": true, "rate": "0.0196", "quantity": "301.72", "date": 1697449644000 }, { "side": true, "rate": "0.0196", "quantity": "38.89", "date": 1697449644000 } ], }, { "orderId": 80388624, "instrumentId": 2, "accountId": 128, "side": false, "orderType": 1, "quantity": "906.84", "fulfilled": "906.84", "status": 10, "clientOrderId": "RvtSYXRN", "passive": false, "orderDate": 1697449644000, "source": 1, "updateDate": 1697449643000, "averageTradePrice": "0.0296846", "trades": [ { "side": false, "rate": "0.0297", "quantity": "502.71", "date": 1697449644000 }, { "side": false, "rate": "0.0297", "quantity": "55.01", "date": 1697449644000 }, { "side": false, "rate": "0.0296", "quantity": "139.65", "date": 1697449644000 }, { "side": false, "rate": "0.0297", "quantity": "209.47", "date": 1697449644000 } ], }, { "orderId": 80388619, "instrumentId": 1, "accountId": 128, "side": false, "orderType": 1, "quantity": "0.7338", "fulfilled": "0.7338", "status": 10, "clientOrderId": "bi7JEvd9", "passive": false, "orderDate": 1697449643000, "source": 1, "updateDate": 1697449643000, "averageTradePrice": "0.0236", "trades": [ { "side": false, "rate": "0.0236", "quantity": "0.0072", "date": 1697449643000 }, { "side": false, "rate": "0.0236", "quantity": "0.0072", "date": 1697449643000 }, { "side": false, "rate": "0.0236", "quantity": "0.0006", "date": 1697449643000 }, { "side": false, "rate": "0.0236", "quantity": "0.0001", "date": 1697449643000 }, { "side": false, "rate": "0.0236", "quantity": "0.0643", "date": 1697449643000 }, { "side": false, "rate": "0.0236", "quantity": "0.007", "date": 1697449643000 }, { "side": false, "rate": "0.0236", "quantity": "0.0563", "date": 1697449643000 }, { "side": false, "rate": "0.0236", "quantity": "0.044", "date": 1697449643000 }, { "side": false, "rate": "0.0236", "quantity": "0.547", "date": 1697449643000 }, { "side": false, "rate": "0.0236", "quantity": "0.0001", "date": 1697449643000 } ], } ] } }

Get user floating rate orders for a given account ID (and instrument ID).

Request

Parameter Required Type Description
instrumentId NO string Instrument ID
accountId YES integer Account ID
pending NO boolean Pending Orders Only?
done NO boolean Done Orders Only?
startId NO integer Order Start ID
limit NO integer Maximum Number of Orders To Return

Response Body

Name Type Description
orders object[] List of order object
└ orderId integer Unique order ID, assigned by Infinity Exchange
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ side boolean Borrow order (true) or lend order (false)
└ orderType integer Market order (1) or limit order (2)

If an order is sent with both a rate specified and an orderType of 1, then a maximum slippage order is created
└ quantity string Order quantity
└ fulfilled string Whether the order has already been executed
└ status integer Order status - see the Order Status Codes section for more information
└ clientOrderId string An arbitrary (preferably unique) provided by the client when the order was created
└ passive boolean Whether the order is a maker order only (i.e. can only be lifted, but cannot lift/take any orders from the orderbook itself - in other words, can only add liquidity)

If set to false, there are no such restrictions and the order can immediately lift (i.e. take) existing orders in the orderbook if it is crossing the bid/ask rate spread
└ orderDate integer Datetime (in UNIX time) when the order was placed
└ source integer Where the order is originated

1: User interface
5: TWAP
└ updateDate integer Datetime (in UNIX time) something last occurred to the order
└ averageTradePrice string Average traded rate weighted by quantity
└ trades object[] List of executed trades for this order
 └ side boolean Order side - Borrow (true) or lend (false)
 └ rate string Rate executed
 └ quantity string Quantity executed
 └ date integer Datetime (in UNIX time) executed

GET /private/get_floating_positions

Code sample:

Copy to Clipboard
GET /private/get_floating_positions

Example response:

Copy to Clipboard
{ "success": true, "data": { "positions": [ { "accountId": 127, "instrumentId": 1, "totalValue": "0.14002057", "mtm": "0", "quantity": "0.14002057", "tokenId": 1 }, { "accountId": 128, "instrumentId": 1, "totalValue": "1153.636366514", "mtm": "0", "quantity": "1153.636366514", "tokenId": 1 }, { "accountId": 128, "instrumentId": 2, "totalValue": "-2458918.840968667", "mtm": "0", "quantity": "-2458918.840968667", "tokenId": 3 }, { "accountId": 128, "instrumentId": 5, "totalValue": "-16025689.857951968", "mtm": "0", "quantity": "-16025689.857951968", "tokenId": 2 }, { "accountId": 128, "instrumentId": 7, "totalValue": "-8158006.818871855", "mtm": "0", "quantity": "-8158006.818871855", "tokenId": 4 }, { "accountId": 128, "instrumentId": 8, "totalValue": "-188.391990279", "mtm": "0", "quantity": "-188.391990279", "tokenId": 5 } ] } }

Get user's current floating rate positions (for a given instrument ID and/or account ID).

Request

Parameter Required Type Description
instrumentId NO string Instrument ID
accountId NO integer Account ID

Response Body

Name Type Description
positions object[] List of position objects
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ totalValue string Total value in USD of position for this account and market
└ mtm string Mark to market value of this position
└ quantity string Order quantity
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs

GET /private/get_floating_trades

Code sample:

Copy to Clipboard
GET /private/get_floating_trades?accountId=128

Example response:

Copy to Clipboard
{ "success": true, "data": { "trxs": [ { "trxId": 64893905, "instrumentId": 2, "side": true, "rate": "0.0327", "quantity": "53.04", "borrowOrderId": 80390492, "date": 1697449849000 }, { "trxId": 64893904, "instrumentId": 2, "side": true, "rate": "0.0327", "quantity": "791.92", "borrowOrderId": 80390492, "date": 1697449849000 }, { "trxId": 64893892, "instrumentId": 7, "side": true, "rate": "0.0196", "quantity": "42.59", "borrowOrderId": 80390476, "date": 1697449849000 }, { "trxId": 64893891, "instrumentId": 7, "side": true, "rate": "0.0196", "quantity": "344.82", "borrowOrderId": 80390476, "date": 1697449849000 }, { "trxId": 64893890, "instrumentId": 7, "side": true, "rate": "0.0196", "quantity": "926.65", "borrowOrderId": 80390476, "date": 1697449849000 }, { "trxId": 64893889, "instrumentId": 8, "side": false, "rate": "0.03", "quantity": "0.0204", "lendOrderId": 80390473, "date": 1697449847000 }, { "trxId": 64893888, "instrumentId": 8, "side": false, "rate": "0.03", "quantity": "0.0204", "lendOrderId": 80390473, "date": 1697449847000 }, { "trxId": 64893887, "instrumentId": 5, "side": false, "rate": "0.0174", "quantity": "952.38", "lendOrderId": 80390470, "date": 1697449847000 }, { "trxId": 64893886, "instrumentId": 5, "side": false, "rate": "0.0174", "quantity": "98.05", "lendOrderId": 80390470, "date": 1697449847000 }, { "trxId": 64893885, "instrumentId": 1, "side": false, "rate": "0.0236", "quantity": "0.5599", "lendOrderId": 80390468, "date": 1697449846000 }, { "trxId": 64893884, "instrumentId": 1, "side": false, "rate": "0.0236", "quantity": "0.0451", "lendOrderId": 80390468, "date": 1697449846000 } ] } }

Get user's floating rate transactions for a given account ID (and instrument ID).

Request

Parameter Required Type Description
accountId YES integer Account ID
instrumentId NO string Instrument ID
startId NO integer Transaction Start ID
limit NO integer Maximum Number of Transactions To Return

Response Body

Name Type Description
trxs object[] List of trade objects
└ trxId integer Unique ID for the trade, assigned by Infinity Exchange
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ side boolean Original order side - Borrow (true) or lend (false)
└ rate string Rate executed
└ quantity string Transaction quantity
└ borrowOrderId integer Unique order ID, assigned by Infinity Exchange
└ lendOrderId integer Unique order ID, assigned by Infinity Exchange
└ date integer Datetime (in UNIX time) executed

GET /private/get_all_positions

Code sample:

Copy to Clipboard
GET /private/get_all_positions

Example response:

Copy to Clipboard
{ "success": true, "data": { "accountPositions": [ { "accountId": 128, "instrumentId": "ETH-SPOT", "mtm": "0", "quantity": "1155.647612847", "tokenId": 1, "accruedInterest": "0.286132013", "netPositions": "101.286132014", "pv": "101.286132014", "dv01": "0", "rollOverHour": 7 }, { "accountId": 128, "instrumentId": "USDC-SPOT", "mtm": "0", "quantity": "-2455421.480975741", "tokenId": 3 }, { "accountId": 128, "instrumentId": "USDT-SPOT", "mtm": "0", "quantity": "-16028972.643296486", "tokenId": 2 }, { "accountId": 128, "instrumentId": "DAI-SPOT", "mtm": "0", "quantity": "-8157824.528747583", "tokenId": 4 }, { "accountId": 128, "instrumentId": "BTC-SPOT", "mtm": "0", "quantity": "-188.302891041", "tokenId": 5 }, { "accountId": 128, "instrumentId": "ETH-2023-12-31", "price": "0.60688031547680683985829776", "mtm": "-5303585.492242449", "quantity": "-39.6324", "tokenId": 1, "dv01": "-1.4528903401292611804135936", "maturityDate": 1697526000000 }, { "accountId": 128, "instrumentId": "USDT-2023-12-23", "price": "0.97718428610452529172308782", "mtm": "-5539990.259952144", "quantity": "-40343.91", "tokenId": 2, "dv01": "-1.51764214809086879571765", "maturityDate": 1697526000000 }, { "accountId": 128, "instrumentId": "USDT-2023-12-31", "price": "4.42601172068179883375160807", "mtm": "-955005.654991692", "quantity": "-948.34", "tokenId": 2, "dv01": "-0.5232102077284119895629", "maturityDate": 1697612400000 }, { "accountId": 128, "instrumentId": "USDC-2023-12-31", "price": "0.9852439610988646792170419", "mtm": "-5335114.852185006", "quantity": "-44896.4", "tokenId": 3, "dv01": "-1.4615035493460347232", "maturityDate": 1697526000000 }, { "accountId": 128, "instrumentId": "DAI-2023-12-23", "price": "-7.60110163901885813569190486", "mtm": "-5687546.054726167", "quantity": "5942.58", "tokenId": 4, "dv01": "-1.558037275132293116028", "maturityDate": 1697526000000 }, { "accountId": 128, "instrumentId": "DAI-2023-12-31", "price": "-0.77800719631576378765536128", "mtm": "-988532.63554501", "quantity": "4509.65", "tokenId": 4, "dv01": "-0.5415750239895833105268", "maturityDate": 1697612400000 }, { "accountId": 128, "instrumentId": "DAI-2024-02-02", "price": "2.16284339534246498675200147", "mtm": "-21611534.15444662", "quantity": "-117357.35", "tokenId": 4, "dv01": "-23.6743205122308902777424", "maturityDate": 1697785200000 }, { "accountId": 128, "instrumentId": "BTC-2024-04-23", "price": "10.10286034712232905982905983", "mtm": "-5832134.380925237", "quantity": "-0.1755", "tokenId": 5, "dv01": "-1.597633140731834635064621", "maturityDate": 1697526000000 }, { "accountId": 128, "instrumentId": "BTC-2024-06-23", "price": "0.28081845341286749087288417", "mtm": "-1152575.500970571", "quantity": "-0.6026", "tokenId": 5, "dv01": "-0.631438182260749926737231", "maturityDate": 1697612400000 } ] } }

Get user's floating and fixed rate positions for a given account ID.

Request

Parameter Required Type Description
accountId YES integer Account ID.

Response Body

Name Type Description
accountPositions object Position object
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ instrumentId string Infinity Exchange instrument ID

Use endpoint GET /public/get_all_markets to get a list of all available instrument IDs
└ quantity string Order quantity
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
 └ rate string Average rate entered for fixed rate position
 └ price string Token price in USD
 └ accruedInterest string Accrued interest for floating rate position
 └ netPositions string Quantity + Accrued Interest
 └ mtm string Mark to market value of this position
 └ dv01 string DV01 value
 └ pv string Present value (Net Positions + mtm)
 └ rollOverHour integer the hour that rollover of the market starts
 └ maturityDate integer Maturity datetime (in UNIX time)

User

GET /private/get_user_info

Code sample:

Copy to Clipboard
GET /private/get_user_info

Example response:

Copy to Clipboard
{ "success": true, "data": { "user": { "userId": 31, "address": "0x5c812c9a67e6900eb20f3f31d0ecce523d6a5c03", "userType": 1, "status": 1, "accounts": [ { "accountId": 127, "type": 1, "cashTokenIds": [ 1 ], "irTokenIds": [ 1 ] }, { "accountId": 128, "type": 2, "cashTokenIds": [ 1, 2, 3, 4, 5 ], "irTokenIds": [ 1, 3, 2, 4, 5 ] } ] } } }

Get User info

Request

No parameters for this endpoint.

Response Body

Name Type Description
user object User object
└ userId integer Unique ID for the user assigned by Infinity Exchange
└ address string The user's ethereum wallet address
└ userType integer User type:

Currently all users are type 1
└ status integer User status:

Currently all active users have status 1
└ accounts object[] List of Infinity Exchange current & trading accounts associated with this user
 └ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
 └ type integer Account type:

1 for current account
2 for trading account
 └ cashTokenIds integer[] List of tokens currently in this account

See Token IDs section for list of Token IDs
 └ irTokenIds integer[] List of floating positions currently in this account

See Token IDs section for list of Token IDs

Account

GET /private/get_all_account_tx

Code sample:

Copy to Clipboard
GET /private/get_all_account_tx

Example response:

Copy to Clipboard
{ "success": true, "data": { "trxs": [ { "trxId": 507810925, "accountId": 128, "tokenId": 5, "type": 15, "quantity": "-0.00000433", "balance": "10000000397.524511328", "createDate": 1697449562000 }, { "trxId": 507810924, "accountId": 128, "tokenId": 5, "type": 2, "quantity": "-0.0433", "balance": "10000000397.524515658", "createDate": 1697449562000 }, { "trxId": 507810921, "accountId": 128, "tokenId": 1, "type": 15, "quantity": "-0.00005537", "balance": "9999993315.185240286", "createDate": 1697449562000 }, { "trxId": 507810920, "accountId": 128, "tokenId": 1, "type": 2, "quantity": "-0.5537", "balance": "9999993315.185295656", "createDate": 1697449562000 }, { "trxId": 507810917, "accountId": 128, "tokenId": 1, "type": 15, "quantity": "-0.00007014", "balance": "9999993315.738925516", "createDate": 1697449562000 }, { "trxId": 507810916, "accountId": 128, "tokenId": 1, "type": 2, "quantity": "0.7014", "balance": "9999993315.738995656", "createDate": 1697449562000 }, { "trxId": 507810913, "accountId": 128, "tokenId": 5, "type": 15, "quantity": "-0.000003919", "balance": "10000000397.567811739", "createDate": 1697449562000 }, { "trxId": 507810912, "accountId": 128, "tokenId": 5, "type": 2, "quantity": "0.039188", "balance": "10000000397.567815658", "createDate": 1697449562000 }, { "trxId": 507810909, "accountId": 128, "tokenId": 4, "type": 15, "quantity": "-0.122586", "balance": "10010524604.519541913", "createDate": 1697449562000 }, { "trxId": 507810908, "accountId": 128, "tokenId": 4, "type": 2, "quantity": "1225.86", "balance": "10010524604.642127913", "createDate": 1697449562000 }, { "trxId": 507810905, "accountId": 128, "tokenId": 4, "type": 15, "quantity": "-0.090417", "balance": "10010523378.691710913", "createDate": 1697449562000 }, { "trxId": 507810904, "accountId": 128, "tokenId": 4, "type": 2, "quantity": "904.17", "balance": "10010523378.782127913", "createDate": 1697449562000 }, { "trxId": 507810901, "accountId": 128, "tokenId": 3, "type": 15, "quantity": "-0.101888", "balance": "9994348174.772819572", "createDate": 1697449562000 }, { "trxId": 507810900, "accountId": 128, "tokenId": 3, "type": 2, "quantity": "1018.88", "balance": "9994348174.874707572", "createDate": 1697449562000 }, { "trxId": 507810897, "accountId": 128, "tokenId": 1, "type": 15, "quantity": "-0.00002419", "balance": "9999993315.037571466", "createDate": 1697449562000 }, { "trxId": 507810896, "accountId": 128, "tokenId": 1, "type": 2, "quantity": "0.2419", "balance": "9999993315.037595656", "createDate": 1697449562000 }, { "trxId": 507810893, "accountId": 128, "tokenId": 1, "type": 15, "quantity": "-0.00004359", "balance": "9999993314.795652066", "createDate": 1697449562000 }, { "trxId": 507810892, "accountId": 128, "tokenId": 1, "type": 2, "quantity": "0.4359", "balance": "9999993314.795695656", "createDate": 1697449562000 }, { "trxId": 507810889, "accountId": 128, "tokenId": 4, "type": 15, "quantity": "-0.087503", "balance": "10010522474.524624913", "createDate": 1697449562000 }, { "trxId": 507810888, "accountId": 128, "tokenId": 4, "type": 2, "quantity": "875.03", "balance": "10010522474.612127913", "createDate": 1697449562000 } ] } }

Get account transactions.

Request

Parameter Required Type Description
type NO string Transaction type
startId NO integer Start of transaction ID
limit NO integer Max number of transactions to return

Response Body

Name Type Description
trxs object[] List of transaction objects
└ trxId integer Unique ID for the transaction, assigned by Infinity Exchange
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ type integer Transaction type

See Transaction Types section for full list
└ quantity string Transaction quantity
└ balance string Balance of account after transaction
└ createDate integer Transaction datetime stamp (in UNIX time)

GET /private/get_max_borrow

Code sample:

Copy to Clipboard
GET /private/get_max_borrow?accountId=128

Example response:

Copy to Clipboard
{ "success": true, "data": { "accountTokenPositions": [ { "accountId": 128, "tokenId": 1, "netAssetValue": "15822986392393.16", "cash": "15822989419978.8", "cashAvailable": "15822989419978.8", "netPositions": "2113780.6704090694", "maxWithdrawInUSD": "15822989419978.8" }, { "accountId": 128, "tokenId": 2, "netAssetValue": "9987465156.697317", "cash": "10018837167.268122", "cashAvailable": "10018835948.016521", "netPositions": "-25271937.06326226", "maxWithdrawInUSD": "10018835948.016521" }, { "accountId": 128, "tokenId": 3, "netAssetValue": "9983691072.154696", "cash": "9994219201.724392", "cashAvailable": "9994219201.724392", "netPositions": "-4199678.225782429", "maxWithdrawInUSD": "9994219201.724392" }, { "accountId": 128, "tokenId": 4, "netAssetValue": "9987378959.964485", "cash": "10009683571.174084", "cashAvailable": "10009683571.174084", "netPositions": "-15500531.314729176", "maxWithdrawInUSD": "10009683571.174084" }, { "accountId": 128, "tokenId": 5, "netAssetValue": "277588662620688.62", "cash": "277588678026812.2", "cashAvailable": "277588678026812.2", "netPositions": "-8171010.737677374", "maxWithdrawInUSD": "277588678026812.2" } ] } }

List user's maximum of borrow.

Request

Parameter Required Type Description
accountId YES integer

Response Body

Name Type Description
accountTokenPositions object[] List of token positions in the account
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ netAssetValue string Net asset value in USD of all positions related to this token in this account
└ cash string Cash value in USD of this token in this account
└ cashAvailable string Available cash value in USD of this token in this account, i.e. total cash value minus total amount of limit orders related to this token in the market
└ netPositions string Net borrow/lending position in USD, i.e. borrow position in USD minus lending position in USD
└ maxWithdrawInUSD string Maximum amount in USD of this token that can be withdrawn from this account without initiating automatic liquidation

GET /private/get_account_info

Code sample:

Copy to Clipboard
GET /private/get_account_info?accountId=128

Example response:

Copy to Clipboard
{ "success": true, "data": { "account": { "accountId": 128, "userId": 31, "type": 2, "name": "Trading", "status": 1, "healthScore": 10000.0, "asset": 2.757222438174139E14, "assetLtv": 2.2139931492951125E14, "liability": 4.8861696117990464E7, "ratesMargin": 444.856525596, "ltvType": 1, "updateDate": 1697445293000, "tokens": [ { "accountId": 128, "tokenId": 1, "quantity": "9999993308.004503191", "lockedQuantity": "0", "code": "ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "availableQuantity": "9999993308.004503191" }, { "accountId": 128, "tokenId": 2, "quantity": "10016935023.207629913", "lockedQuantity": "0", "code": "USDT", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "availableQuantity": "10016935023.207629913" }, { "accountId": 128, "tokenId": 3, "quantity": "9994343469.467071785", "lockedQuantity": "0", "code": "USDC", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "availableQuantity": "9994343469.467071785" }, { "accountId": 128, "tokenId": 4, "quantity": "10010506423.982134472", "lockedQuantity": "0", "code": "DAI", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "availableQuantity": "10010506423.982134472" }, { "accountId": 128, "tokenId": 5, "quantity": "10000000397.605564997", "lockedQuantity": "0", "code": "WBTC", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "availableQuantity": "10000000397.605564997" } ] } } }

Get account details for a given account ID.

Request

Parameter Required Type Description
accountId YES integer Account ID

Response Body

Name Type Description
account object Account object
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ userId integer Unique ID for the user, assigned by Infinity Exchange
└ type integer Account type:

1 for current account
2 for trading account
└ name string Account name

Default values are "Current" and "Trading" but these can be changed using the /private/update_account_name endpoint.
└ status integer Account status:

All active accounts have status 1
└ healthScore float The current healthscore for this account

With no liabilities, healthscores are set to 10,000; when healthscores fall below 100 liquidation is triggered
└ asset float Total amount of assets (cash plus borrow position) in the account in USD
└ assetLtv float Sum of assets times the current loan-to-value (LTV) ratios to give the total USD amount that can be borrowed (including any amount that has already been borrowed) using the current assets as collateral in a single transaction
└ liability float Total amount of liabilities (lending position) in the account in USD
└ ratesMargin float COMING SOON
└ ltvType integer Loan-to-value (LTV) ratio type:

1 for basic accounts
2 for stablecoin accounts
3 for single coin (other than stablecoin) accounts
└ updateDate integer Datetime (in UNIX time) the healthscoare and other risk metrics (asset amount, liability amount, etc) were last calculated.
└ tokens object[] List of tokens in account
 └ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
 └ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
 └ quantity string Amount of token in account in USD
 └ lockedQuantity string Amount of token in account in USD which is covering pending limit orders (and so cannot be transfered out of account)
 └ code string Token code

See Token IDs section for list of token codes
 └ tokenType integer Token type:

Currently all tokens at Infinity Exchange are designated as type 1
 └ valueType integer Value type:

1 for non-stablecoin tokens
2 for stablecoin tokens
 └ tokenValuationProtocol integer Platform the complex token comes from (if relevant):

See Token Valuation Protocols section
 └ availableQuantity string Available quantity for using as collateral for borrowing or for transfering out of the account:

Available Quantity = Quantity - Locked Quantity

GET /private/get_account_tx

Code sample:

Copy to Clipboard
GET /private/get_account_tx?accountId=128

Example response:

Copy to Clipboard
{ "success": true, "data": { "trxs": [ { "trxId": 507873974, "accountId": 128, "tokenId": 4, "type": 15, "quantity": "-0.141865", "balance": "10010502890.372428552", "createDate": 1697450286000 }, { "trxId": 507873973, "accountId": 128, "tokenId": 4, "type": 2, "quantity": "-1418.65", "balance": "10010502890.514293552", "createDate": 1697450286000 }, { "trxId": 507873970, "accountId": 128, "tokenId": 1, "type": 15, "quantity": "-0.00009848", "balance": "9999993308.350858416", "createDate": 1697450286000 }, { "trxId": 507873969, "accountId": 128, "tokenId": 1, "type": 2, "quantity": "-0.9848", "balance": "9999993308.350956896", "createDate": 1697450286000 }, { "trxId": 507873966, "accountId": 128, "tokenId": 1, "type": 15, "quantity": "-0.00008252", "balance": "9999993309.335674376", "createDate": 1697450286000 }, { "trxId": 507873965, "accountId": 128, "tokenId": 1, "type": 2, "quantity": "0.8252", "balance": "9999993309.335756896", "createDate": 1697450286000 }, { "trxId": 507873962, "accountId": 128, "tokenId": 4, "type": 15, "quantity": "-0.122945", "balance": "10010504309.041348552", "createDate": 1697450286000 }, { "trxId": 507873961, "accountId": 128, "tokenId": 4, "type": 2, "quantity": "-1229.45", "balance": "10010504309.164293552", "createDate": 1697450286000 }, { "trxId": 507873960, "accountId": 128, "tokenId": 3, "type": 1, "quantity": "1287.21", "balance": "9994341142.389407967", "createDate": 1697450286000 }, { "trxId": 507873951, "accountId": 128, "tokenId": 5, "type": 15, "quantity": "-0.00000443", "balance": "10000000397.516179475", "createDate": 1697450285000 }, { "trxId": 507873950, "accountId": 128, "tokenId": 5, "type": 2, "quantity": "-0.0443", "balance": "10000000397.516183905", "createDate": 1697450285000 }, { "trxId": 507873947, "accountId": 128, "tokenId": 4, "type": 15, "quantity": "-0.0875", "balance": "10010505538.526793552", "createDate": 1697450285000 }, { "trxId": 507873946, "accountId": 128, "tokenId": 4, "type": 2, "quantity": "-875", "balance": "10010505538.614293552", "createDate": 1697450285000 }, { "trxId": 507873943, "accountId": 128, "tokenId": 5, "type": 15, "quantity": "-0.00000156", "balance": "10000000397.560482345", "createDate": 1697450285000 }, { "trxId": 507873942, "accountId": 128, "tokenId": 5, "type": 2, "quantity": "-0.0156", "balance": "10000000397.560483905", "createDate": 1697450285000 }, { "trxId": 507873939, "accountId": 128, "tokenId": 5, "type": 15, "quantity": "-0.0000016", "balance": "10000000397.576082305", "createDate": 1697450285000 }, { "trxId": 507873938, "accountId": 128, "tokenId": 5, "type": 2, "quantity": "-0.016", "balance": "10000000397.576083905", "createDate": 1697450285000 }, { "trxId": 507873935, "accountId": 128, "tokenId": 3, "type": 15, "quantity": "-0.1331", "balance": "9994339855.046307967", "createDate": 1697450285000 }, { "trxId": 507873934, "accountId": 128, "tokenId": 3, "type": 2, "quantity": "-1331", "balance": "9994339855.179407967", "createDate": 1697450285000 }, { "trxId": 507873931, "accountId": 128, "tokenId": 4, "type": 15, "quantity": "-0.125916", "balance": "10010506413.488377552", "createDate": 1697450285000 } ] } }

Get account transactions for a given account ID.

Request

Parameter Required Type Description
accountId YES integer Account ID
type NO string Transaction type
startId NO integer Start of transaction ID
limit NO integer Max number of transactions to return

Response Body

Name Type Description
trxs object[] List of transaction objects
└ trxId integer Unique ID for the transaction, assigned by Infinity Exchange
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
└ type integer Transaction type

See Transaction Types section for full list
└ quantity string Transaction quantity
└ balance string Balance of account after transaction
└ createDate integer Transaction datetime stamp (in UNIX time)

GET /private/get_accounts

Code sample:

Copy to Clipboard
GET /private/get_accounts

Example response:

Copy to Clipboard
{ "success": true, "data": { "accounts": [ { "accountId": 127, "userId": 31, "type": 1, "name": "Current", "status": 1, "healthScore": 10000.0, "asset": 0.0, "assetLtv": 0.0, "liability": 0.0, "ratesMargin": 0.0, "ltvType": 1, "updateDate": 1672903708000, "tokens": [ { "accountId": 127, "tokenId": 1, "quantity": "0.01", "lockedQuantity": "0", "code": "ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "availableQuantity": "0.01" } ] }, { "accountId": 128, "userId": 31, "type": 2, "name": "Trading", "status": 1, "healthScore": 10000.0, "asset": 2.757222438174139E14, "assetLtv": 2.2139931492951125E14, "liability": 4.8861696117990464E7, "ratesMargin": 444.856525596, "ltvType": 1, "updateDate": 1697445293000, "tokens": [ { "accountId": 128, "tokenId": 1, "quantity": "9999993311.535880667", "lockedQuantity": "1.5628", "code": "ETH", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "availableQuantity": "9999993309.973080667" }, { "accountId": 128, "tokenId": 2, "quantity": "10016941341.885702564", "lockedQuantity": "0", "code": "USDT", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "availableQuantity": "10016941341.885702564" }, { "accountId": 128, "tokenId": 3, "quantity": "9994345832.840812932", "lockedQuantity": "2783.87", "code": "USDC", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "availableQuantity": "9994343048.970812932" }, { "accountId": 128, "tokenId": 4, "quantity": "10010508144.177409167", "lockedQuantity": "884.27", "code": "DAI", "tokenType": 1, "valueType": 2, "tokenValuationProtocol": 0, "availableQuantity": "10010507259.907409167" }, { "accountId": 128, "tokenId": 5, "quantity": "10000000397.794710327", "lockedQuantity": "0.2103", "code": "WBTC", "tokenType": 1, "valueType": 1, "tokenValuationProtocol": 0, "availableQuantity": "10000000397.584410327" } ] } ] } }

Get list of user accounts.

Request

No parameters for this endpoint.

Response Body

Name Type Description
accounts arrary of object List of account objects
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ userId integer Unique ID for the user, assigned by Infinity Exchange
└ type integer Account type:

1 for current account
2 for trading account
└ name string Account name

Default values are "Current" and "Trading" but these can be changed using the /private/update_account_name endpoint
└ status integer Account status:

All active accounts have status 1
└ healthScore float The current healthscore for this account

With no liabilities, healthscores are set to 10,000; when healthscores fall below 100 liquidation is triggered
└ asset float Total amount of assets (cash plus borrow position) in the account in USD
└ assetLtv float Sum of assets times the current loan-to-value (LTV) ratios to give the total USD amount that can be borrowed (including any amount that has already been borrowed) using the current assets as collateral in a single transaction
└ liability float Total amount of liabilities (lending position) in the account in USD
└ ratesMargin float COMING SOON
└ ltvType integer Loan-to-value (LTV) ratio type:

1 for basic accounts
2 for stablecoin accounts
3 for single coin (other than stablecoin) accounts
└ updateDate integer Datetime (in UNIX time) the healthscoare and other risk metrics (asset amount, liability amount, etc) were last calculated
└ tokens object[] List of tokens in account
 └ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
 └ tokenId integer Infinity Exchange Token ID

See Token IDs section for list of Token IDs
 └ quantity string Amount of token in account in USD
 └ lockedQuantity string Amount of token in account in USD which is covering pending limit orders (and so cannot be transfered out of account)
 └ code string Token code

See Token IDs section for list of token codes
 └ tokenType integer Token type:

Currently all tokens at Infinity Exchange are designated as type 1
 └ valueType integer Value type:

1 for non-stablecoin tokens
2 for stablecoin tokens
 └ tokenValuationProtocol integer Platform the complex token comes from (if relevant):

See Token Valuation Protocols section
 └ availableQuantity string Available quantity for using as collateral for borrowing or for transfering out of the account:

Available Quantity = Quantity - Locked Quantity

POST /private/transfer_floating_position

Code sample:

Copy to Clipboard
POST /private/transfer_floating_position?fromAccountId=128&toAccountId=127&instrumentId=ETH-SPOT&quantity=0.01

Example response:

Copy to Clipboard
{ "success": true, "data": {} }

Transfer floating rate position between accounts.

Request

Parameter Required Type Description
fromAccountId YES integer Source account ID
toAccountId YES integer Destination account ID
instrumentId YES string Instrument ID
quantity YES number Quantity

Response Body

Name Type Description

POST /private/transfer_token

Code sample:

Copy to Clipboard
POST /private/transfer_token?fromAccountId=128&toAccountId=127&tokenId=1&quantity=0.01

Example response:

Copy to Clipboard
{ "success": true, "data": {} }

Transfer token between accounts.

Request

Parameter Required Type Description
fromAccountId YES integer Source account ID
toAccountId YES integer Destination account ID
tokenId YES integer Token ID
quantity YES number Quantity

Response Body

Name Type Description

POST /private/update_account_name

Code sample:

Copy to Clipboard
POST /private/update_account_name?accountId=128&name=NewName

Example response:

Copy to Clipboard
{ "success": true, "data": { "account": { "accountId": 128, "userId": 31, "type": 2, "name": "NewName", "status": 1, "healthScore": 10000.0, "asset": 2.757222438174139E14, "assetLtv": 2.2139931492951125E14, "liability": 4.8861696117990464E7, "ratesMargin": 444.856525596, "ltvType": 1, "updateDate": 1697450536000 } } }

Update account name.

Request

Parameter Required Type Description
accountId YES integer Account ID
name YES string Account name

Response Body

Name Type Description
account object Account object
└ accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
└ userId integer Unique ID for the user, assigned by Infinity Exchange
└ type integer Account type:

1 for current account
2 for trading account
└ name string Account name

Default values are "Current" and "Trading" but these can be changed using the /private/update_account_name endpoint.
└ status integer Account status:

All active accounts have status 1
└ healthScore float The current healthscore for this account

With no liabilities, healthscores are set to 10,000; when healthscores fall below 100 liquidation is triggered
└ asset float Total amount of assets (cash plus borrow position) in the account in USD
└ assetLtv float Sum of assets times the current loan-to-value (LTV) ratios to give the total USD amount that can be borrowed (including any amount that has already been borrowed) using the current assets as collateral in a single transaction
└ liability float Total amount of liabilities (lending position) in the account in USD
└ ratesMargin float COMING SOON
└ ltvType integer Loan-to-value (LTV) ratio type:

1 for basic accounts
2 for stablecoin accounts
3 for single coin (other than stablecoin) accounts
└ updateDate integer Datetime (in UNIX time) the healthscoare and other risk metrics (asset amount, liability amount, etc) were last calculated.

Data Types

User

Name Type Description
userId integer Unique ID for the user assigned by Infinity Exchange
address string The user's ethereum wallet address
userType integer User type:

Currently all users are type 1
userClass integer User class:

1: regular
2: VIP
status integer User status:

All active users have status 1
accounts Account[] List of Infinity Exchange current & trading accounts associated with this user

Account

Name Type Description
userId integer Unique ID for the user assigned by Infinity Exchange
accountId integer Unique ID for each of the user's current & trading accounts assigned by Infinity Exchange
type integer Account type

1: current account
2: trading account
name string Name of the account

"Current"
"Trading"
cashTokenIds integer[] List of tokens currently in this account

See Token IDs section for list of Token IDs
irTokenIds integer[] List of floating positions currently in this account

See Token IDs section for list of Token IDs
status integer Account status

0: inactive
1: active
updateDate integer Update timestamp

WEBSOCKET

Environments

Environment URL
Mainnet Coming soon
Testnet wss://testnet.infinity.exchange/ws

Message

Request

Field Required Type Description
method YES string Command name
params NO string[] Topic list
id YES integer This should be a 32-bit integer which is used as a unique value by Infinity's backend servers for any websocket request. Users are free to designate a suitable value by themselves.

Response

Field Type Description
e string Event type
E integer Event timestamp
s string Instrument ID
P object Data of corresponding event type

Commands

LIST_SUBSCRIPTIONS

List out all subscriptions on the connection

Copy to Clipboard
{ "method": "LIST_SUBSCRIPTIONS", "id": 1 }

SUBSCRIBE

Subscribe to one or multiple topics

Copy to Clipboard
{ "method": "SUBSCRIBE", "params": [ "DAI-SPOT@orderBook", "USDC-2023-10-30@recentTrades" ], "id": 1 }

UNSUBSCRIBE

Unsubscribe from one or multiple topics

Copy to Clipboard
{ "method": "UNSUBSCRIBE", "params": [ "DAI-SPOT@orderBook", "USDC-2023-10-30@recentTrades" ], "id": 1 }

Topics

Format

Floating rate market: <symbol>-SPOT@<event_type>

Fixed rate market: <symbol>-<date>@<event_type>

Date is in ISO-8601 format: YYYY-MM-DD

Symbol

Name Description
ETH Wrapped ETH
USDT USDT
USDC USDC
DAI DAI
WBTC Wrapped BTC

Event types

marketInfo

Field Type Description
I string Instrument ID
p string Rate
M string Current mid rate of market (fixed rate market only)
d boolean Direction of last trade
b string Borrow price index of floating rate market (floating rate market only)
l string Lend price index of floating rate market (floating rate market only)
pd integer Last price index update date (floating rate market only)
u integer Last market update date

Floating rate market

Copy to Clipboard
{ "e": "marketInfo", "E": 1687146949369, "s": "DAI-SPOT", "m": 7, "P": { "p": "0.034", "I": "DAI-SPOT", "b": "1.0667726832592", "l": "1.0665320523207", "pd": 1686925500000, "u": 1687146949369, "d": false } }

Fixed rate market

Copy to Clipboard
{ "e": "marketInfo", "E": 1687148021474, "s": "DAI-2023-06-19", "m": 11325, "P": { "p": "0", "I": "DAI-2023-06-19", "d": true, "u": 1687148021474, "M": "0.0506" } }

orderBook

Field Type Description
a object[] Lend orders
└ p string Rate
└ q string Quantity
b object[] Borrow orders
└ p string Rate
└ q string Quantity
Copy to Clipboard
{ "e": "orderBook", "E": 1687147085183, "s": "DAI-SPOT", "m": 7, "P": { "a": [ { "p": "0.0407", "q": "9139.07" }, { "p": "0.0406", "q": "8268.8418" } ], "b": [ { "p": "0.0338", "q": "28.99" }, { "p": "0.0337", "q": "14.5" } ] } }

recentTrades

Field Type Description
s boolean Side (false = lend, true = borrow)
p string Rate
q string Quantity
d integer Transaction timestamp
Copy to Clipboard
{ "e": "recentTrades", "E": 1687147255081, "s": "DAI-SPOT", "m": 7, "P": [ { "p": "0.034", "q": "14.37", "s": false, "d": 1687147255000 }, { "p": "0.034", "q": "0.14", "s": false, "d": 1687147255000 } ] }

userOrder

Field Type Description
o integer Order ID
i string Client order ID
O integer Order type
w integer Account ID
I string Instrument ID
M integer Market type
p string Rate
q string Quantity
a string Accumulated fill size
A string Accumulated commission
c string Commission token
s boolean Side (false = lend, true = borrow)
S integer Status
d integer Create timestamp
u integer Update timestamp
Copy to Clipboard
{ "e": "userOrder", "E": 1698747139033, "s": "DAI-SPOT", "m": 7, "P": { "q": "9.25", "I": "DAI-SPOT", "a": "9.25", "i": "0c4cd530", "o": 93235944, "s": true, "w": 199, "d": 1698747139013, "O": 2, "M": 1, "S": 10 } }

userTrade

Field Type Description
t integer Trade ID
o integer Order ID
w integer Account ID
s boolean Side (false = lend, true = borrow)
p string Rate
q string Quantity
d integer Transaction timestamp
Copy to Clipboard
{ "e": "userTrade", "E": 1698747139033, "s": "DAI-SPOT", "m": 7, "P": { "q": "9.25", "p": "0.0193", "o": 93235944, "s": false, "w": 199, "d": 1698747139013, "t": 75156707 } }

LOOKUP TABLES

Error Codes

Infinity Exchange uses the following error codes:

Error code Description
1 Success
2 Permission Denied
9 Unexpected Error
1000 Pemission Denied
1001 Validation Error
1002 Operation Failed
9999 Unexpected Error
10000 Invalid Wallet (Deposit)
10001 Invalid Token (Deposit)
10010 Invalid Wallet (Withdraw)
10011 Invalid Token (Withdraw)
10012 Not Enough Funds to Withdraw
10020 Not Enough Tokens To Liquidate
10021 No Liquidation Steps Found
10022 Liquidation Swap Failed

Order API error codes table

Error code Description
102 INVALID_ACCOUNT
104 TIMEOUT
107 MINIMUM_QUANTITY_NOT_REACH
108 NO_ORDER
109 ORDER_DONE_OR_CANCELLED
110 TRADE_SERVER_PARSE
111 TRADE_SERVER_ORDER_BOOK_ERROR
112 TRADE_SERVER_DB
113 TRADE_SERVER_DB_CONNECTION
114 MARKET_EXPIRED
115 RATE_TRANSACTION_ERROR
120 QUANTITY_STEP_NOT_MATCH
121 NO_TWAP
122 INVALID_DEDUPLICATE_STRING
191 ORDER_AUTO_CANCELLED
192 ORDER_MANUALLY_CANCELLED

Orders

Order Sides

Boolean Side
0 (False) Lend
1 (True) Borrow

Order Status Codes

Status Code Status Description
0 STATUS_PENDING Pending (i.e. Not yet sent to market)
1 STATUS_ONBOOK On Book (i.e. Live order in market)
10 STATUS_DONE Done (i.e. Fully executed)
11 STATUS_MANUALLY_CANCELLED Manually cancelled
12 STATUS_AUTO_CANCELLED Auto cancelled
13 STATUS_PARTIALLY_FILLED Partially Filled
14 STATUS_EXPIRED Market expired
99 STATUS_ERROR Error

Order Types

Type Code Meaning
1 Market Order
2 Limit Order

Response Codes

Code Description
200 OK
403 Forbidden
500 Internal Server Error or Invalid Response
503 Service Unavailable

Token IDs

Code Name Token ID Quantity Step Minimum Quantity Rate Step
ETH ETH 1 0.00001 0.001 0.0001
USDT USDT 2 0.01 1 0.0001
USDC USDC 3 0.01 1 0.0001
DAI DAI 4 0.01 1 0.0001
WBTC Wrapped BTC 5 0.000001 0.0001 0.0001

Token Valuation Protocols

Code Protocol
0 No protocol / Not relevant
1 Aave
2 Uniswap
3 Compound
4 Curve

Transaction Types

Code Meaning
1 Borrow
2 Lend
3 Repay
4 Unlend
5 Interest
6 Transfer In (Between Wallets)
7 Transfer Out (Between Wallets)
8 External Transfer In
9 External Transfer Out
10 Trade
11 System Airdrop
12 LP Fee
13 Swap Secondary Token
14 Withdrawal Fee
15 Transaction Fee
16 LP Setup In
17 LP Setup Out
18 LP Unwind In
19 LP Unwind Out
20 Liquidation Unlend