Skip to content
LCX Liberty DEX
RWA API

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

RWA API

RWA API

Swaps into and out of tokenized stocks, ETFs, gold and treasury tokens, each quote measured against what the token stands for, read on chain.

What it is

The RWA API swaps into and out of tokenized real-world assets: stocks and ETFs (Robinhood, Ondo, bStocks, Coinbase, xStocks, st0x), gold (PAXG, XAUt, XAUt0, XAUM, VNXAU) and treasury and credit tokens. It runs the same engine as /v1/quote and /v1/swap, on the same host with the same key, and puts a rule set for these assets around it. Three endpoints:

EndpointPurpose
GET /v1/rwa/assetsEvery RWA token the API quotes, by chain, with its reference.
POST /v1/rwa/quoteA swap, measured against the token's reference price, or refused.
POST /v1/rwa/swapThe same quote and a transaction to sign, its minimum output set from your tolerance.

The rules

  • One side is a registered RWA token. Each contract in the registry was checked against CoinGecko's listing, its own symbol and decimals, and its verified source.
  • Every quote is measured against a reference price read on chain, independent of the pools we route through. The distance is refDeviationBps.
  • Your tolerance is enforced. A quote further below the reference than maxRefDeviationBps is refused, and the swap's minimum output is set from it, so the transaction reverts on chain rather than paying less.
  • No reference, no quote by default. A token without a live reference needs allowUnreferenced.
  • Non-custodial. The API returns a transaction; you or your client sign and send it.

Reference prices

Each token has one source, chosen and checked against its market before it was listed:

TokenReference
Robinhood, Coinbase and Ondo stocks with an issuer feedThe issuer's Chainlink feed for that token. It already includes the issuer's multiplier for reinvested dividends.
Other stock and ETF tokensThe underlying's Chainlink feed times the token's own multiplier (uiMultiplier, or Ondo's sValue). An xStock is one share.
GoldChainlink XAU/USD: one troy ounce per token (VNXAU: one gram).
Maple syrupUSDC and syrupUSDTThe vault's own rate on Ethereum (convertToAssets).

The other side of the swap is valued by our oracle (a dollar stablecoin at $1). Equity feeds update during US sessions only; off hours the reference is the last close, and a reference up to four days old still counts. rwa.marketOpen says whether the US market is open, so you can tell a quote made against a live price from one made against Friday's close. GET /v1/rwa/assets shows which tokens have a reference (referenced).

Tolerance and the floor

Two numbers bound a swap, and the tighter one wins. maxRefDeviationBps (default 100) is how far below the reference you accept. slippageBps (default 50) is how far below the quote itself the fill may land. rwa.minOut is the result, in base units of tokenOut; rwa.floorOut is the output exactly at your tolerance.

On this API read rwa.minOut, not quote.output.minimumAmount. To build a quote's quoteId through /v1/build yourself, send rwa.slippageBps as the slippage.

Who may hold these tokens

Each issuer sets who may hold its tokens, and most exclude US persons and some other jurisdictions. The API routes swaps between tokens on public venues and makes no decision about eligibility: that stays with the issuer and with you as the integrator. Tokens can carry an issuer's blocklist and pause, so a transfer the issuer blocks reverts on chain.

A first call

bash
curl -X POST https://swap-api.lcx.com/v1/rwa/quote \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chainId": 8453,
    "tokenIn":  "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "tokenOut": "0xb20000000000000000000078ee7ce2fE4908108C",
    "amount": "10000",
    "maxRefDeviationBps": 50
  }'