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/v2

Orders

REST endpoints for retrieving order details and validating orders

Get Order

Get order by order hash.

HTTP Request

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

Parameters

orderHash
string
(path)

Hash of signed order object.

Example Request

$ curl https://api.radarrelay.com/v2/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/v2/orders/{orderHash}/validate

Parameters

orderHash
string
(path)

Hash of signed order object.

Example Request

$ curl https://api.radarrelay.com/v2/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 all available markets.

HTTP Request

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

Parameters

ids
string
(query)

Comma-separated list of market ids in the format of {base}-{quote}. e.g. ZRX-WETH,DAI-WETH

sort
string
(query)

Whether to sort the markets by activity ('active') or alphabetically ('name').

type
string
(query)

Filter results by market type. Currently, the only valid options is 'SHORT', though additional market types may be added in the future.

include
string
(query)

Comma-separated list specifying which parts of the RadarMarket schema to include in the response. Valid options include 'base', 'ticker', 'stats', and 'history'. e.g. "base,ticker,stats,history"

quoteTokenAddress
string
(query)

Returns results for the specified quote token address.

search
string
(query)

A search term to filter results by market name or base token name.

page
integer
(query)

Page of markets to retrieve.

perPage
integer
(query)

Number of markets to retrieve per page.

Example Request

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

Response [200]

See: $RadarMarket
[
  {
    "id": string,
    "ticker": RadarTicker,
    "stats": RadarStats,
    "history": RadarHistory
  }
]

Response [400]

Unknown error occurred

Tokens

REST endpoints for retrieving token information

List Tokens

Get all tokens.

HTTP Request

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

Parameters

Example Request

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

Response [200]

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

Response [400]

Unknown error occurred

Get Market

Return data for a single market.

HTTP Request

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

Parameters

marketId
string
(path)

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

include
string
(query)

Comma-separated list specifying which parts of the RadarMarket schema to include in the response. Valid options include 'base', 'ticker', 'stats', and 'history'. e.g. "base,ticker,stats,history"

Example Request

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

Response [200]

See: $RadarMarket
{
  "id": string,
  "ticker": RadarTicker,
  "stats": RadarStats,
  "history": RadarHistory
}

Response [400]

Unknown error occurred

Response [404]

Market not found

Get Market Ticker

Return ticker data for a single market.

HTTP Request

GET https://api.radarrelay.com/v2/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/v2/markets/{marketId}/ticker

Response [200]

See: $RadarTicker
{
  "transactionHash": string,
  "price": BigNumber,
  "size": BigNumber,
  "timestamp": BigNumber, // unix
  "bestBid": BigNumber,
  "bestAsk": BigNumber,
  "spreadPercentage": BigNumber
}

Response [400]

Unknown error occurred

Response [404]

Market not found

Get Market Stats

Get the stats for the specified market.

HTTP Request

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

Parameters

marketId
string
(path)

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

Example Request

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

Response [200]

See: $RadarStats
{
  "numBidsWithinRange": number,
  "numAsksWithinRange": number,
  "baseTokenAvailable": BigNumber,
  "quoteTokenAvailable": BigNumber,
  "volume24Hour": BigNumber,
  "percentChange24Hour": BigNumber
}

Response [400]

Unknown error occurred

Response [404]

Market not found

Get Market History

Get the history for the specified market.

HTTP Request

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

Parameters

marketId
string
(path)

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

Example Request

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

Response [200]

See: $RadarHistory
{
  "price24Hour": BigNumber[]
}

Response [400]

Unknown error occurred

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/v2/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.

perPage
integer
(query)

Number of fills to retrieve per page.

Example Request

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

Response [200]

See: $RadarFill
[
  {
    "transactionHash": string,
    "type": UserOrderType,
    "blockNumber": number,
    "makerAddress": string,
    "takerAddress": string,
    "baseTokenAddress": string;
    "quoteTokenAddress": string;
    "feeRecipientAddress": string;
    "makerFeePaid": BigNumber,
    "takerFeePaid": BigNumber,
    "filledBaseTokenAmount": BigNumber,
    "filledQuoteTokenAmount": BigNumber,
    "orderHash": string,
    "timestamp": number,
    "outlier": boolean
  }
]

Response [400]

Unknown error occurred

Response [404]

Market not found

List Market Candles

Return a list of market candles.

HTTP Request

GET https://api.radarrelay.com/v2/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/v2/markets/{marketId}/candles

Response [200]

See: $RadarCandle
[
  {
    "open": BigNumber,
    "high": BigNumber,
    "low": BigNumber,
    "close": BigNumber,
    "startBlock": number,
    "startBlockTimestamp": number,
    "endBlock": number,
    "endBlockTimestamp": number,
    "baseTokenVolume": BigNumber,
    "quoteTokenVolume": BigNumber
  }
]

Response [400]

Unknown error occurred

Response [404]

Market not found

Get Market Book

Return a book containing bids / asks for a market.

HTTP Request

GET https://api.radarrelay.com/v2/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/v2/markets/{marketId}/book

Response [200]

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

Response [400]

Unknown error occurred

Response [404]

Market not found

Websocket

Websocket endpoints

Websocket Subscription

Subscribe to a WebsocketEvent by sending a RadarSubscribeRequest.

Endpoint

wss://ws.radarrelay.com/v2

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
}

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/v2

Parameters

Example Request

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

Response

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