RFQ and order APIs
There are two methods to execute a trade using Anchorage's Standard APIs. (1) The request for quote (RFQ) process provides a market price given a trading pair and size and allows the user to accept the quote before it expires in order to execute a trade. (2) A user can submit a market or limit order which requires the order to be filled if the relevant conditions are met in order for a trade to execute.
Request and accept a quote
The Request quote end point provides a market price for a given trading pair, side of the trade, and amount. The RFQ will provide the asset type and quantity along with the details of the quote requested, a quoteID, and a valid window which is usually around 3 seconds. Anchorage does not maintain a history of offered quotes.
RFQs can be placed for BUY, SELL, and TWOWAY trades. TWOWAY trades allow the user to buy one asset and sell another through a single trade.
To accept the quote, the user must accept the quote by providing the quoteID, side of the trade, the trading account, and the idempotentId (if included in the RFQ) within the 3 second offer window. Once accepted the trade is immediately executed.
Avoid duplicate trades with idempotentId
The RFQ request does not require idempotentId. However, we strongly recommend using one as it helps prevent duplicating trades.
RFQ and accept quotes end points include the optional field idempotentId. The purpose of this field is to avoid unintentionally conducting multiple trades through duplicate requests. The Field is strongly encouraged for users hitting RFQ and Accept Quote end points frequently.
Using idempotentId is fairly straight forward. When a user includes a unique ID in a request for quote, Anchorage will not allow the user to accept that quote without the same idempotentId in the accept quote request. If you submit an execute trades using prior idempotentId, it will give you trade info from that trade.
Allowed slippage
When accepting a quote, please consider the allowedSlippage parameter. This is the maximum slippage Anchorage Digital will consider when accepting an order, communicated in terms of actual value (i.e. "0.001" => 10bps). This must be greater than or equal to 0 and less than or equal to 0.002 (20bps). If the slippage on a trade exceeds 20 bps it will be rejected and fail. Commission (trading bps) is included in the price of the quote, but is not tied to or dependent on the slippage of the trade.
An example:
- Consider a quote priced at $10,000 with an
allowedSlippageof "0.0008" (8bps) upon accepting. If the market moves against the quoted price, one of the following two scenarios will be applicable:- When there is price volatility and the market moves against the originally quoted price—but the market price is still within the quoted price and the
allowedSlippagethe order will be filled and the quote will show a status ofEXECUTEDas long as the price is $10,007 or better. - When the market price exceeds the quoted price and the
allowedSlippage, the order status will returnREJECTED.
- When there is price volatility and the market moves against the originally quoted price—but the market price is still within the quoted price and the
Trade confirmation
Trade summary details are returned immediately for RFQ quotes, however, there may be a short delay between when a quote is accepted via API and when Anchorage Digital can return the completed price and fee information. The actual amount of the trade will never work against the client and will only work in the client’s favor, if it changes at all.
This is because Anchorage Digital works with an order management system (OMS) to get superior price execution to clients across major market makers and exchanges. This OMS has to synchronize many different exchange update methods (API, Webhooks, etc.) that all update on differing time frames, and thus may create a slight delay between the time a quote is accepted and when it actually returns the complete trade details.
Place an order
The place an order end points is applicable for users with separate ledgers (e.g., RIAs). RIAs should refer to the dedicated RIA integration documentation for more detail on integrations and trading.
Users can place specific orders through our REST API and our Websocket.
Rest API
The place an order endpoint supports limit fill or kill (FoK) orders are supported meaning that if the conditions of the trade cannot be met immediately then the order is cancelled and no trade occurs.
Limit price
When Placing an order the user should include a limit price to account for the market movement between the order placement and the trade execution. The limit price protects the trader to ensure they are comfortable with the price and helps Anchorage ensure that sufficient funds are allocated to complete the trade.
WebSocket API
WebSockets uses a bidirectional protocol that encodes all messages as JSON objects. This allows users to receive messages from Anchorage with real time market data. Once a user has authenticated their subscription to the Websocket they can use the NewOrderSingle message to submit an order and receive execution reports over the same websocket session. Currently MARKET and LIMIT order types are supported.
Refer to our Getting Started Websocket API Guide for a more detailed walk-through.
Updated 9 months ago