Trade API

The Trade API is a series of REST endpoints used for interactions that may involve messages and transactions that have been signed with your Ethereum private key. You will need a local Ethereum wallet to manage these interactions, and the wallet must have a connection to the Ethereum network in order to submit transactions.

Rate limit is 2 requests/second per IP address.

No central matching engine on open order book relayers

Be aware that Radar Relay does not have a central matching engine. Orders that cross the spread will not automatically be matched with orders currently on the order book. This will make the spread negative and provide an arbitrage opportunity for other users.

Orders

post
Submit Order

https://api.radarrelay.com/v2/orders
Submit a SignedOrder to place it on the books
Request
Response
Path Parameters
SignedOrder
required
string
0x SignedOrder Object
201: Created
Order created
400: Bad Request
Invalid input

Example Request:

$ curl https://api.radarrelay.com/v2/orders \
-H "Content-Type: application/json" \
-X POST \
-d \
'{
"exchangeAddress": "0xffffffffffffffffffffffffffffffffffffffff",
"expirationTimeSeconds": "1527115521",
"senderAddress": "0xffffffffffffffffffffffffffffffffffffffff",
"makerFee": "0",
"makerAddress": "0xffffffffffffffffffffffffffffffffffffffff",
"makerAssetAmount": "20000000000000000",
"takerFee": "0",
"takerAddress": "0xffffffffffffffffffffffffffffffffffffffff",
"takerAssetAmount": "1000000000000000000",
"salt": "1537458889693", // Current timestamp in milliseconds
"feeRecipientAddress": "0x0000000000000000000000000000000000000000",
"signature": "0x396a20a0589a7b9189f0d90ad377d7fd32d25d380402dc85954c227391fcc1c1"
}'

For the 0x v2 contract, the following fields must be BigNumbers:

  • makerFee

  • takerFee

  • makerAssetAmount

  • takerAssetAmount

  • salt

  • expirationTimeSeconds

Markets

post
Limit Order Request

https:/api.radarrelay.com/v2/markets/{marketId/order/limit
Submit a limit order request to receive an UnsignedOrder. The Unsigned order will contain parameters that need to be changed, then signed before being posted to the /orders endpoint
Request
Response
Path Parameters
marketID
required
string
Market id in the format of {base}-{quote}. e.g. ZRX-WETH
Body Parameters
#RadarLimitOrder
required
string
RadarLimitOrderRequest object
200: OK
{
"senderAddress": string,
"makerAddress": "SET",
"takerAddress": string,
"makerFee": BigNumber,
"takerFee": BigNumber,
"makerAssetAmount": BigNumber,
"takerAssetAmount": BigNumber,
"makerAssetData": string,
"takerAssetData": string,
"salt": BigNumber, // Current timestamp in milliseconds
"exchangeAddress": string,
"feeRecipientAddress": string,
"expirationTimeSeconds": BigNumber,
"signature": "SET"
}
400: Bad Request
Error occurred
404: Not Found
Market not found

Example Request:

$ curl https://api.radarrelay.com/v2/markets/{marketId}/order/limit \
-H "Content-Type: application/json" \
-X POST \
-d \
'{
"type": UserOrderType,
"quantity": BigNumber,
"price": BigNumber,
"expiration": BigNumber
}'

post
Market Order Request

https://api.radarrelay.com/v2/markets/{marketId}/order/market
Submit a market order request to receive a list of orders required to fulfill a market order.
Request
Response
Path Parameters
marketId
required
string
Market id in the form of {base}-{quote}. e.g. ZRX-WETH
Body Parameters
#RadarMarketOrder
required
string
RadarMarketOrderRequest object
200: OK
See: $RadarMarketOrderResponse
{
"averagePrice": BigNumber,
"bestPrice": BigNumber,
"worstPrice": BigNumber,
"spread": BigNumber,
"orders": SignedOrder[]
}
400: Bad Request
Error occurred
404: Not Found
Market not found

Example Request:

$ curl https://api.radarrelay.com/v2/markets/{marketId}/order/market \
-H "Content-Type: application/json" \
-X POST \
-d \
'{
"type": UserOrderType,
"quantity": BigNumber
}'

Accounts

REST endpoints for retrieving account information.

get
List Account Fills

https://api.radarrelay.com/v2/accounts/{accountAddress}/fills
Return a list of account fills
Request
Response
Path Parameters
accountAddress
required
string
Account address (ethereum address).
200: OK
See: $RadarFill
[
{
"baseTokenAddress": string,
"quoteTokenAddress": string,
"transactionHash": string,
"type": UserOrderType,
"blockNumber": number,
"makerAddress": string,
"takerAddress": string,
"feeRecipientAddress": string,
"makerFeePaid": BigNumber,
"takerFeePaid": BigNumber,
"filledBaseTokenAmount": BigNumber,
"filledQuoteTokenAmount": BigNumber,
"orderHash": string,
"timestamp": number,
"outlier": boolean
}
]
400: Bad Request
Unknown error occurred
404: Not Found
Account not found

get
List Account Orders

https://api.radarrelay.com/v2/accounts/{accountAddress}/orders
Get a list of account orders
Request
Response
Path Parameters
accountAddress
required
string
Account address (ethereum address).
200: OK
See: $RadarSignedOrder
[
{
"orderHash": string,
"type": RadarOrderType,
"state": RadarOrderState,
"baseTokenAddress": string,
"quoteTokenAddress": string,
"remainingBaseTokenAmount": BigNumber,
"remainingQuoteTokenAmount": BigNumber,
"price": BigNumber,
"createdDate": BigNumber,
"signedOrder": SignedOrder,
}
]
400: Bad Request
Unknown error occurred
404: Not Found
Account not found