What's New in v2.3.3
With version 2.3.3 Route object has more properties.
Route object now includes
swapFee
tokenInUsd
tokenOutUsd
priceImpactPercentage
alongside existing properties.
swapFee
: Fee that Symphony gets on execution of Route.tokenInUsd
: USD value of a tokenIn. Returns0
if value is not found.tokenOutUsd
: USD value of a tokenOut. Returns0
if value is not found.priceImpactPercentage
: Price impact percentage that Route has. Difference between market price and estimated output of the Route considering trade size. Could be positive due to efficient routing provided by Symphony. Returns0
if value is not found.
Example Response
const route = await symphony.getRoute(tokenIn, tokenOut, "1.0");
//route
{
amountIn: 1000000000000000000n;
amountInFormatted: "1";
amountOut: 253170n;
amountOutFormatted: "0.25317";
getWalletClient: () => this.walletClient;
includesNative: true;
options: {
isRaw: false;
}
pathCount: 1;
pathPercentages: [100];
priceImpactPercentage: 4.16; // 4.16% price impact will be received on this trade.
//Note that it is a positive price impact trade.
route: [Array(3)];
swapFee: "0"; // Swapping with Symphony is free!
tokenIn: "0x0";
tokenInUsd: 0.242925746429; // 1 SEI = 0.24 USD
tokenOut: "0x3894085ef7ff0f0aedf52e2a2704928d1ec074f1";
tokenOutUsd: 0.999527926861; // 1 USDC = 0.99952 USD
}