Skip to content

Commit 71a6352

Browse files
committed
misc doc updates - chains, callluts, etc
1 parent 24ac55b commit 71a6352

22 files changed

+135
-202
lines changed

fern/docs/pages/0x-swap-api/additional-topics/about-the-rfq-system.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ If integrators request a standard quote from the Swap API, part or all of their
3434

3535
**Takers**
3636

37-
Takers fill 0x orders by agreeing to trade their asset for the Maker's asset; in other words, consume the 0x liquidity. When making a Swap API request, the RFQ orders must contain the [`taker`](/api-reference/openapi-yaml/swap/permit-2-getquote) request parameter. When an order containing this parameter gets hashed and signed by two counterparties, it is exclusive to those two counterparties. This means that the order can only be filled by the taker address specified in the order. This is a security feature that prevents front-running and other types of attacks.
37+
Takers fill 0x orders by agreeing to trade their asset for the Maker's asset; in other words, consume the 0x liquidity. When making a Swap API request, the RFQ orders must contain the [`taker`](/api-reference/openapi-json/swap/permit-2-getquote) request parameter. When an order containing this parameter gets hashed and signed by two counterparties, it is exclusive to those two counterparties. This means that the order can only be filled by the taker address specified in the order. This is a security feature that prevents front-running and other types of attacks.
3838

3939
**Market Makers**
4040

4141
As mentioned earlier, 0x API works with specific market makers who participate in the RFQ system. Each maker is identified by an HTTP endpoint URL, and each endpoint has an associated list of asset pairs for which that endpoint will provide quotes. For the instance at `api.0x.org`, the 0x team is maintaining a list of trusted market makers.
4242

4343
## Integrating RFQ Liquidity
4444

45-
RFQ liquidity is included in a quote when `taker` is included in a [`/quote` request](/api-reference/openapi-yaml/swap/allowanceholder-getquote).
45+
RFQ liquidity is included in a quote when `taker` is included in a [`/quote` request](/api-reference/openapi-json/swap/allowanceholder-getquote).
4646

4747
## Learn More
4848

fern/docs/pages/0x-swap-api/additional-topics/buy-sell-tax-support.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Example 2: Both buy (SMI) and sell tokens (FLOKI) have buy and sell taxes, respe
7171

7272
<Accordion title="Step 2: Utilize API Response Parameters">
7373

74-
Use the `tokenMetadata` object returned in the `/price` and `/quote` endpoints for both [Swap and Gasless API calls](/api-reference/openapi-yaml/swap/allowanceholder-getprice). This object contains the buy/sell tax information for the tokens involved in the swap.
74+
Use the `tokenMetadata` object returned in the `/price` and `/quote` endpoints for both [Swap and Gasless API calls](/api-reference/openapi-json/swap/allowanceholder-getprice). This object contains the buy/sell tax information for the tokens involved in the swap.
7575

7676
Example response:
7777

fern/docs/pages/0x-swap-api/additional-topics/how-to-set-your-token-allowances.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ To allow a third-party service—such as the 0x API—to move your ERC-20 tokens
77

88
Which contract to approve depends on the API endpoint you're using:
99

10-
| API Endpoint | Allowance Target Contract |
11-
| ------------------------------------------------------------------------- | ------------------------- |
12-
| [`/swap/allowance-holder`](/api-reference/openapi-yaml/swap/allowanceholder-getquote) | AllowanceHolder |
13-
| [`/swap/permit2`](/api-reference/openapi-yaml/swap/permit-2-getquote) | Permit2 |
10+
| API Endpoint | Allowance Target Contract |
11+
| ------------------------------------------------------------------------------------- | ------------------------- |
12+
| [`/swap/allowance-holder`](/api-reference/openapi-json/swap/allowanceholder-getquote) | AllowanceHolder |
13+
| [`/swap/permit2`](/api-reference/openapi-json/swap/permit-2-getquote) | Permit2 |
1414

1515
The wallet holding the tokens (`taker`) must approve the contract address returned in `issues.allowance.spender` or `allowanceTarget` from the `/price` or `/quote` response.
1616

