Skip to content
LCX Liberty DEX
RWA swap

LCX Liberty. American DeFi. Your keys. Your assets. Your control.

RWA API

RWA swap

POST /v1/rwa/swap returns the quote and a transaction whose minimum output is set from your tolerance.

Request

POST/v1/rwa/swap

Everything /v1/rwa/quote takes, plus a taker. It quotes under the same rules and builds the transaction in the same call, its minimum output set to rwa.minOut.

Body
chainId*number

The chain both tokens are on.

tokenIn*string

The token being sold. At least one of tokenIn and tokenOut must be in the RWA registry for chainId, or the request is refused with not_an_rwa. The other side may be any token we route, usually the chain's dollar.

tokenOut*string

The token being bought. It must differ from tokenIn.

amountIn*string

The amount to sell in base units, as on /v1/quote. Required unless amount is sent; never both.

amountstring

The same amount in human units, scaled by the token's own decimals.

maxRefDeviationBpsnumber

Your tolerance: how far below the reference price you accept, in basis points. Default 100, above 0 and at most 500. A quote further below is refused with below_tolerance.

slippageBpsnumber

The bound against the quote itself. Default 50. The swap's minimum output is the tighter of this and your tolerance.

allowOffReferenceboolean

Default false. Buying a token whose market pays more than 3% above its reference (the market valuing it under what it stands for) is refused with off_reference unless this is true.

allowUnreferencedboolean

Default false. A token with no live reference is refused with no_reference_price. With this true the quote is served under the engine's own guards and your slippage only, and rwa.refDeviationBps is null.

integratorstring

Your integration, exactly as on /v1/quote.

taker*string

The address that sends the transaction and receives the output.

deadlineSecsnumber

Seconds until the on-chain deadline, as on /v1/build.

* required

Headers
Idempotency-Keystring

Optional, 1 to 128 visible ASCII characters. The same key with the same body within 24 hours returns the first answer; with another body it is refused with idempotency_key_reused. Separate from the Stablecoin API's keys.

Response

data.quote and data.rwa as on /v1/rwa/quote, plus data.transaction (to, data, value, gas, chainId). If the market moves past rwa.minOut before the transaction lands, the swap reverts on chain rather than paying less.

Check /v1/allowance before sending. A swap from a token with no allowance reverts, and the revert costs gas.