Skip to navigation

Overview

Provider prices for conversions between AUSD and other stablecoins.

A quote is one provider’s price for a conversion between AUSD and another stablecoin on one chain, plus the onchain steps to execute it. It expires 180 seconds after it’s priced, and its transactionId tracks the conversion once the deposit lands.

  • POST /v0/quotes returns quotes, one per provider that can fill the request.
  • GET /v0/quotes/{quoteId} returns a stored quote, unchanged since creation.

Requesting a quote

sender and receiver are each { kind: "wallet", address, chain, currency }. Send exactly one of senderAmount or receiverAmount; the other side comes back computed on the quote. One side must be AUSD, and both sides must be on the same chain. See Support for what each chain offers.

Executing a quote

executionSteps lists, in order, the transactions the sender submits. sender.address must be the submitting account: it’s the from on every step.

Each step carries a ready-to-send transaction (from, to, data, value). Send the steps one at a time with eth_sendTransaction, or batch erc20Approve and the deposit into one sponsored UserOperation. Both paths settle the same way, because the provider attributes the deposit by the request id embedded in data, not by who paid the gas.

actionWhat it does
erc20ApproveApproves the provider to spend the input token. Appears only when the existing allowance is too low, so a quote has one or two steps.
relayDepositErc20Deposits the input token into the provider’s pool. The fill is a separate transaction, submitted once a solver picks it up.
relayTransferAndMulticallMoves the input token and completes the fill atomically, in one onchain transaction.

How the quote fills decides which deposit step appears; the caller doesn’t choose. We’ll add actions as we add providers and capabilities, so handle an action you don’t recognize rather than assuming this is the full set.

Quote validity

The deposit must land onchain by expiresAt, 180 seconds after the quote is priced, so execute the steps as soon as your user confirms. A deposit after expiry fails and, when possible, is refunded, following the failed → refunded path in Tracking execution. Request a new quote instead of retrying an expired one.

Fees

fees is informational. Nothing in it is deducted from senderAmount or receiverAmount, which already include the quoted rate, spread, and any price impact. Compute the effective rate as receiverAmount / senderAmount; fees won’t reconcile against it.

FieldWhat it is
gasUsdCost of the steps the sender’s own wallet executes directly, such as erc20Approve.
relayerUsdThe provider’s total fee: relayerGasUsd (its own onchain execution cost) plus relayerServiceUsd (its service margin).
appUsdAgora’s own fee, separate from the provider’s.

Tracking and errors

transactionId is set when the quote is created, but the transaction doesn’t exist until the deposit is observed. Poll it through GET /v0/transactions/{txnId}; Tracking execution covers the 404 window and the status lifecycle. The Error Reference lists the quote-specific errors: parameter_invalid, chain_unsupported, currency_unsupported, wallet_blocked, quote_not_found, and service_unavailable.