HTTP API

All endpoints use HTTP GET requests with several URL parameters. All responses are encoded in JSON format.

Content

/trades

Fetch market trades from recent to oldest.

Request parameters

Parameter
Required?
Description

market

required

a market contract address

limit

optional

max number of trades , default is 100

Response

An array of trade objects.

/orders

Fetch user orders.

Request parameters

Parameter
Required?
Description

market

required

a market contract address

user

required

a user address

limit

optional

max number of orders , default is 100

Response

An array of order objects.

/orderbook

Fetch the current state of the market order book.

Request parameters

Parameter
Required?
Description

market

required

a market contract address

aggregation

optional

one of market aggregation, if not set max, aggregation is used

limit

optional

max number of levels in asks and bids , default is 100

Response

Object with fields:

Property
Type
Description

timestamp

number represents timestamp

the update time

levels

object with fields"asks" and "bids"

Each field is a sorted array of order book level objects; asks are sorted in ascending order by price, and bids are sorted in descending order.

/fills

Get executed parts of user orders.

Request parameters

Parameter
Required?
Description

market

required

a market contract address

user

required

a user address

limit

optional

max number of objects in response, default is 100

Response

An array of order fill objects descending by a timestamp field.

/candles

Get executed parts of user orders.

Request parameters

Parameter
Required?
Description

market

required

a market contract address

resolution

required

one of candle object resolution

fromTime

optional

a lower bound of candle time

toTime

optional

an upper limit of candle time

Response

An array of candle objects ascending by a time field.

/markets

Request parameters

Parameter
Required?
Description

market

optional

a market contract address

Response

An array of market objects.

/user-balances

Request parameters

Parameter
Required?
Description

user

required

a user address

Response

An object with a key "balances" and a value that is an array of objects:

Property
Type
Description

token

string

a token symbol

tokenAddress

string

a token address

hold

number

amount of tokens locked in orders

total

number

amount of hold tokens plus a deposit in market contract

Last updated