0x Cheat Sheet

View as Markdown

Supported Chains

Swap and Gasless v2 APIs are currently supported on the following chains. Select the chain in your request by providing the corresponding chainId request parameter. To request support for a new chain, please submit a request here.

ChainChain IDSwap APIGasless API
Ethereum (Mainnet)1
Abstract2741
Arbitrum42161
Avalanche43114
Base8453
Berachain80094
Blast81457
BSC56
Ink57073
Linea59144
Mantle5000
Mode34443
Monad10143
Optimism10
Plasma9745
Polygon137
Scroll534352
Sonic146
Unichain130
World Chain480

Swap API v2

Sample Request and Response

See full list of required query parameters and responses here.

Request

$curl --request GET \
> --url "https://api.0x.org/swap/permit2/quote?sellAmount=100000000000000000000000&taker=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&chainId=1&sellToken=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&buyToken=0x6b175474e89094c44da98b954eedeac495271d0f" \
> --header "0x-api-key: YOUR_API_KEY" \
> --header "0x-version: v2"

Response

1{
2 "blockNumber": "21876249",
3 "buyAmount": "145110588712348756365465945",
4 "buyToken": "0x6b175474e89094c44da98b954eedeac495271d0f",
5 "fees": {
6 "integratorFee": null,
7 "zeroExFee": {
8 "amount": "207515265570963324735062",
9 "token": "0x6b175474e89094c44da98b954eedeac495271d0f",
10 "type": "volume"
11 },
12 "gasFee": null
13 },
14 "issues": {
15 "allowance": {
16 "actual": "0",
17 "spender": "0x000000000022d473030f116ddee9f6b43ac78ba3"
18 },
19 "balance": {
20 "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
21 "actual": "16320309787715287566",
22 "expected": "100000000000000000000000"
23 },
24 "simulationIncomplete": false,
25 "invalidSourcesPassed": []
26 },
27 "liquidityAvailable": true,
28 "minBuyAmount": "143659482825225268801805400",
29 "permit2": {
30 "type": "Permit2",
31 "hash": "0xafb2c83591d83ec04d0792eaa00d36f5a509dfab6666fa787e310afa276bf379",
32 "eip712": {
33 "types": {
34 "PermitTransferFrom": [
35 {
36 "name": "permitted",
37 "type": "TokenPermissions"
38 },
39 {
40 "name": "spender",
41 "type": "address"
42 },
43 {
44 "name": "nonce",
45 "type": "uint256"
46 },
47 {
48 "name": "deadline",
49 "type": "uint256"
50 }
51 ],
52 "TokenPermissions": [
53 {
54 "name": "token",
55 "type": "address"
56 },
57 {
58 "name": "amount",
59 "type": "uint256"
60 }
61 ],
62 "EIP712Domain": [
63 {
64 "name": "name",
65 "type": "string"
66 },
67 {
68 "name": "chainId",
69 "type": "uint256"
70 },
71 {
72 "name": "verifyingContract",
73 "type": "address"
74 }
75 ]
76 },
77 "domain": {
78 "name": "Permit2",
79 "chainId": 1,
80 "verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3"
81 },
82 "message": {
83 "permitted": {
84 "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
85 "amount": "100000000000000000000000"
86 },
87 "spender": "0x0d0e364aa7852291883c162b22d6d81f6355428f",
88 "nonce": "2241959297937691820908574931991559",
89 "deadline": "1739918089"
90 },
91 "primaryType": "PermitTransferFrom"
92 }
93 },
94 "route": {
95 "fills": [
96 {
97 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
98 "to": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
99 "source": "Uniswap_V3",
100 "proportionBps": "250"
101 },
102 {
103 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
104 "to": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
105 "source": "Uniswap_V3",
106 "proportionBps": "749"
107 },
108 {
109 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
110 "to": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
111 "source": "Curve",
112 "proportionBps": "250"
113 },
114 {
115 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
116 "to": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
117 "source": "Curve",
118 "proportionBps": "250"
119 },
120 {
121 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
122 "to": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
123 "source": "SushiSwap",
124 "proportionBps": "500"
125 },
126 {
127 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
128 "to": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
129 "source": "Uniswap_V2",
130 "proportionBps": "251"
131 },
132 {
133 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
134 "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
135 "source": "Uniswap_V3",
136 "proportionBps": "250"
137 },
138 {
139 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
140 "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
141 "source": "SushiSwap",
142 "proportionBps": "250"
143 },
144 {
145 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
146 "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
147 "source": "Uniswap_V2",
148 "proportionBps": "500"
149 },
150 {
151 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
152 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
153 "source": "Uniswap_V3",
154 "proportionBps": "499"
155 },
156 {
157 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
158 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
159 "source": "Uniswap_V3",
160 "proportionBps": "749"
161 },
162 {
163 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
164 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
165 "source": "Uniswap_V3",
166 "proportionBps": "249"
167 },
168 {
169 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
170 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
171 "source": "Uniswap_V2",
172 "proportionBps": "1583"
173 },
174 {
175 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
176 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
177 "source": "SushiSwap",
178 "proportionBps": "499"
179 },
180 {
181 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
182 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
183 "source": "Fluid",
184 "proportionBps": "249"
185 },
186 {
187 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
188 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
189 "source": "Uniswap_V4",
190 "proportionBps": "250"
191 },
192 {
193 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
194 "to": "0xf939e0a03fb07f59a73314e73794be0e57ac1b4e",
195 "source": "Curve",
196 "proportionBps": "250"
197 },
198 {
199 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
200 "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
201 "source": "Uniswap_V3",
202 "proportionBps": "250"
203 },
204 {
205 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
206 "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
207 "source": "Uniswap_V3",
208 "proportionBps": "750"
209 },
210 {
211 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
212 "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
213 "source": "Uniswap_V3",
214 "proportionBps": "250"
215 },
216 {
217 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
218 "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
219 "source": "PancakeSwap_V3",
220 "proportionBps": "250"
221 },
222 {
223 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
224 "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
225 "source": "Uniswap_V2",
226 "proportionBps": "750"
227 },
228 {
229 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
230 "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
231 "source": "0x_RFQ",
232 "proportionBps": "83"
233 },
234 {
235 "from": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
236 "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
237 "source": "0x_RFQ",
238 "proportionBps": "84"
239 },
240 {
241 "from": "0xdac17f958d2ee523a2206206994597c13d831ec7",
242 "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
243 "source": "Curve",
244 "proportionBps": "1942"
245 },
246 {
247 "from": "0xdac17f958d2ee523a2206206994597c13d831ec7",
248 "to": "0xf939e0a03fb07f59a73314e73794be0e57ac1b4e",
249 "source": "Curve",
250 "proportionBps": "323"
251 },
252 {
253 "from": "0xdac17f958d2ee523a2206206994597c13d831ec7",
254 "to": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
255 "source": "Uniswap_V3",
256 "proportionBps": "86"
257 },
258 {
259 "from": "0xdac17f958d2ee523a2206206994597c13d831ec7",
260 "to": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
261 "source": "0x_RFQ",
262 "proportionBps": "21"
263 },
264 {
265 "from": "0xdac17f958d2ee523a2206206994597c13d831ec7",
266 "to": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
267 "source": "0x_RFQ",
268 "proportionBps": "21"
269 },
270 {
271 "from": "0xdac17f958d2ee523a2206206994597c13d831ec7",
272 "to": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
273 "source": "0x_RFQ",
274 "proportionBps": "22"
275 },
276 {
277 "from": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
278 "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
279 "source": "0x_RFQ",
280 "proportionBps": "57"
281 },
282 {
283 "from": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
284 "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
285 "source": "0x_RFQ",
286 "proportionBps": "57"
287 },
288 {
289 "from": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
290 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
291 "source": "Uniswap_V3",
292 "proportionBps": "38"
293 },
294 {
295 "from": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
296 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
297 "source": "Uniswap_V3",
298 "proportionBps": "1696"
299 },
300 {
301 "from": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
302 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
303 "source": "Curve",
304 "proportionBps": "343"
305 },
306 {
307 "from": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
308 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
309 "source": "0x_RFQ",
310 "proportionBps": "133"
311 },
312 {
313 "from": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
314 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
315 "source": "0x_RFQ",
316 "proportionBps": "19"
317 },
318 {
319 "from": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
320 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
321 "source": "0x_RFQ",
322 "proportionBps": "58"
323 },
324 {
325 "from": "0xf939e0a03fb07f59a73314e73794be0e57ac1b4e",
326 "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
327 "source": "Curve",
328 "proportionBps": "573"
329 },
330 {
331 "from": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
332 "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
333 "source": "Maker_PSM",
334 "proportionBps": "6944"
335 }
336 ],
337 "tokens": [
338 {
339 "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
340 "symbol": "WETH"
341 },
342 {
343 "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
344 "symbol": "USDT"
345 },
346 {
347 "address": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
348 "symbol": "WBTC"
349 },
350 {
351 "address": "0xf939e0a03fb07f59a73314e73794be0e57ac1b4e",
352 "symbol": "crvUSD"
353 },
354 {
355 "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
356 "symbol": "USDC"
357 },
358 {
359 "address": "0x6b175474e89094c44da98b954eedeac495271d0f",
360 "symbol": "DAI"
361 }
362 ]
363 },
364 "sellAmount": "100000000000000000000000",
365 "sellToken": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
366 "tokenMetadata": {
367 "buyToken": {
368 "buyTaxBps": "0",
369 "sellTaxBps": "0"
370 },
371 "sellToken": {
372 "buyTaxBps": "0",
373 "sellTaxBps": "0"
374 }
375 },
376 "totalNetworkFee": "54779430334381092",
377 "transaction": {
378 "to": "0x0d0e364aa7852291883c162b22d6d81f6355428f",
379 "data": "0x1fff991f000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa...truncated...",
380 "gas": "53043726",
381 "gasPrice": "1032722142",
382 "value": "0"
383 },
384 "zid": "0x4394c57eeb18c52d02b7516f"
385}

