Common objects

HTTP and WS API operates with almost identical objects.

Trade

Property
Type
Description

tradeId

string

the unique trade identifier

direction

values "buy" or "sell"

identifies trade direction

price

string represents BigInt

price per token in the order

size

string represents BigInt

token quantity filled by trade

timestamp

number

block timestamp when the trade was concluded

txnHash

string

transaction in which the trade was concluded

Order

Property
Type
Description

orderId

string

the order identifier

type

"limit" or "market"

"market" orders execute when placed

owner

string

a user placed the order

side

"bid" or "ask"

buy or sell order direction

price

string represents BigInt

price per token in the order

size

string represents BigInt

token quantity that's not filled

origSize

string represents BigInt

order token quantity placed by user

claimed

string represents BigInt

number of tokens in the order sent to the user by calling claimOrder

createdAt

number represents a timestamp

when the order was created

lastTouched

number represents a timestamp

when the order was updated

txnHash

string

transaction hash in which the order was created

status

one of "open", "filled", "claimed" or "cancel"

represents order lifecycle status

fee

string represents BigInt

fee for market execution

market

object containing a field id

a market identifier where the order was placed

Orderbook Level

Property
Type
Description

price

string represents BigInt

token price, level identifier

size

string represents BigInt

sum of sizes in orders corresponding to the requested aggregation

lastTouched

number represents a timestamp

when the level was updated

Order Fill

Property
Type
Description

id

string

the order fill identifier

orderId

string

the order that was filled

tradeId

string

trade identifier when a part of the order is filled

type

"limit" or "market"

an order type

owner

string

a user placed the order

side

"bid" or "ask"

an order side

price

string represents BigInt

price per token in the order

size

string represents BigInt

token quantity that was filled in the trade

txnHash

string

transaction hash in which the order was filled

market

object containing a field id

a market identifier where the order was placed

Candle

Property
Type
Description

market

object containing field id

a market identifier to which the candle is related

resolution

one of "15", "60", "240" or "1D"

represents a candle time interval

time

number represents a timestamp

with the resolution makes up a candle identifier

open

string

an open price

high

string

a high price

low

string

a low price

close

string

a close price

volume

string

a sum of trade sizes

lastTouched

number represents timestamp

when the candle was updated

Market

Property
Type
Description

id

string

the market identifier

name

string

the name of a market

symbol

string

the market short name

baseToken

the. X token of the market pair

quoteToken

the. Y token of the market pair

orderbookAddress

string

a market contract address

aggregations

array of numbers

market aggregation types

coinMarketCapId

string

lowPrice24h

string

a lowest day price

highPrice24h

string

a highest day price

lastPrice

string

a last trade price

price24h

string

the price one day ago

bestAsk

string

the lowest ask price in an order book

bestBid

string

the highest bid price in an order book

tradingVolume24h

string

the sum of trade sizes from the last day

supportsNativeToken

boolean

indicates if one of the tokens is native

isNativeTokenX

boolean

indicates which token is native

tokenXScalingFactor

number

scaling applied to the base token in contract API

tokenYScalingFactor

number

scaling applied to the quote token in contract API

priceScalingFactor

number

scaling applied to the price in contract API

totalSupply

string

total supply data from CoinMarketCap

lastTouched

timestamp

when the market object was updated

aggressiveFee

string

the fee rate for market orders

passiveFee

string

the fee rate for limit orders

passiveOrderPayout

string

the payout rate for limit orders

Token

Property
Type
Description

id

string

the token identifier

name

string

the name of a token

symbol

string

the token short name

contractAddress

string

a token ledger address

decimals

number

a decimals parameter in token contract

roundingDecimals

number

the precision of the displayed token amount

supportsPermit

boolean

indicates whether the token supports permit approval

Contract-to-human scaling transformation

As mentioned in Contract API section all token amounts and prices are scaled by corresponding scaling factors It performs in this manner. The market API object has fields tokenXScalingFactor. tokenYScalingFactor, priceScalingFactor. If we want to calculate the human-readable value of the price, we should divide it by 10 raised to the power of the negative price scaling factor.

E.g., the price value 6780 for the SUSDC market with a priceScalingFactor of 4 is the 0.678 human-readable price.

The same transformation says that a size of 1,234,567 for the SUSDC market with a priceScalingFactor of 3 is actually 1,234.567 S.

Last updated