@@ -37,15 +37,15 @@ In API v2, **allowance management** and **swap execution** are handled by **diff
3737

3838
This separation enhances security by isolating allowance management from swap execution.
3939

40-
<Note>
40+
<Warning>
4141

4242
- NEVER set an allowance on the [Settler contract](/docs/core-concepts/contracts#0x-settler-contract). Doing so may result in unintended consequences, including potential loss of tokens or exposure to security risks. The Settler contract does not support or require token allowances for its operation. Setting an allowance on the Settler contract will lead to misuse by other parties.
4343

4444
- ONLY set allowances on [AllowanceHolder](/docs/core-concepts/contracts#allowanceholder-recommended) or [Permit2](/docs/core-concepts/contracts#permit2-advanced-use-only) contracts, as indicated by the API responses.
4545

4646
- The correct allowance target is returned in `issues.allowance.spender` or `allowanceTarget`.
4747

48-
</Note>
48+
</Warning>
4949

5050
Example response from `/swap/permit2/quote` will return back the contract address if an allowance needs to be set:
5151

fern/docs/pages/0x-swap-api/guides/build-token-swap-dapp-nextjs-permit2.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const projectId = process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID as string; /
102102

103103
### What is it?
104104

105-
PriceView displays indicative pricing using[/swap/allowance-holder/price](/api-reference/openapi-yaml/swap/permit-2-getprice). Indicative pricing is for users to browse for a price without committing to a trade.
105+
PriceView displays indicative pricing using[/swap/allowance-holder/price](/api-reference/openapi-json/swap/permit-2-getprice). Indicative pricing is for users to browse for a price without committing to a trade.
106106

107107
Indicative prices:
108108

@@ -135,7 +135,7 @@ Firm quotes are fetched later in QuoteView.
135135

136136
#### Token Allowances & Approvals
137137

138-
<Note>
138+
<Warning>
139139

140140
Important: Read Before Using 0x API
141141

@@ -145,7 +145,7 @@ Important: Read Before Using 0x API
145145

146146
- The correct allowance target is returned in `issues.allowance.spender` or `allowanceTarget`.
147147

148-
</Note>
148+
</Warning>
149149

150150
Before placing a trade on the PageView, users must set allowances on all tokens involved. A token allowance lets a third party move funds on your behalf. Essentially, you permit them to move your tokens.
151151

@@ -174,7 +174,7 @@ The logic to check if the user has approved a token allowance the selected sell
174174

175175
### What is it?
176176

177-
QuoteView displays a firm, executable quote returned from [/swap/allowance-holder/quote](/api-reference/openapi-yaml/swap/permit-2-getquote).
177+
QuoteView displays a firm, executable quote returned from [/swap/allowance-holder/quote](/api-reference/openapi-json/swap/permit-2-getquote).
178178

179179
Firm quotes:
180180

@@ -289,8 +289,8 @@ Swap API provides two built-in ways to monetize your swap integration—availabl
289289
290290
For implementation details and pricing considerations, see the [how to monetize your app using 0x Swap API](/docs/0x-swap-api/guides/monetize-your-app-using-swap).
291291
292-
<sup>1</sup> Trade surplus is available only to select integrators on a custom plan.
293-
Contact support for access.
292+
<sup>1</sup> Trade surplus is available only to select integrators on a custom
293+
plan. Contact support for access.
294294
295295
## Conclusion
296296

fern/docs/pages/0x-swap-api/guides/build-token-swap-dapp-nextjs.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const projectId = process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID as string; /
9292

9393
### What is it?
9494

95-
PriceView displays indicative pricing using[/swap/allowance-holder/price](/api-reference/openapi-yaml/swap/allowanceholder-getprice). Indicative pricing is for users to browse for a price without committing to a trade.
95+
PriceView displays indicative pricing using[/swap/allowance-holder/price](/api-reference/openapi-json/swap/allowanceholder-getprice). Indicative pricing is for users to browse for a price without committing to a trade.
9696

9797
Indicative prices:
9898

@@ -125,7 +125,7 @@ Firm quotes are fetched later in QuoteView.
125125

126126
#### Token Allowances & Approvals
127127

128-
<Note>
128+
<Warning>
129129

130130
Important: Read Before Using 0x API
131131

@@ -135,7 +135,7 @@ Important: Read Before Using 0x API
135135

136136
- The correct allowance target is returned in `issues.allowance.spender` or `allowanceTarget`.
137137

138-
</Note>
138+
</Warning>
139139

140140
Before placing a trade on the PageView, users must set allowances on all tokens involved. A token allowance lets a third party move funds on your behalf. Essentially, you permit them to move your tokens.
141141

@@ -164,7 +164,7 @@ The logic to check if the user has approved a token allowance the selected sell
164164

165165
### What is it?
166166

167-
QuoteView displays a firm, executable quote returned from [/swap/allowance-holder/quote](/api-reference/openapi-yaml/swap/allowanceholder-getquote).
167+
QuoteView displays a firm, executable quote returned from [/swap/allowance-holder/quote](/api-reference/openapi-json/swap/allowanceholder-getquote).
168168

169169
Firm quotes:
170170

@@ -245,8 +245,8 @@ Swap API provides two built-in ways to monetize your swap integration—availabl
245245
246246
For implementation details and pricing considerations, see the [how to monetize your app using 0x Swap API](./monetize-your-app-using-swap).
247247
248-
<sup>1</sup> Trade surplus is available only to select integrators on a custom plan.
249-
Contact support for access.
248+
<sup>1</sup> Trade surplus is available only to select integrators on a custom
249+
plan. Contact support for access.
250250
251251
## Conclusion
252252

fern/docs/pages/0x-swap-api/guides/monetize-your-app-using-swap.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Out-of-the-box, 0x Swap API offers two monetization options:
3131

3232
0x supports multiple affiliate fee (trading fees/commissions) within a single swap request. This allows you to route fees to multiple recipients with independently specified fee amounts — perfect for multi-product apps, partner revenue-share setups, or flexible monetization strategies.
3333

34-
To apply affiliate fees, include the following parameters in your [Swap API request](/api-reference/openapi-yaml/swap/allowanceholder-getprice):
34+
To apply affiliate fees, include the following parameters in your [Swap API request](/api-reference/openapi-json/swap/allowanceholder-getprice):
3535

3636
- `swapFeeRecipient` - The wallet address to receive the specified trading fees (supports single or multiple comma-separated values).
3737
- `swapFeeBps` - The fee amount(s), in basis points, to send to each corresponding `swapFeeRecipient`. Denoted in basis points (0–1000 Bps = 0–10%).

fern/docs/pages/0x-swap-api/guides/swap-tokens-with-0x-swap-api-permit2.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Every 0x API call requires an API key. [Create a 0x account](https://dashboard.0
6969

7070
Let's find the best price!
7171

72-
Use the [`/swap/permit2/price`](/api-reference/openapi-yaml/swap/permit-2-getprice) endpoint to get an indicative price for an asset pair. This returns pricing information without creating a full order or transaction, allowing the user to browse potential prices before committing.
72+
Use the [`/swap/permit2/price`](/api-reference/openapi-json/swap/permit-2-getprice) endpoint to get an indicative price for an asset pair. This returns pricing information without creating a full order or transaction, allowing the user to browse potential prices before committing.
7373

7474
Think of `/price` as the "read-only" version of `/quote`, which you'll use in step 3.
7575

@@ -95,7 +95,7 @@ const headers = {
9595

9696
const priceResponse = await fetch(
9797
"https://api.0x.org/swap/permit2/price?" + priceParams.toString(),
98-
{ headers }
98+
{ headers },
9999
);
100100

101101
console.log(await priceResponse.json());
@@ -268,14 +268,14 @@ Specify the amount of ERC20 tokens the contract can move.
268268

269269
For implementation details, see [how to set your token allowances](/docs/0x-swap-api/additional-topics/how-to-set-your-token-allowances).
270270

271-
<Note>
271+
<Warning>
272272
- NEVER set an allowance on the [Settler contract](/docs/core-concepts/0x-cheat-sheet#0x-settler-contracts). Doing so may result in unintended consequences, including potential loss of tokens or exposure to security risks. The Settler contract does not support or require token allowances for its operation. Setting an allowance on the Settler contract will lead to misuse by other parties.
273273

274274
- ONLY set allowances on [AllowanceHolder](/docs/core-concepts/0x-cheat-sheet#allowanceholder-contract) or [Permit2](/docs/core-concepts/0x-cheat-sheet#permit2-contract) contracts, as indicated by the API responses.
275275

276276
- The correct allowance target is returned in `issues.allowance.spender` or `allowanceTarget`.
277277

278-
</Note>
278+
</Warning>
279279

280280
<Tip>
281281
When setting the token allowance, make sure to provide enough allowance for
@@ -309,7 +309,7 @@ if (sellToken.address === CONTRACTS.ETH) {
309309
const hash = await sellToken.write.approve(request.args);
310310
console.log(
311311
"Approved Permit2 to spend sellToken.",
312-
await client.waitForTransactionReceipt({ hash })
312+
await client.waitForTransactionReceipt({ hash }),
313313
);
314314
} catch (error) {
315315
console.log("Error approving Permit2:", error);
@@ -322,7 +322,7 @@ if (sellToken.address === CONTRACTS.ETH) {
322322

323323
## 3. Fetch a Firm Quote
324324

325-
When you're ready to execute a trade, request a firm quote from the Swap API using [`/swap/permit2/quote`](/api-reference/openapi-yaml/swap/permit-2-getquote). This signals a soft commitment to complete the trade.
325+
When you're ready to execute a trade, request a firm quote from the Swap API using [`/swap/permit2/quote`](/api-reference/openapi-json/swap/permit-2-getquote). This signals a soft commitment to complete the trade.
326326

327327
The response includes a full 0x order, ready for submission to the network. The Market Maker is expected to have reserved the necessary assets, reducing the likelihood of order reversion.
328328

fern/docs/pages/0x-swap-api/guides/swap-tokens-with-0x-swap-api.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ The API handles three key tasks:
1717

1818
## What You Will Learn
1919

20-
This guide will cover the core steps to using Swap API, specifically using the [Swap AllowanceHolder](/api-reference/openapi-yaml/swap/allowanceholder-getprice) endpoint.
20+
This guide will cover the core steps to using Swap API, specifically using the [Swap AllowanceHolder](/api-reference/openapi-json/swap/allowanceholder-getprice) endpoint.
2121

2222
<Note>
2323
{" "}
24-
Learn about the [difference between AllowanceHolder and Permit2 in Swap API](/docs/introduction/faq#allowanceholder-and-permit2){" "}
24+
Learn about the [difference between AllowanceHolder and Permit2 in Swap
25+
API](/docs/introduction/faq#allowanceholder-and-permit2){" "}
2526
</Note>
2627

2728
## Playground
@@ -56,7 +57,7 @@ Every 0x API call requires an API key. [Create a 0x account](https://dashboard.0
5657

5758
Let's find the best price!
5859

59-
Use the [`/swap/allowance-holder/price`](/api-reference/openapi-yaml/swap/allowanceholder-getprice) endpoint to get an indicative price for an asset pair. This returns pricing information without creating a full order or transaction, allowing the user to browse potential prices before committing.
60+
Use the [`/swap/allowance-holder/price`](/api-reference/openapi-json/swap/allowanceholder-getprice) endpoint to get an indicative price for an asset pair. This returns pricing information without creating a full order or transaction, allowing the user to browse potential prices before committing.
6061

6162
Think of `/price` as the "read-only" version of `/quote`, which you'll use in step 3.
6263

@@ -84,7 +85,7 @@ const priceResponse = await fetch(
8485
"https://api.0x.org/swap/allowance-holder/price?" + priceParams.toString(),
8586
{
8687
headers,
87-
}
88+
},
8889
);
8990

9091
console.log(await priceResponse.json());
@@ -245,15 +246,15 @@ Specify the amount of ERC20 tokens the contract can use.
245246

246247
For detailed instructions, see [how to set your token allowances](/docs/0x-swap-api/additional-topics/how-to-set-your-token-allowances).
247248

248-
<Note>
249+
<Warning>
249250

250251
- NEVER set an allowance on the [Settler contract](/docs/core-concepts/contracts#0x-settler-contract). Doing so may result in unintended consequences, including potential loss of tokens or exposure to security risks. The Settler contract does not support or require token allowances for its operation. Setting an allowance on the Settler contract will lead to misuse by other parties.
251252

252253
- ONLY set allowances on [AllowanceHolder](/docs/core-concepts/contracts#allowanceholder-recommended) or [Permit2](/docs/core-concepts/contracts#permit2-advanced-use-only) contracts, as indicated by the API responses.
253254

254255
- The correct allowance target is returned in `issues.allowance.spender` or `allowanceTarget`.
255256

256-
</Note>
257+
</NWarningote>
257258

258259
<Tip>
259260
When setting the token allowance, make sure to provide enough allowance for
@@ -282,7 +283,7 @@ if (price.issues.allowance !== null) {
282283
const hash = await usdc.write.approve(request.args);
283284
console.log(
284285
"Approved AllowanceHolder to spend USDC.",
285-
await client.waitForTransactionReceipt({ hash })
286+
await client.waitForTransactionReceipt({ hash }),
286287
);
287288
} catch (error) {
288289
console.log("Error approving AllowanceHolder:", error);
@@ -294,7 +295,7 @@ if (price.issues.allowance !== null) {
294295

295296
## 3. Fetch a Firm Quote
296297

297-
When you're ready to execute a trade, request a firm quote from the Swap API using [`/swap/allowance-holder/quote`](/api-reference/openapi-yaml/swap/allowanceholder-getquote). This signals a soft commitment to complete the trade.
298+
When you're ready to execute a trade, request a firm quote from the Swap API using [`/swap/allowance-holder/quote`](/api-reference/openapi-json/swap/allowanceholder-getquote). This signals a soft commitment to complete the trade.
298299

299300
The response includes a full 0x order, ready for submission to the network. The Market Maker is expected to have reserved the necessary assets, reducing the likelihood of order reversion.
300301

fern/docs/pages/0x-swap-api/guides/troubleshooting-swap-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ Check the value returned by the `liquidityAvailable` field that validates the av
1919

2020
The taker (the address which holds the `sellToken` balance and is executing the swap transaction) should hold at _least_ the `sellAmount` of `sellToken`. The taker also should approve the `issues.allowance.spender` (AllowanceHolder or Permit2 contracts) to spend at least the same amount for that token.
2121

22-
<Note>
22+
<Warning>
2323
- NEVER set an allowance on the [Settler contract](/docs/core-concepts/contracts#0x-settler-contract). Doing so may result in unintended consequences, including potential loss of tokens or exposure to security risks. The Settler contract does not support or require token allowances for its operation. Setting an allowance on the Settler contract will lead to misuse by other parties.
2424

2525
- ONLY set allowances on [AllowanceHolder](/docs/core-concepts/contracts#allowanceholder-recommended) or [Permit2](/docs/core-concepts/contracts#permit2-advanced-use-only) contracts, as indicated by the API responses.
2626

2727
- The correct allowance target is returned in `issues.allowance.spender` or `allowanceTarget`.
2828

29-
</Note>
29+
</Warning>
3030
## Gas Limits
3131

3232
The transaction needs to be submitted with enough gas. Due to the nondeterministic nature of the on-chain settlement process, the swap may require more than what an `eth_estimateGas` RPC call returns. The quoted response will return `transacation.gas` which is the estimated limit that should be used to send the transaction to guarntee settlement. Any unused gas will be refunded to the transaction submitter.

0 commit comments

Comments
 (0)