Gasless API v2

Sample Request and Response

See full list of required query parameters and responses here.

Request

$curl --request GET \
> --url 'https://api.0x.org/gasless/quote?chainId=8453&sellToken=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&buyToken=0x4200000000000000000000000000000000000006&sellAmount=100000000&taker=0x4D2A422dB44144996E855ce15FB581a477dbB947' \
> --header '0x-api-key: YOUR_API_KEY'
$ --header '0x-version: v2'

Response

Expand to see response
1{
2 "approval": {
3 "type": "permit",
4 "hash": "0x334281749a8d1c7e518024109ee8f31c5e55109764efa33b2864a6ab26d90889",
5 "eip712": {
6 "types": {
7 "EIP712Domain": [
8 {
9 "name": "name",
10 "type": "string"
11 },
12 {
13 "name": "version",
14 "type": "string"
15 },
16 {
17 "name": "chainId",
18 "type": "uint256"
19 },
20 {
21 "name": "verifyingContract",
22 "type": "address"
23 }
24 ],
25 "Permit": [
26 {
27 "name": "owner",
28 "type": "address"
29 },
30 {
31 "name": "spender",
32 "type": "address"
33 },
34 {
35 "name": "value",
36 "type": "uint256"
37 },
38 {
39 "name": "nonce",
40 "type": "uint256"
41 },
42 {
43 "name": "deadline",
44 "type": "uint256"
45 }
46 ]
47 },
48 "domain": {
49 "name": "USD Coin",
50 "version": "2",
51 "chainId": 8453,
52 "verifyingContract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
53 },
54 "message": {
55 "owner": "0x4d2a422db44144996e855ce15fb581a477dbb947",
56 "spender": "0x000000000022d473030f116ddee9f6b43ac78ba3",
57 "value": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
58 "nonce": 1,
59 "deadline": "1720033166"
60 },
61 "primaryType": "Permit"
62 }
63 },
64 "blockNumber": "16621609",
65 "buyAmount": "28520257810978",
66 "buyToken": "0x4200000000000000000000000000000000000006",
67 "fees": {
68 "integratorFee": null,
69 "zeroExFee": {
70 "amount": "150",
71 "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
72 "type": "volume"
73 },
74 "gasFee": {
75 "amount": "5842",
76 "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
77 "type": "gas"
78 }
79 },
80 "issues": {
81 "allowance": null,
82 "balance": null,
83 "simulationIncomplete": false,
84 "invalidSourcesPassed": []
85 },
86 "liquidityAvailable": true,
87 "minBuyAmount": "28434697037546",
88 "route": {
89 "fills": [
90 {
91 "from": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
92 "to": "0x4200000000000000000000000000000000000006",
93 "source": "Solidly_V3",
94 "proportionBps": "10000"
95 }
96 ],
97 "tokens": [
98 {
99 "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
100 "symbol": "USDC"
101 },
102 {
103 "address": "0x4200000000000000000000000000000000000006",
104 "symbol": "WETH"
105 }
106 ]
107 },
108 "sellAmount": "99850",
109 "sellToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
110 "target": "0x5ce929ddb01804bff35b2f5c77b735bdb094aac8",
111 "trade": {
112 "type": "settler_metatransaction",
113 "hash": "0xf8b1cea260453fabbeb8d38195e3f034b638714553084753bbe83f4d2aaa45ba",
114 "eip712": {
115 "types": {
116 "PermitWitnessTransferFrom": [
117 {
118 "name": "permitted",
119 "type": "TokenPermissions"
120 },
121 {
122 "name": "spender",
123 "type": "address"
124 },
125 {
126 "name": "nonce",
127 "type": "uint256"
128 },
129 {
130 "name": "deadline",
131 "type": "uint256"
132 },
133 {
134 "name": "slippageAndActions",
135 "type": "SlippageAndActions"
136 }
137 ],
138 "EIP712Domain": [
139 {
140 "name": "name",
141 "type": "string"
142 },
143 {
144 "name": "chainId",
145 "type": "uint256"
146 },
147 {
148 "name": "verifyingContract",
149 "type": "address"
150 }
151 ],
152 "TokenPermissions": [
153 {
154 "name": "token",
155 "type": "address"
156 },
157 {
158 "name": "amount",
159 "type": "uint256"
160 }
161 ],
162 "SlippageAndActions": [
163 {
164 "name": "recipient",
165 "type": "address"
166 },
167 {
168 "name": "buyToken",
169 "type": "address"
170 },
171 {
172 "name": "minAmountOut",
173 "type": "uint256"
174 },
175 {
176 "name": "actions",
177 "type": "bytes[]"
178 }
179 ]
180 },
181 "domain": {
182 "name": "Permit2",
183 "chainId": 8453,
184 "verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3"
185 },
186 "message": {
187 "permitted": {
188 "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
189 "amount": "100000"
190 },
191 "spender": "0x5ce929ddb01804bff35b2f5c77b735bdb094aac8",
192 "nonce": "2241959297937691820908574931991566",
193 "deadline": "1720032866",
194 "slippageAndActions": {
195 "recipient": "0x4d2a422db44144996e855ce15fb581a477dbb947",
196 "buyToken": "0x4200000000000000000000000000000000000006",
197 "minAmountOut": "28434697037546",
198 "actions": [
199 "0x0dfeb4190000000000000000000000005ce929ddb01804bff35b2f5c77b735bdb094aac8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000000186a00000000000000000000000000000000000006e898131631616b1779bad70bc0e0000000000000000000000000000000000000000000000000000000066859e62",
200 "0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000000000257000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000009f6601854dee374b1bfaf6350ffd27a97309d431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
201 "0x38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000000002710000000000000000000000000551a0e3d267bea87048f08cc94cc6035ad99221b000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000084c31b8d7a0000000000000000000000005ce929ddb01804bff35b2f5c77b735bdb094aac80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001860a000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d2500000000000000000000000000000000000000000000000000000000"
202 ]
203 }
204 },
205 "primaryType": "PermitWitnessTransferFrom"
206 }
207 }
208}

