Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ tabs:
display-name: SVM
cross-chain:
display-name: Cross-Chain
# TODO(pre-launch): remove `hidden: true` when RWA self-serve opt-in ships.
rwa:
display-name: RWA
hidden: true
api-reference:
display-name: API Reference
liquidity:
Expand Down Expand Up @@ -421,6 +425,47 @@ navigation:
href: https://0x.org/contact
target: _blank

- tab: rwa
layout:
- section: RWA
slug: rwa
icon: fa-regular fa-building-columns
contents:
- page: Introduction
slug: introduction
path: docs/pages/rwa/introduction.mdx
- section: Guides
slug: guides
contents:
- page: Enable RWA Trading
slug: enable-rwa-trading
path: docs/pages/rwa/guides/enable-rwa-trading.mdx
- page: RWA Quickstart
slug: quickstart
path: docs/pages/rwa/guides/quickstart.mdx
- link: Supported Chains and Providers
href: /docs/introduction/supported-chains
- link: Learn More
href: https://0x.org/solution/rwas
target: _blank

- section: Need Help?
slug: need-help
icon: fa-regular fa-circle-question
contents:
- page: FAQ
slug: faq
path: docs/pages/introduction/faq.mdx
- page: API Issues & Error Codes
slug: api-issues
path: docs/pages/introduction/api-issues.mdx
- page: Contact Support
slug: contact-support
path: docs/pages/need-help/contact-support.mdx
- link: Contact Sales
href: https://0x.org/contact
target: _blank

