Swap

Price a same-network asset swap

Prices a swap between two assets on the same network, comparing the sources available and returning the best net rate.

Read-only. It is a POST because it carries a body (the pair, the amount, the tolerance), not because it writes. Nothing leaves any wallet.

The quote does not execute, and executable says so rather than leaving it to be assumed. There is no route that accepts a quote: moving value needs an execution gate that no source currently passes. The absence of that route is the gate, not an omission.

The wallet that receives the outgoing asset is derived from the authenticated client. The body carries the pair and the amount, never a destination: accepting one would let a caller price, and later execute, a swap whose proceeds land somewhere else.

slippage_bps is required and has no silent default. A hidden default would decide, on the client's behalf, how much they accept losing.

min_amount_out travels beside amount_out, never instead of it. Showing only the expected output would make the tolerance disappear from the answer, and the client would compare an optimistic figure against an already-discounted one elsewhere.

Not every network carries a pair. A swap needs both assets settled on the same network, and some networks carry only one of them. A pair no source serves answers a named error, never a zero or an empty quote, so a pair that cannot be served stays distinguishable from a bad price.

quotes_compared and sources_unavailable are counts, never lists. That a comparison happened is worth knowing (the best of three is a different answer from the only one that replied), and the number says it without naming who.

post/swap/quote

Request

  • Base URL
    https://developers.ozav.io/v2
  • Auth
    • API key in header X-API-Key
    • or HTTP bearer

Request body

chainstring required
asset_instring required
asset_outstring required
amount_instring required

Decimal integer string, smallest unit of asset_in. Never a float.

slippage_bpsinteger required

Tolerance in basis points. 50 is 0.50%. Required.

Example request

{
  "chain": "ethereum",
  "asset_in": "USDT",
  "asset_out": "USDC",
  "amount_in": "100000000",
  "slippage_bps": 50
}

Response

The swap priced.

quotes_comparedinteger
sources_unavailableinteger

How many sources did not answer. Never silenced: a quote chosen from one of three is a different answer from one chosen from three of three.

Changes

No recorded changes to this operation across all 1 revision of this API.