0x Contracts

This section provides an overview of the three main contracts developers need to understand when working with the 0x API - AllowanceHolder, Permit2, 0x Settler. For more in-depth details, refer to the 0x Contracts section.

A Note About Setting Token Allowances

  • NEVER set an allowance on the 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.

  • ONLY set allowances on AllowanceHolder or Permit2 contracts, as indicated by the API responses.

  • The correct allowance target is returned in issues.allowance.spender or allowanceTarget.

0x Settler

The 0x Settler contract is the core execution layer of 0x v2, designed for flexibility and security. It is responsible for executing swaps without requiring passive token allowances.

⚠️ Important: Never set token allowances directly on the Settler contract — this will result in lost funds.

Key Points:

  • When using /swap/permit2, Settler is the entry point contract (where you send data).
  • Its address changes dynamically per deployment. The correct contract address is always returned in transaction.to by the API.

Further reading: 0x Settler

AllowanceHolder is the default and recommended allowance contract for most integrators. It provides a better UX, lower gas costs, and is designed to minimize common integration pitfalls that can occur with using Permit2.

Why use AllowanceHolder?

  • Gas efficiency: Lower approval and execution costs than Permit2.
  • Safer defaults: Reduces the chance of errors during integration.
  • Simple UX: Works with standard approval flows without requiring double signatures, unlike Permit2.
  • Equal Safety: Security guarantees are equivalent to Permit2.

