Plan a token-to-token swap: sell one token for QU, then buy another with that QU

Two trades run one after the other, each on QMax's best route (QX, QSwap or a split). Leg 2 is sized so that its worst case (the QU its signed limits can take) fits the LEAST leg 1 can pay within its limits, less a small safety margin: that size is minOutQty. expectedOutQty is the size if leg 1 pays what it is expected to. upfrontQu must be in the wallet before leg 1: QSwap's flat 100,000 QU per sell call leaves before the proceeds arrive (share-management moves are not included, as the wallet is not known here). Nothing is signed or sent; leg 2 must be sized again from the wallet's real balance after leg 1 settles. Both legs are limit orders: a QX order that does not fill stays on the book.

post/v1/swap-quote

Request

  • Base URL: https://qmax.exchange/api
  • URL: https://qmax.exchange/api/v1/swap-quote
  • Auth: none declared

Request body

fromstring required

Asset id to sell, from /v1/assets

tostring required

Asset id to buy, from /v1/assets

qtyinteger required

Units of from to sell

slippageBpsinteger

Price movement allowed on each leg

compareboolean

Also plan the same swap forced onto each single market (QX or QSwap for each leg) and say what QMax's route gains over the best of them (bestDeal). Slower: several plans.

Response

The plan: both quotes, expected and guaranteed amounts, QU needed up front, warnings and whether it can be signed

Changes

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