💻Aggregator API
Explore authentication, endpoints, and trading operations to start trading efficiently. Whether you're a developer or a trader, this guide has everything you need to get started with Panora's APIs.
1. Get transaction details for the swap
POST
https://api.panora.exchange/swap
Headers
Public API Key:
Note: For large-scale apps, please raise a ticket on Discord for a dedicated key.
Name | Value | Description |
---|---|---|
x-api-key | Your API Key | Use the public API key or enter the API key provided by Panora |
Query Parameters
Note: Panora's APIs supports the following.
ExactIn Swap: When fromTokenAmount is entered, the endpoint returns the maximum toTokenAmount that will be received. Example: If the fromToken is APT, fromTokenAmount is 10.5 and toToken is lzUSDC, then the toTokenAmount response is the maximum lzUSDC a user would receive for swapping from 10.5 APT.
ExactOut Swap: When toTokenAmount is entered, the endpoint returns the minimum fromTokenAmount that has to be paid. Example: If the toToken is lzUSDC, toTokenAmount is 100 and fromToken is APT, then the fromTokenAmount response is the minimum APT a user would pay for swapping to 100 lzUSDC.
Parameter | Required | Type | Description |
---|---|---|---|
chainId | no | number | ID for the chain for which the endpoint is being invoked. Note: Default chainID is 1 for Aptos Mainnet |
fromTokenAddress | yes | string | Address of the token being swapped from
Example: If you want to swap 10.5 APT to lzUSDC, then fromTokenAddress is |
toTokenAddress | yes | string | Address of the token being swapped to
Example: If you want to swap 10.5 APT to lzUSDC, then toTokenAddress is |
fromTokenAmount | * | number | Amount of the token being swapped from. Please set the amount without Token decimals Example: If you want to swap 10.5 APT to lzUSDC, then fromTokenAmount is 10.5 |
toTokenAmount | yes* | number | Amount of the token being swapped to. Please set the amount without Token decimals Example: If you want to swap from APT to 100 lzUSDC, then toTokenAmount is 100 |
toWalletAddress | yes | string | Address of the wallet to which the swapped tokens will be sent |
slippagePercentage | no | number | Slippage tolerance as 'auto' (which lets Panora choose the optimal slippage for the transaction, up to a maximum of 5%) or a percentage value. Example: For 3% slippage tolerance, set the value as 3. This can be set as 0.1, 0.5, 1.0 or any custom slippage percentage between 0 and 100. Note: If nothing is entered, slippage tolerance will be set to auto by default. If a numeric value is entered, anything after four decimals will be truncated. |
integratorFeePercentage | no | number | Integrator fee as a percentage value Example: For 2% integrator fee, set the value as 2. This can be set as 0.1, 0.5, 1.0 or any custom integrator fee between 0 and 2. Note: Fee sharing applicable. If nothing is entered, integrator fee will be set to 0 by default. Anything after four decimals will be truncated. |
integratorFeeAddress | no | string | Wallet Address where integrators want to receive their fee share. Note: Ensure it starts with 0x followed by 64 characters |
includeSources | no | string | List of liquidity sources to be included for route calculation. Example: ["Thala", "Liquidswap"] Note: If nothing is entered, all available sources are included by default. |
excludeSources | no | string | List of liquidity sources to be excluded from the route. Example: ["Aux"] Note: If nothing is entered, none of the sources will be excluded by default. |
onlyDirectRoutes | no | boolean | Set to true to restrict to direct routes without intermediate hops or splits. Example: For direct swaps without hops or splits, set to true. Default is false. |
*Please send either fromTokenAmount or toTokenAmount at a time.
Request Example
Response Parameters
Scenario 1: For ExactIn Swap where fromTokenAmount is entered (instead of toTokenAmount), the endpoint returns the maximum toTokenAmount
Name | Type | Description |
---|---|---|
fromToken | object | An object containing the details of the fromToken, which includes |
toToken | object | An object containing the details of the toToken, which includes |
fromTokenAmount | string | Amount of token being swapped from Note: Amount is without Token decimals |
fromTokenAmountUSD | string | USD equivalent of fromTokenAmount Note: Will be null for those tokens whose usd price is not available from external price feeds |
quotes | array | An array of objects containing the swap details, in the decreasing order of toTokenAmount. Each object consists of:
|
status Code |
|
Scenario 2: For ExactOut Swap where toTokenAmount is entered (instead of fromTokenAmount), the endpoint returns the minimum toTokenAmount
Name | Type | Description |
---|---|---|
fromToken | object | An object containing the details of the fromToken, which includes |
toToken | object | An object containing the details of the toToken, which includes |
toTokenAmount | string | Amount of token user desires to get after the swap Note: Amount is without Token decimals |
toTokenAmountUSD | string | USD equivalent of toTokenAmount. Note: Will be null for those tokens whose usd price is not available from external price feeds |
quotes | array | An array of objects containing the swap details, in the increasing order of fromTokenAmount
Note: Values are of type string |
status code |
|
2. Get quote for the swap
GET
https://api.panora.exchange/swap/quote
Headers
Public API Key:
Note: For large-scale apps, please raise a ticket on Discord for a dedicated key.
Name | Value | Description |
---|---|---|
x-api-key | Your API Key | Use the public API key or enter the API key provided by Panora |
Query Parameters
Parameter | Required | Type | Description |
---|---|---|---|
chainId | no | number | ID for the chain for which the endpoint is being invoked. Note: Default chainID is 1 for Aptos Mainnet |
fromTokenAddress | yes | string | Address of the token being swapped from
Example: If you want to swap 10.5 APT to lzUSDC, then fromTokenAddress is |
toTokenAddress | yes | string | Address of the token being swapped to
Example: If you want to swap 10.5 APT to lzUSDC, then toTokenAddress is |
fromTokenAmount | * | number | Amount of the token being swapped from. Please set the amount without Token decimals Example: If you want to swap 10.5 APT to lzUSDC, then fromTokenAmount is 10.5 |
toTokenAmount | yes* | number | Amount of the token being swapped to. Please set the amount without Token decimals |
slippagePercentage | no | number | Slippage tolerance as 'auto' (which lets Panora choose the optimal slippage for the transaction, up to a maximum of 5%) or a percentage value. Example: For 3% slippage tolerance, set the value as 3. This can be set as 0.1, 0.5, 1.0 or any custom slippage percentage between 0 and 100. Note: If nothing is entered, slippage tolerance will be set to auto by default. If a numeric value is entered, anything after four decimals will be truncated. |
integratorFeePercentage | no | number | Integrator fee as a percentage value Example: For 2% integrator fee, set the value as 2. This can be set as 0.1, 0.5, 1.0 or any custom integrator fee between 0 and 2. Note: Fee sharing applicable. If nothing is entered, integrator fee will be set to 0 by default. Anything after four decimals will be truncated. |
integratorFeeAddress | no | string | Wallet Address where integrators want to receive their fee share. Note: Ensure it starts with 0x followed by 64 characters |
includeSources | no | string | List of liquidity sources to be included for route calculation. Example: ["Thala", "Liquidswap"] Note: If nothing is entered, all available sources are included by default. |
excludeSources | no | string | List of liquidity sources to be excluded from the route. Example: ["Aux"] Note: If nothing is entered, none of the sources will be excluded by default. |
onlyDirectRoutes | no | boolean | Set to true to restrict to direct routes without intermediate hops or splits. Example: For direct swaps without hops or splits, set to true. Default is false. |
*Please send either fromTokenAmount or toTokenAmount at a time.
Request Example
Response Parameters
Scenario 1: For ExactIn Swap where fromTokenAmount is entered (instead of toTokenAmount), the endpoint returns the maximum toTokenAmount
Name | Type | Description |
---|---|---|
fromToken | object | An object containing the details of the fromToken, which includes |
toToken | object | An object containing the details of the toToken, which includes |
fromTokenAmount | string | Amount of token being swapped from Note: Amount is without Token decimals |
fromTokenAmountUSD | string | USD equivalent of fromTokenAmount Note: Will be null for those tokens whose usd price is not available from external price feeds |
quotes | array | An array of objects containing the swap details, in the decreasing order of toTokenAmount. Each object consists of:
|
status Code |
|
Scenario 2: For ExactOut Swap where toTokenAmount is entered (instead of fromTokenAmount), the endpoint returns the minimum fromTokenAmount
Name | Type | Description |
---|---|---|
fromToken | object | An object containing the details of the fromToken, which includes |
toToken | object | An object containing the details of the toToken, which includes |
toTokenAmount | string | Amount of token user desires to get after the swap Note: Amount is without Token decimals |
toTokenAmountUSD | string | USD equivalent of toTokenAmount. Note: Will be null for those tokens whose usd price is not available from external price feeds |
quotes | array | An array of objects containing the swap details, in the increasing order of fromTokenAmount
|
status code |
|
Last updated