GuidesRecipesAPI ReferenceChangelog
Guides

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": "your_quote_guid"
}
{
  "guid": "your_trade_guid",
  "customer_guid": "your_customer_guid",
  "quote_guid": "your_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 expiration

The 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": "your_trade_guid",
  "customer_guid": "your_customer_guid",
  "quote_guid": "your_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

StateDescription
storingTrade details are being stored
initiatingTrade execution has begun
settlingPlatform is waiting for the trade to settle
completedTrade successfully completed
failedTrade could not be completed