Answers to commonly asked questions
0x000000000022D473030F116dDEE9F6B43aC78BA3
.
The zkSync’s Permit2 address is: 0x0000000000225e31D15943971F47aD3022F714Fa
.
routingPreference
is set to BEST_PRICE
, the endpoint will attempt to find a quote that nets users the best execution price for a trade. Assuming the protocols
are not limited, the endpoint will attempt to get a gasless order and a Uniswap Protocol swap quote, calculate which is currently providing the best price to the user including transaction costs, and return that quote.
Integrators of the API who only want gasless quotes may limit the protocols
considered to just gasless options (e.g. UniswapX - see Swap Routing for more details).
There are some scenarios where the API will not be able to get a gasless quote, even if the integrator attempts to force it. The most common reason for this is that the gas price of the swap is too high relative to the value of the trade. In cases where gas cost is 20% or more of the total trade value, the API will always return Uniswap Protocol swap quotes (if permitted by protocols
) or fail.
/swap
endpoint, you may request for the calldata that we generate to be simulated to further ensure that the calldata is valid and will be processed. (Note that simulation is not a guarantee that a swap will be successful on chain as factors including gas and slippage may change between the time of the /swap response and you placing the transaction on chain).