RADAR RELAY V2

We’ve updated to 0x V2.See what changed.

Radar Relay Feed API

The Feed API includes REST endpoints and Websockets used to query the Radar orderbooks, retrieve order details, and view trade history and statistics. Order details include data on the status of individual orders, cancellations, and fills. Order details may also be obtained by querying a local Ethereum node or a public Ethereum service such as Infura.

API Endpoint

https://api.radarrelay.com/v0

Orders

REST endpoints for retrieving order details and validating orders

Get Order

Get order by order hash

HTTP Request

GET https://api.radarrelay.com/v0/orders/{orderHash}

Parameters

orderHash
string
(path)

Hash of signed order object

Example Request

$ curl https://api.radarrelay.com/v0/orders/{orderHash}

Response [200]

See: $RadarSignedOrder
{
  "orderHash": string;
  "type": RadarOrderType
  "state": RadarOrderState
  "baseTokenAddress": string,
  "quoteTokenAddress": string,
  "remainingBaseTokenAmount": BigNumber,
  "remainingQuoteTokenAmount": BigNumber,
  "price": BigNumber,
  "createdDate": BigNumber,
  "signedOrder": SignedOrder,
}

Response [400]

Invalid hash supplied

Response [404]

Order not found

Validate Order

Validate a RadarSignedOrder. Returns 200 OK if order is valid.

HTTP Request

GET https://api.radarrelay.com/v0/orders/{orderHash}/validate

Parameters

orderHash
string
(path)

Hash of signed order object

Example Request

$ curl https://api.radarrelay.com/v0/orders/{orderHash}/validate

Response [200]

Order valid

Response [400]

Order invalid

Response [404]

Order not found

Markets

REST endpoints for retrieving market information

List Markets

Get available markets

HTTP Request

GET https://api.radarrelay.com/v0/markets

Parameters

page
integer
(query)

Page of markets to retrieve

per_page
integer
(query)

Number of markets to retrieve per page

active
boolean
(query)

Whether to sort the markets by activity (true) or alphabetically (false)

ids
string
(query)

Market id's in the format of {base}-{quote}. e.g. ZRX-WETH, MKR-WETH

quoteTokenAddress
string
(query)

Used to filter the markets by the quote token's address

search
string
(query)

Search text used to filter the markets by token name, symbol, or display name

Example Request

$ curl https://api.radarrelay.com/v0/markets

Response [200]

See: $RadarMarket
[
  {
    "id": string,
    "baseTokenAddress": string,
    "quoteTokenAddress": string,
    "baseTokenDecimals": number,
    "quoteTokenDecimals": number,
    "quoteIncrement": BigNumber,
    "displayName": string,
    "minOrderSize": BigNumber,
    "maxOrderSize": BigNumber,
    "lastTradePrice": BigNumber,
    "spreadPercentage": BigNumber,
    "volume24Hour": BigNumber,
    "percentChange24Hour": BigNumber,
    "bestBid": BigNumber,
    "bestAsk": BigNumber,
    "numBidsWithinRange": number,
    "numAsksWithinRange": number,
    "score": number
  }
]

Response [400]

Unknown error occurred

Tokens

REST endpoints for retrieving token information

List Tokens

Get all tokens

HTTP Request

GET https://api.radarrelay.com/v0/tokens

Parameters

Example Request

$ curl https://api.radarrelay.com/v0/tokens

Response [200]

See: $RadarMarket
[
  {
    "ID": number,
    "address": string,
    "symbol": string,
    "decimals": number,
    "name": string,
    "zeroex_official": number,
    "active": boolean,
    "quote": boolean,
    "deprecated": boolean,
    "createdDate": string
  }
]

Response [400]

Unknown error occurred

Get Market

Return data for a single market

HTTP Request

GET https://api.radarrelay.com/v0/markets/{marketId}

Parameters

marketId
string
(path)

Market id in the format of {base}-{quote}. e.g. ZRX-WETH

Example Request

$ curl https://api.radarrelay.com/v0/markets/{marketId}

Response [200]

See: $RadarMarket
{
  "id": string,
  "baseTokenAddress": string,
  "quoteTokenAddress": string,
  "baseTokenDecimals": number,
  "quoteTokenDecimals": number,
  "quoteIncrement": BigNumber,
  "displayName": string,
  "minOrderSize": BigNumber,
  "maxOrderSize": BigNumber,
  "lastTradePrice": BigNumber,
  "spreadPercentage": BigNumber,
  "volume24Hour": BigNumber,
  "percentChange24Hour": BigNumber,
  "bestBid": BigNumber,
  "bestAsk": BigNumber,
  "numBidsWithinRange": number,
  "numAsksWithinRange": number,
  "score": number
}

Response [400]

Error message

