getQuote

:pencil2: Understanding getQuote

  • getQuote calculates and returns the quote price for the swap (the amount of toTokenAddress tokens you'll receive) alongside details about the swap. It takes:
    • address - string.
    • Swap information object:
      • fromTokenAddress - string.
      • toTokenAddress - string.
      • amount - string.

Query example

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "particle_swap_getQuote",
  "params": [
    "0x369aa8a7a7BE683E1a46d9A056806B2B3FD778C8", // wallet address
    {
      "fromTokenAddress": "0x111111111117dc0aa78b770fa6a738034120c302",
      "toTokenAddress": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
      "amount": "1000000000"
    }
  ]
}
Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!