Skip to main content

API Documentation

Get Markets

Retrieves a list of markets on a specific chain.

Request:

  • Method: GET
  • Path: /:chain/markets

Parameters

NameTypeDescription
chainstringThe ID of the chain.

Example Request:

GET /:chain/markets

Response

Returns an object with an array of market objects.

FieldTypeDescription
marketsMarketDto[]An array of market objects representing the available markets.

Each market object has the following fields:

FieldTypeDescription
addressstringThe address of the market.
namestringThe name of the market.
priceBookStrategy'arithmetic' or 'geometric'The strategy used for the price book.
priceBookAstringThe value of price book A.
priceBookDstring or nullThe value of price book D, or null if not applicable.
priceBookRstring or nullThe value of price book R, or null if not applicable.
baseTokenTokenDtoThe details of the base token used in the market.
quoteTokenTokenDtoThe details of the quote token used in the market.
orderCancelerstringThe address of the order canceler for the market.
unitSizestringThe unit size for the market.
askPrice or nullThe ask price for the market, or null if not available.
bidPrice or nullThe bid price for the market, or null if not available.
lastPrice or nullThe last traded price for the market, or null if not available.
high24hPrice or nullThe highest price in the last 24 hours, or null if not available.
low24hPrice or nullThe lowest price in the last 24 hours, or null if not available.
change1hnumber or nullThe price change in the last 1 hour, or null if not available.
change24hnumber or nullThe price change in the last 24 hours, or null if not available.
quoteVolume24hnumberThe trading volume in the quote token in the last 24 hours.
volumeUsd24hnumberThe trading volume in USD in the last 24 hours.
accumulatedVolumeUsdnumberThe accumulated trading volume in USD.
makerFeenumberThe maker fee percentage for the market.
takerFeenumberThe taker fee percentage for the market.
verifiedbooleanIndicates whether the market is verified or not.

Example Response:

{
"markets": [
{
"address": "0x1c230Df6364af81d1585C3B3e6aC5aaD2daD9bD9",
"name": "DAI/USDC",
"priceBookStrategy": "arithmetic",
"priceBookA": "100000000000000",
"priceBookD": "100000000000000",
"priceBookR": null,
"baseToken": {
"name": "Dai Stablecoin",
"website": "http://www.makerdao.com/",
"description": "MakerDAO is an open-source project on the Ethereum blockchain and a Decentralized Autonomous Organization1 created in 2014. The project is managed by people around the world who hold its governance token, MKR. Through a system of scientific governance involving Executive Voting and Governance Polling, MKR holders manage the Maker Protocol and the financial risks of Dai to ensure its stability, transparency, and efficiency. MKR voting weight is proportional to the amount of MKR a voter stakes in the voting contract, DSChief. In other words, the more MKR tokens locked in the contract, the greater the voter’s decision-making power.",
"explorer": "https://etherscan.io/token/0x6B175474E89094C44Da98b954EedeAC495271d0F",
"type": null,
"symbol": "DAI",
"logo": "https://storage.googleapis.com/clober-tokens/dai.png",
"decimals": 18,
"status": null,
"address": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"tags": [
],
"links": [
],
"isWrappedNative": false
},
"quoteToken": {
"name": "USD Coin",
"website": "https://www.centre.io/",
"description": "Token Introduction: USD Coin (USDC) is a stablecoin fully backed by the US dollar and developed by the Centre consortium. Centre issues and redeems USDC without any extra fee and is licensed as a money-transmitter in the US and as an e-money institution in Europe. USDC can always be redeemed 1:1 to US dollars. Funds (for collateral) are held in segregated bank accounts, that are monitored and audited by third-parties. USD Coin has become one of the largest stablecoins (with a supply approaching a billion), its support has been extended to multiple decentralized applications (e.g., DeFi) and a wide variety of exchanges (e.g., Coinbase, Binance, Kraken).",
"explorer": "https://etherscan.io/token/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"type": null,
"symbol": "USDC",
"logo": "https://storage.googleapis.com/clober-tokens/usdc.png",
"decimals": 6,
"status": null,
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"tags": [
],
"links": [
],
"isWrappedNative": false
},
"orderCanceler": "0x99228D1823baFa822dAB2B2f0a02922082f25E9E",
"unitSize": "1",
"makerFee": -0.001,
"takerFee": 0.009,
"ask": null,
"bid": {
"index": 10000,
"value": "1.000100000000000000"
},
"last": {
"index": 10001,
"value": "1.000200000000000000"
},
"high24h": null,
"low24h": null,
"change1h": 0,
"change24h": 0,
"quoteVolume24h": 0,
"volumeUsd24h": 0,
"accumulatedVolumeUsd": 0.399902,
"verified": true
}
]
}

Market Order Book

Retrieves the order book for a specific market on a given chain.

Request:

  • Method: GET
  • Path: /:chain/markets/:market/order-book

Parameters

NameTypeDescription
chainstringThe ID of the chain.
marketstringThe address of the market.

Example Request:

GET /:chain/markets/:market/order-book

Response

Returns an object with the order book for the specified market.

FieldTypeDescription
asksOrderBookElement[]An array of order book elements representing the asks.
bidsOrderBookElement[]An array of order book elements representing the bids.

Each order book element has the following fields:

FieldTypeDescription
priceIndexnumberThe index of the price in the order book.
pricestringThe price of the order.
rawAmountstringThe raw amount of the order.
baseAmountstringThe base amount of the order.

Example Response:

{
"bids":[
{
"priceIndex":9994,
"price":"0.999500000000000000",
"rawAmount":"27214172539",
"baseAmount":"27227.78643221610805402701"
},
{
"priceIndex":9991,
"price":"0.999200000000000000",
"rawAmount":"52750000000",
"baseAmount":"52792.23378702962369895917"
}
],
"asks":[
{
"priceIndex":10004,
"price":"1.000500000000000000",
"rawAmount":"6524965311",
"baseAmount":"6521.70445877061469265367"
},
{
"priceIndex":10007,
"price":"1.000800000000000000",
"rawAmount":"26020800000",
"baseAmount":"26000"
}
]
}