Response [404]

Market not found

Get Market Ticker

Return ticker data for a single market

HTTP Request

GET https://api.radarrelay.com/v0/markets/{marketId}/ticker

Parameters

marketId
string
(path)

Market id in the format of {base}-{quote}. e.g. ZRX-WETH

Example Request

$ curl https://api.radarrelay.com/v0/markets/{marketId}/ticker

Response [200]

See: $RadarTicker
{
  "transactionHash": string, // last trade tx hash
  "price": BigNumber, // last trade price
  "size": BigNumber, // last trade size (in quote)
  "bid": BigNumber, // best bid
  "ask": BigNumber, // best ask
  "volume": BigNumber, // 24hr volume of market in quote
  "timestamp": BigNumber // last trade time in unix time (seconds)
}

Response [400]

Error message

Response [404]

Market not found

List Market Fills

Return a paginated list of market fills sorted by fill date.

HTTP Request

GET https://api.radarrelay.com/v0/markets/{marketId}/fills

Parameters

marketId
string
(path)

Market id in the format of {base}-{quote}. e.g. ZRX-WETH

page
integer
(query)

Page of fills to retrieve

per_page
integer
(query)

Number of fills to retrieve per page

Example Request

$ curl https://api.radarrelay.com/v0/markets/{marketId}/fills

Response [200]

See: $RadarFill
[
  {
    "transactionHash": string, // last trade tx hash
    "price": BigNumber, // last trade price
    "size": BigNumber, // last trade size (in quote)
    "bid": BigNumber, // best bid
    "ask": BigNumber, // best ask
    "volume": BigNumber, // 24hr volume of market in quote
    "timestamp": BigNumber // last trade time in unix time (seconds)
  }
]

Response [400]

Error message

Response [404]

Market not found

List Market Candles

Return a list of market candles.

HTTP Request

GET https://api.radarrelay.com/v0/markets/{marketId}/candles

Parameters

marketId
string
(path)

Market id in the format of {base}-{quote}. e.g. ZRX-WETH

Example Request

$ curl https://api.radarrelay.com/v0/markets/{marketId}/candles

Response [200]

See: $RadarCandle
[
  {
    "startBlock": number,
    "startBlockTimestamp": number,
    "endBlock": number, // the last block included in this candle (inclusive)
    "endBlockTimestamp": number,
    "baseTokenAddress": string,
    "baseTokenVolume": BigNumber,
    "quoteTokenAddress": string,
    "quoteTokenVolume": BigNumber,
    "open": BigNumber,
    "high": BigNumber,
    "low": BigNumber,
    "close": BigNumber
  }
]

Response [400]

Error message

Response [404]

Market not found

Get Market Book

Return a book containing bids / asks for a market.

HTTP Request

GET https://api.radarrelay.com/v0/markets/{marketId}/book

Parameters

marketId
string
(path)

Market id in the format of {base}-{quote}. e.g. ZRX-WETH

Example Request

$ curl https://api.radarrelay.com/v0/markets/{marketId}/book

Response [200]

See: $RadarBook
{
  "baseTokenAddress": string,
  "quoteTokenAddress": string,
  "bids": RadarSignedOrder[],
  "asks": RadarSignedOrder[]
}

Response [400]

Error message

Response [404]

Market not found

Websocket

Websocket endpoints

Websocket Subscription

Subscribe to a WebsocketEvent by sending a RadarSubscribeRequest

Endpoint

wss://ws.radarrelay.com/ws

Parameters

Example Request

// once connected, send the following request to subscribe:
{
  "type": WebsocketRequestType.SUBSCRIBE,
  "topic": WebsocketRequestTopic,
  "market": string, // e.g. 'ZRX-WETH'
  "requestId?": number // optional requestId
}

Response

See: $WebsocketEvent
Response acknowledgement
{
  "type": WebsocketRequestType.SUBSCRIBE,
  "requestId?": number // requestId from originating request
}
On event
{
  "action": WebsocketAction,
  "event": RadarFill | RadarNewOrder | RadarCancelOrder | RadarRemoveOrder,
  "requestId?": number // requestId from originating request
}

Websocket Unsubscription

Unsubscribe to a WebsocketEvent by sending a RadarUnsubscribeRequest

Endpoint

wss://ws.radarrelay.com/ws

Parameters

Example Request

// once connected, send the following request to unsubscribe:
{
  "type": WebsocketRequestType.UNSUBSCRIBE,
  "topic": WebsocketRequestTopic,
  "market": string, // e.g. 'ZRX-WETH'
  "requestId?": number // optional requestId
}

Response

See: $WebsocketEvent
Response acknowledgement
{
  "type": WebsocketRequestType.UNSUBSCRIBE,
  "requestId?": number // requestId from originating request
}