Paraswap Docs
Search…
V4 to V5 Migration
ParaSwap Migration Document for changes from v4 to v5
Here are the important changes from ParaSwap API v4 to v5:

1. /prices endpoint:

  • Renamed Parameters:
    (Note: only the parameter name has changed, the content remains the same).
    • X-Partner (in Headers) → partner (in query): partner/referrer string.
    • fromsrcToken(Source Token Address).
    • todestToken (Destination Token Address).
    • fromDecimalssrcDecimals (Source Token Decimals).
    • toDecimalsdestDecimals (Destination Token Decimals)
  • Change in Response Body:
    • The response body of the /prices endpoint has changed to be uniform for all routing methods: simpleSwap, multiPath, and megaPath prices responses. Please infer to this example to understand the response body structure.
      1
      {
      2
      "priceRoute": {
      3
      "blockNumber": 13036269,
      4
      "network": 1,
      5
      "src": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
      6
      "srcDecimals": 18,
      7
      "srcAmount": "10000000000000000",
      8
      "dest": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      9
      "destDecimals": 6,
      10
      "destAmount": "32704734",
      11
      "bestRoute": [
      12
      {
      13
      "percent": 100,
      14
      "swaps": [
      15
      {
      16
      "src": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
      17
      "srcDecimals": 18,
      18
      "dest": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      19
      "destDecimals": 6,
      20
      "swapExchanges": [
      21
      {
      22
      "exchange": "UniswapV2",
      23
      "srcAmount": "10000000000000000",
      24
      "destAmount": "32704734",
      25
      "percent": 100,
      26
      "data": {
      27
      "router": "0x0000000000000000000000000000000000000000",
      28
      "path": [
      29
      "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      30
      "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
      31
      ],
      32
      "factory": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
      33
      "initCode": "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",
      34
      "feeFactor": 10000,
      35
      "pools": [
      36
      {
      37
      "address": "0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc",
      38
      "fee": 30,
      39
      "direction": false
      40
      }
      41
      ],
      42
      "gasUSD": "9.835332"
      43
      }
      44
      }
      45
      ]
      46
      }
      47
      ]
      48
      }
      49
      ],
      50
      "gasCostUSD": "13.700002",
      51
      "gasCost": "111435",
      52
      "side": "SELL",
      53
      "tokenTransferProxy": "0x0000000000000000000000000000000000000000",
      54
      "contractAddress": "0x0000000000000000000000000000000000000000",
      55
      "contractMethod": "swapOnUniswap",
      56
      "partnerFee": 0,
      57
      "srcUSD": "32.7332000000",
      58
      "destUSD": "32.5799000303",
      59
      "partner": "paraswap",
      60
      "maxImpactReached": false,
      61
      "hmac": "cf2ac4b20f83b6656eb9dd28e26414658430e1d5"
      62
      }
      63
      }
      Copied!
  • Other Important changes:
    • The spender parameter in the response body has been changed to the tokenTransferProxy parameter.
    • Everywhere from and to token-parameters are renamed to srcToken & destToken.

2. /transactions endpoint

  • Added Parameters:
    • slippage: Could be used instead of destAmount in SELL orders and srcAmount in BUY orders. It will automatically take the quote amount to be the optimal price minus slippage.
    • partnerAddress: Partner Address.
    • partnerFeeBps: Used together with Partner Address.
      Note: Instead of X-partners header or referrer parameter, use partner(if referrer string is available) or partnerAddress if partner address is available.
  • Removed Parameters:
    • useReduxToken: REDUX token has been discontinued in v5.
    • X-Partner (in Headers).
  • Renamed Parameters:
    • fromDecimalssrcDecimals (Source Token Decimals).
    • toDecimalsdestDecimals (Destination Token Decimals)
  • Other Changes:
    • network has become a required parameter in /transactions endpoint.
Last modified 3mo ago
Export as PDF
Copy link