AllowanceHolder is recommended for most integrators, and it is especially well-suited for:

  • Teams aggregating multiple liquidity sources and aiming for a consistent user experience across wallets.
  • Developers upgrading from Swap v1 (similar integration flow).
  • Integration with advanced wallets (multisigs, smart contract wallets)

Endpoints:

Key Points:

  • The correct allowance target will be returned in issues.allowance.spender or allowanceTarget.
  • More flexible than the traditional contract-wide approvals.
  • Contract addresses are chain-specific, and can be hardcoded. Always verify with the official documentation before hardcoding:
    • 0x0000000000001fF3684f28c67538d4D072C22734Cancun hardfork chains (Ethereum Mainnet, Arbitrum, Avalanche, Base, Berachain, Blast, BSC, Ink, Linea, Mode, Monad, Optimism, Plasma, Polygon, Scroll, Sonic, Unichain, World Chain)
    • 0x0000000000005E88410CcDFaDe4a5EfaE4b49562Shanghai hardfork chains (Mantle)

Further Reading: AllowanceHolder Contract

Permit2 (Advanced Use Only)

Permit2, developed by Uniswap, enables flexible approvals with features like time-limited and granular allowances. It can be powerful, but it introduces risks that new integrators must be careful with

⚠️ Permit2 is for advanced integrators only.

If you use Permit2, ONLY set allowances on Permit2. NEVER set an allowance on the Settler contract. Setting an allowance on Settler WILL result in loss of funds.

When to use Permit2:

  • Your app requires time-limited or granular approvals that AllowanceHolder does not support.
  • Your users already have infinite allowances set on Permit2 via another app — no reset is needed.

Endpoints:

Key Points:

  • The correct allowance target will be returned in issues.allowance.spender or allowanceTarget.
  • Requires a double-signature flow. This is more complex to integrate but allows for features like time-limited approvals.
  • Permit2 is deployed to 0x000000000022D473030F116dDEE9F6B43aC78BA3 across all chains. You can hardcode this address in your integration.

Further Reading: Permit2