API v6.2

Introduction to ParaSwap API v6.2

ParaSwap v6.2 has been released! See what's new here: https://twitter.com/paraswap/status/1803435422011498551

To switch to v6.2, you only need to pass &version=6.2 to /prices & you're good to go!

ParaSwap V6.2's main goal is to provide the best possible gas-optimized protocol for order routing. The V6.2 comes with significant improvements in terms of smart-contract architecture that achieve both best-in-class gas efficiency and scalability through modularity.

To use V6.2, you need to pass &version=6.2 query param when calling /prices. The process for swapping remains the same:

  • Call GET /prices to retrieve an optimal price for a given pair & amount.

  • Call POST /transactions for retrieving the Transaction Object that includes the calldata

  • Alternatively, you can use GET /swap to retrieve both the price config & Transaction Object.

You can also use the JavaScript/TypeScript SDK for easier integrations: https://github.com/paraswap/paraswap-sdk

  • No longer need to approve a different smart contract for ERC20 tokens. Augustus V6.2 is the only contract you need to interact with. More details here.

  • More control over partner fees: should you choose to take a surplus fee, you can cap it to 1% of the trade volume as protection for your users if it applies to your specific case. You can also sent partner fees directly to the user. Take a look at new params (isCapSurplus , isSurplusToUser , isDirectFeeTransfer) params in /transactions section.

  • Flat fees are capped at 2% as a security protection for users.

  • excludeDirectContractMethods is no longer supported in /prices, it's replaced by excludeContractMethodsWithoutFeeModel if you want to make sure all swaps can monetize. (ie. swaps fees don't work when swapOnUniswap, swapOnUniswapFork, swapOnZeroXv2, and swapOnZeroXv4 etc. contract methods are used.)

Supported methods:

SELL:

  • swapExactAmountIn

  • swapExactAmountInOnUniswapV2

  • swapExactAmountInOnUniswapV3

  • swapExactAmountInOnBalancerV2

  • swapExactAmountInOnCurveV1

  • swapExactAmountInOnCurveV2

  • swapOnAugustusRFQTryBatchFill

  • swapExactAmountInOutOnMakerPSM

BUY:

  • swapExactAmountOut

  • swapExactAmountOutOnUniswapV2

  • swapExactAmountOutOnUniswapV3

  • swapExactAmountOutOnBalancerV2

  • swapOnAugustusRFQTryBatchFill

  • swapExactAmountInOutOnMakerPSM

Last updated