Execute Trades
Execute a trade against a quote using the Cybrid API.
Execute a trade
After generating a quote, execute a trade via POST /api/trades.
The only required field is the quote GUID:
{
"quote_guid": "quote_guid"
}{
"guid": "trade_guid",
"customer_guid": "customer_guid",
"quote_guid": "quote_guid",
"symbol": "BTC-USD",
"side": "buy",
"state": "storing",
"receive_amount": 10000000,
"deliver_amount": 293063,
"fee": 0,
"created_at": "2022-05-11T19:56:42.856Z"
}
Quote expirationThe quote must be less than 30 seconds old. Expired quotes cannot be traded.
Check trade status
Poll GET /api/trades/{trade_guid} to verify the trade completed:
{
"guid": "trade_guid",
"customer_guid": "customer_guid",
"quote_guid": "quote_guid",
"symbol": "BTC-USD",
"side": "buy",
"state": "completed",
"receive_amount": 10000000,
"deliver_amount": 293063,
"fee": 0,
"created_at": "2022-05-11T19:56:42.856Z"
}Trade states
| State | Description |
|---|---|
storing | Trade details are being stored |
pending | Trade details are stored and being processed |
executed | Trade has been processed and is awaiting settlement |
settling | Platform is waiting for the trade to settle |
cancelled | Trade was cancelled |
completed | Trade successfully completed |
failed | Trade could not be completed |
Trade failuresTrades may fail for several reasons, including price movement of the asset between quote generation and trade execution. If the market price moves outside the allowed spread or tolerance, the trade may be rejected as
failed. In some cases, adjusting the BPS (basis points, i.e., the fee or spread) can help a trade succeed by increasing the tolerance for price movement. Contact support if you need to temporarily adjust BPS to facilitate a trade.
Updated about 1 month ago
