Skip to navigation

RWA Quickstart

View as Markdown

This guide walks through your first RWA trade end to end. If you have used Swap API before, the request shape is identical — the only RWA-specific step is the one-time opt-in in step 1.

What you will need

1

A 0x API key. See Create a 0x API Key.

2

RWA trading enabled for your team. See Enable RWA Trading.

3

A funded wallet on a supported chain, and a web3 library such as viem or ethers to sign and submit.

1. Enable RWA trading

RWAs are blocked by default. Before any of the requests below return a quote, someone on your team must accept the RWA trading agreement in the 0x Dashboard.

If you skip this step, the API rejects RWA quotes rather than returning a price.

2. Pick an RWA token

RWA tokens are ordinary ERC-20 contracts, so you address them by contract address exactly like any other token. This guide buys tokenized NVIDIA (NVDA) with USDG on Robinhood Chain:

CHAIN_ID=4663 # Robinhood Chain
NVDA=0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec # tokenized NVIDIA, 18 decimals
USDG=0x5fc5360d0400a0fd4f2af552add042d716f1d168 # Global Dollar, 6 decimals

3. Get an indicative price

Use /swap/allowance-holder/price to show a user what a trade would cost. A price is indicative and not executable — it does not reserve liquidity or return transaction data.

This example buys NVDA with 1,000 USDG:

curl --request GET \
--url "https://api.0x.org/swap/allowance-holder/price?chainId=$CHAIN_ID&sellToken=$USDG&buyToken=$NVDA&sellAmount=1000000000&taker=0xYOUR_TAKER_ADDRESS" \
--header "0x-api-key: YOUR_API_KEY" \
--header "0x-version: v2"

sellAmount is in the sell token’s base units. USDG has 6 decimals, so 1,000 USDG is 1000000000. RWA token decimals vary by issuer, so read decimals from the token contract rather than assuming 18.

Check liquidityAvailable in the response before showing a price. RWA markets are thinner than major crypto pairs, so a pair that quotes at one size may not quote at another.

4. Fetch a firm quote

When the user commits, call /swap/allowance-holder/quote for an executable quote with transaction data attached:

curl --request GET \
--url "https://api.0x.org/swap/allowance-holder/quote?chainId=$CHAIN_ID&sellToken=$USDG&buyToken=$NVDA&sellAmount=1000000000&taker=0xYOUR_TAKER_ADDRESS" \
--header "0x-api-key: YOUR_API_KEY" \
--header "0x-version: v2"

The response includes transaction, a valid unsigned Ethereum transaction.

taker is required on /quote. It lets the API validate the trade and return calldata, so failures surface before the user signs.

5. Set an allowance and submit

From here the flow is standard Swap API — there is nothing RWA-specific about signing or submission:

1

Check issues.allowance in the quote response. If it is non-null, have the taker approve the returned spender (the AllowanceHolder contract) to spend USDG. See How to set your token allowances.

2Sign and submit transaction with your web3 library.

Next steps