Balance-Checked Market Buy
A 4-step recipe with Backpack. We can help you get access.
Recipe · 4 steps
Balance-Checked Market Buy
with Backpack
Check balances, quote a market, place a market buy, and confirm the fill.
- Read account balances so the caller can confirm there is available quote asset before placing the buy.
- Read the ticker to anchor the buy against the current last traded price.
- Submit a market buy that spends the supplied quote-asset amount on the requested symbol.
- Read recent account fills for the symbol to confirm the market buy was executed.
What you'll need to have ready
- symbol: The market symbol to buy (e.g. SOL_USDC).
- quoteQuantity: The amount of the quote asset to spend on the market buy, as a decimal string.
- apiKey: Base64 encoded ED25519 verifying key for the X-API-KEY header.
- signature: Base64 encoded ED25519 signature for the X-SIGNATURE header.
- timestamp: Unix time in milliseconds for the X-TIMESTAMP header.
- window: Request validity window in milliseconds for the X-WINDOW header (default 5000).
For your developer
Arazzo workflow backpack:balance-checked-market-buy, 4 operations: get_balances → get_ticker → execute_order → get_fills. Specs on APIs.io.