- tab: api-reference
layout:
- page: API Overview
Expand Down
14 changes: 14 additions & 0 deletions fern/docs/pages/introduction/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,20 @@ Read more about [accessing 0x transaction data here](/docs/core-concepts/transac
<Accordion title="What is an App?">
An app is a self-contained unit for each application that you’re building. You can set up multiple apps, each with unique API keys and configurations, on the <a href="https://dashboard.0x.org/">0x Dashboard</a>.
</Accordion>

{/* TODO(pre-launch): uncomment the two RWA accordions below when self-serve opt-in
ships, at the same time `hidden: true` is removed from the RWA tab in docs.yml.
They are commented out so they cannot publish while the guide is still hidden.

<Accordion title="How do I enable trading for tokenized real-world assets (RWAs)?">
RWA trading is a self-serve, one-time opt-in. Sign in to the <a href="https://dashboard.0x.org/">0x Dashboard</a>, open the <strong>RWA</strong> tab, and accept the RWA trading agreement. Access is enabled immediately for every app and API key on your team — no new app, no key rotation, and no manual review on our side. See <a href="/rwa/guides/enable-rwa-trading">Enable RWA Trading</a> for the full walkthrough, or <a href="/rwa/introduction">Introduction to RWAs</a> for what you can trade.
</Accordion>

<Accordion title="I skipped the RWA step when I signed up. Can I still opt in?">
Yes. The RWA step during signup is skippable and skipping it has no effect on the rest of your account setup. You can opt in at any time from the <strong>RWA</strong> tab in the <a href="https://dashboard.0x.org/">0x Dashboard</a>.
</Accordion>

*/}
</AccordionGroup>

---
Expand Down
111 changes: 111 additions & 0 deletions fern/docs/pages/rwa/guides/enable-rwa-trading.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: "Enable RWA Trading"
description: "Opt in to trading tokenized real-world assets (RWAs) from the 0x Dashboard."
---

Trading tokenized real-world assets (RWAs) through 0x requires a one-time opt-in. Opting in is self-serve: you accept the RWA trading agreement from the [0x Dashboard](https://dashboard.0x.org/), and access is enabled immediately. There is no application to fill out and no waiting on manual review.

<Note>
RWA access is granted at the **team** level, not per app. Once your team opts
in, every app and API key belonging to that team can trade RWAs. You only need
to opt in once.
</Note>

New to RWAs on 0x? Start with [Introduction to RWAs](/rwa/introduction) for what you can trade and how routing works.

## Before you begin

<Steps>
<Step>
You need a 0x account and a team. If you do not have one yet, see [Create a
0x API Key](/docs/introduction/quickstart/getting-started).
</Step>
<Step>
Review the RWA trading agreement with your legal or compliance team before
accepting. Accepting is an agreement on behalf of your organization.
</Step>
</Steps>

## Opt in during signup

New teams are offered RWA access as a step during signup. You can accept it then, or **skip** the step and opt in later from the dashboard — skipping does not affect the rest of your account setup, and you can come back to it at any time.

{/* TODO(pre-launch): screenshot of the signup RWA step. Save to ../../assets/img/introduction/0x-dashboard-rwa-signup-step.png */}

## Opt in from the dashboard

If you skipped the signup step, or your team was created before RWA opt-in was available:

<Steps>
<Step>
Sign in to the [0x Dashboard](https://dashboard.0x.org/).
</Step>
<Step>
Open the **RWA** tab.
{/* TODO(pre-launch): confirm the final tab name and its location in the dashboard nav. */}
</Step>
<Step>
Read the RWA trading agreement.
</Step>
<Step>
Check the box to confirm you accept the agreement on behalf of your team,
then submit.
{/* TODO(pre-launch): §5.4.2 may require additional fields (legal entity name, jurisdictions served). Document them here once legal confirms. */}
</Step>
</Steps>

{/* TODO(pre-launch): screenshot of the RWA tab and the agreement/checkbox state. Save to ../../assets/img/introduction/0x-dashboard-rwa-tab.png */}

## What happens after you accept

Everything is automated — there is no manual enablement step on the 0x side. When you accept:

<Steps>
<Step>
Your acceptance is recorded and RWA trading is enabled for your team in the
same write, so the two can never drift apart.
</Step>
<Step>
Your API gateway is re-provisioned so your existing API keys pick up the new
permission.
</Step>
<Step>
RWA access is live immediately. You do not need to create a new app or
rotate your API key.
</Step>
</Steps>

<Tip>
Because your existing API keys keep working, the only change you should notice
is that RWA quotes stop being rejected. No code change is required.
</Tip>

## Confirm RWA access is live

{/* TODO(pre-launch): document how an integrator verifies opt-in took effect. Either a status indicator in the RWA tab, or a sample /swap/permit2/price call against an RWA token that returns a quote instead of an authorization error. Include the exact error code returned before opt-in (likely BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE / SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE) so users can recognize it. */}

## Have a question?

If you are signed in to the [0x Dashboard](https://dashboard.0x.org/), you can reach our team directly through the Pylon Messenger in the bottom-right corner. For questions about the agreement itself, contact [0x Support](/docs/introduction/need-help).

## Related

<CardGroup>

<Card title="RWA Quickstart" href="/rwa/guides/quickstart" icon="rocket">
Price and execute your first RWA trade with Swap API.
</Card>

<Card title="Introduction to RWAs" href="/rwa/introduction" icon="circle-info">
What counts as an RWA on 0x, and how execution differs.
</Card>

<Card
title="Create a 0x API Key"
href="/docs/introduction/quickstart/getting-started"
icon="key"
>
Set up an account, create a team, and get a live API key.
</Card>

</CardGroup>
137 changes: 137 additions & 0 deletions fern/docs/pages/rwa/guides/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
title: "RWA Quickstart"
description: "Price and execute your first tokenized real-world asset trade with 0x Swap API."
---

This guide walks through your first RWA trade end to end. If you have used [Swap API](/evm/0x-swap-api/guides/swap-tokens-with-0x-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

<Steps>
<Step>
A 0x API key. See [Create a 0x API
Key](/docs/introduction/quickstart/getting-started).
</Step>
<Step>
RWA trading enabled for your team. See [Enable RWA
Trading](/rwa/guides/enable-rwa-trading).
</Step>
<Step>
A funded wallet on a supported chain, and a web3 library such as `viem` or
`ethers` to sign and submit.
</Step>
</Steps>

## 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](https://dashboard.0x.org/).

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

{/* TODO(pre-launch): confirm and document the exact error returned for a non-opted-in team — likely BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE / SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE (see /docs/introduction/api-issues). Show the real error body here so users can recognize it. */}

## 2. Pick an RWA token

RWA tokens are ordinary ERC-20 contracts, so you address them by contract address exactly like any other token.

{/* TODO(pre-launch): replace the placeholder below with a verified RWA token address and chain. Do not ship this page with a placeholder — a wrong address in a copy-pasteable example is worse than no example. Confirm with the team which asset makes the best canonical quickstart example (tokenized gold is likely the most liquid and least jurisdiction-sensitive). */}

```bash
# Replace with the RWA token you want to trade, and the chain it lives on.
RWA_TOKEN=0xRWA_TOKEN_ADDRESS
CHAIN_ID=1
USDC=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
```

<Tip>
0x indexes new RWA tokens as they launch, so an asset does not need to be
added to an allowlist before you can quote it.
</Tip>

## 3. Get an indicative price

Use `/swap/permit2/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 an RWA token with 1,000 USDC:

```bash
curl --request GET \
--url "https://api.0x.org/swap/permit2/price?chainId=$CHAIN_ID&sellToken=$USDC&buyToken=$RWA_TOKEN&sellAmount=1000000000&taker=0xYOUR_TAKER_ADDRESS" \
--header "0x-api-key: YOUR_API_KEY" \
--header "0x-version: v2"
```

<Note>
`sellAmount` is in the sell token's base units. USDC has 6 decimals, so 1,000
USDC is `1000000000`. RWA token decimals vary by issuer — read `decimals` from
the token contract rather than assuming 18.
</Note>

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/permit2/quote` for an executable quote with transaction data attached:

```bash
curl --request GET \
--url "https://api.0x.org/swap/permit2/quote?chainId=$CHAIN_ID&sellToken=$USDC&buyToken=$RWA_TOKEN&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, plus `permit2.eip712` if a Permit2 signature is required.

<Warning>
Always pass `taker` on `/quote`. Without it the API skips validation, and for
RWAs that validation is what surfaces jurisdiction and eligibility problems
before the user signs.
</Warning>

## 5. Set an allowance and submit

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

<Steps>
<Step>
Check `issues.allowance` in the quote response. If it is non-null, have the
taker approve the returned `spender`. See [How to set your token
allowances](/evm/0x-swap-api/additional-topics/how-to-set-your-token-allowances).
</Step>
<Step>
If `permit2.eip712` is present, have the taker sign it and append the
signature to `transaction.data` as described in [Get Started with Swap
API](/evm/0x-swap-api/guides/swap-tokens-with-0x-swap-api).
</Step>
<Step>Sign and submit `transaction` with your web3 library.</Step>
</Steps>

## Next steps

<CardGroup>

<Card
title="Enable RWA Trading"
href="/rwa/guides/enable-rwa-trading"
icon="unlock"
>
The one-time dashboard opt-in, in full.
</Card>

<Card
title="About the RFQ System"
href="/evm/0x-swap-api/additional-topics/about-the-rfq-system"
icon="tower-broadcast"
>
How 0x sources liquidity from professional market makers for thin markets.
</Card>

<Card
title="API Issues & Error Codes"
href="/docs/introduction/api-issues"
icon="triangle-exclamation"
>
Recognize and resolve the errors these endpoints can return.
</Card>

</CardGroup>
Loading