Result of getting a swap price.

interface GetSwapPriceResult {
    blockNumber: bigint;
    fees: SwapFees;
    fromAmount: bigint;
    fromToken: `0x${string}`;
    gas?: bigint;
    gasPrice?: bigint;
    issues: SwapIssues;
    liquidityAvailable: true;
    minToAmount: bigint;
    toAmount: bigint;
    toToken: `0x${string}`;
}

Properties

blockNumber: bigint

The block number at which the liquidity conditions were examined.

fees: SwapFees

The estimated fees for the swap.

fromAmount: bigint

The amount to send in atomic units of the token.

fromToken: `0x${string}`

The token to send (source token).

gas?: bigint

The gas estimate for the swap.

gasPrice?: bigint

The gas price in Wei.

issues: SwapIssues

Potential issues discovered during validation.

liquidityAvailable: true

Whether liquidity is available for the swap.

minToAmount: bigint

The minimum amount to receive after slippage in atomic units of the token.

toAmount: bigint

The amount to receive in atomic units of the token.

toToken: `0x${string}`

The token to receive (destination token).