Euler
Search…
Contract Reference

IEuler

Main storage contract for the Euler system

moduleIdToImplementation

Lookup the current implementation contract for a module
1
function moduleIdToImplementation(uint moduleId) external view returns (address);
Copied!
Parameters:
  • moduleId: Fixed constant that refers to a module type (ie MODULEID__ETOKEN)
Returns:
  • An internal address specifies the module's implementation code

moduleIdToProxy

Lookup a proxy that can be used to interact with a module (only valid for single-proxy modules)
1
function moduleIdToProxy(uint moduleId) external view returns (address);
Copied!
Parameters:
  • moduleId: Fixed constant that refers to a module type (ie MODULEID__MARKETS)
Returns:
  • An address that should be cast to the appropriate module interface, ie IEulerMarkets(moduleIdToProxy(2))

AssetConfig

Euler-related configuration for an asset
1
struct AssetConfig {
2
address eTokenAddress;
3
bool borrowIsolated;
4
uint32 collateralFactor;
5
uint32 borrowFactor;
6
uint24 twapWindow;
7
}
Copied!

IEulerMarkets

Activating and querying markets, and maintaining entered markets lists

activateMarket

Create an Euler pool and associated EToken and DToken addresses.
1
function activateMarket(address underlying) external returns (address);
Copied!
Parameters:
  • underlying: The address of an ERC20-compliant token. There must be an initialised uniswap3 pool for the underlying/reference asset pair.
Returns:
  • The created EToken, or the existing EToken if already activated.

activatePToken

Create a pToken and activate it on Euler. pTokens are protected wrappers around assets that prevent borrowing.
1
function activatePToken(address underlying) external returns (address);
Copied!
Parameters:
  • underlying: The address of an ERC20-compliant token. There must already be an activated market on Euler for this underlying, and it must have a non-zero collateral factor.
Returns:
  • The created pToken, or an existing one if already activated.

underlyingToEToken

Given an underlying, lookup the associated EToken
1
function underlyingToEToken(address underlying) external view returns (address);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • EToken address, or address(0) if not activated

underlyingToDToken

Given an underlying, lookup the associated DToken
1
function underlyingToDToken(address underlying) external view returns (address);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • DToken address, or address(0) if not activated

underlyingToPToken

Given an underlying, lookup the associated PToken
1
function underlyingToPToken(address underlying) external view returns (address);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • PToken address, or address(0) if it doesn't exist

underlyingToAssetConfig

Looks up the Euler-related configuration for a token, and resolves all default-value placeholders to their currently configured values.
1
function underlyingToAssetConfig(address underlying) external view returns (IEuler.AssetConfig memory);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • Configuration struct

underlyingToAssetConfigUnresolved

Looks up the Euler-related configuration for a token, and returns it unresolved (with default-value placeholders)
1
function underlyingToAssetConfigUnresolved(address underlying) external view returns (IEuler.AssetConfig memory config);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • config: Configuration struct

eTokenToUnderlying

Given an EToken address, looks up the associated underlying
1
function eTokenToUnderlying(address eToken) external view returns (address underlying);
Copied!
Parameters:
  • eToken: EToken address
Returns:
  • underlying: Token address

eTokenToDToken

Given an EToken address, looks up the associated DToken
1
function eTokenToDToken(address eToken) external view returns (address dTokenAddr);
Copied!
Parameters:
  • eToken: EToken address
Returns:
  • dTokenAddr: DToken address

interestRateModel

Looks up an asset's currently configured interest rate model
1
function interestRateModel(address underlying) external view returns (uint);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • Module ID that represents the interest rate model (IRM)

interestRate

Retrieves the current interest rate for an asset
1
function interestRate(address underlying) external view returns (int96);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • The interest rate in yield-per-second, scaled by 10**27

interestAccumulator

Retrieves the current interest rate accumulator for an asset
1
function interestAccumulator(address underlying) external view returns (uint);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • An opaque accumulator that increases as interest is accrued

reserveFee

Retrieves the reserve fee in effect for an asset
1
function reserveFee(address underlying) external view returns (uint32);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • Amount of interest that is redirected to the reserves, as a fraction scaled by RESERVE_FEE_SCALE (4e9)

getPricingConfig

Retrieves the pricing config for an asset
1
function getPricingConfig(address underlying) external view returns (uint16 pricingType, uint32 pricingParameters, address pricingForwarded);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • pricingType: (1=pegged, 2=uniswap3, 3=forwarded)
  • pricingParameters: If uniswap3 pricingType then this represents the uniswap pool fee used, otherwise unused
  • pricingForwarded: If forwarded pricingType then this is the address prices are forwarded to, otherwise address(0)

getEnteredMarkets

Retrieves the list of entered markets for an account (assets enabled for collateral or borrowing)
1
function getEnteredMarkets(address account) external view returns (address[] memory);
Copied!
Parameters:
  • account: User account
Returns:
  • List of underlying token addresses

enterMarket

Add an asset to the entered market list, or do nothing if already entered
1
function enterMarket(uint subAccountId, address newMarket) external;
Copied!
Parameters:
  • subAccountId: 0 for primary, 1-255 for a sub-account
  • newMarket: Underlying token address

exitMarket

Remove an asset from the entered market list, or do nothing if not already present
1
function exitMarket(uint subAccountId, address oldMarket) external;
Copied!
Parameters:
  • subAccountId: 0 for primary, 1-255 for a sub-account
  • oldMarket: Underlying token address

IEulerExec

Batch executions, liquidity check deferrals, and interfaces to fetch prices and account liquidity

LiquidityStatus

Liquidity status for an account, either in aggregate or for a particular asset
1
struct LiquidityStatus {
2
uint collateralValue;
3
uint liabilityValue;
4
uint numBorrows;
5
bool borrowIsolated;
6
}
Copied!

AssetLiquidity

Aggregate struct for reporting detailed (per-asset) liquidity for an account
1
struct AssetLiquidity {
2
address underlying;
3
LiquidityStatus status;
4
}
Copied!

EulerBatchItem

Single item in a batch request
1
struct EulerBatchItem {
2
bool allowError;
3
address proxyAddr;
4
bytes data;
5
}
Copied!

EulerBatchItemResponse

Single item in a batch response
1
struct EulerBatchItemResponse {
2
bool success;
3
bytes result;
4
}
Copied!

liquidity

Compute aggregate liquidity for an account
1
function liquidity(address account) external view returns (LiquidityStatus memory status);
Copied!
Parameters:
  • account: User address
Returns:
  • status: Aggregate liquidity (sum of all entered assets)

detailedLiquidity

Compute detailed liquidity for an account, broken down by asset
1
function detailedLiquidity(address account) external view returns (AssetLiquidity[] memory assets);
Copied!
Parameters:
  • account: User address
Returns:
  • assets: List of user's entered assets and each asset's corresponding liquidity

getPrice

Retrieve Euler's view of an asset's price
1
function getPrice(address underlying) external view returns (uint twap, uint twapPeriod);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • twap: Time-weighted average price
  • twapPeriod: TWAP duration, either the twapWindow value in AssetConfig, or less if that duration not available

getPriceFull

Retrieve Euler's view of an asset's price, as well as the current marginal price on uniswap
1
function getPriceFull(address underlying) external view returns (uint twap, uint twapPeriod, uint currPrice);
Copied!
Parameters:
  • underlying: Token address
Returns:
  • twap: Time-weighted average price
  • twapPeriod: TWAP duration, either the twapWindow value in AssetConfig, or less if that duration not available
  • currPrice: The current marginal price on uniswap3 (informational: not used anywhere in the Euler protocol)

deferLiquidityCheck

Defer liquidity checking for an account, to perform rebalancing, flash loans, etc. msg.sender must implement IDeferredLiquidityCheck
1
function deferLiquidityCheck(address account, bytes memory data) external;
Copied!
Parameters:
  • account: The account to defer liquidity for. Usually address(this), although not always
  • data: Passed through to the onDeferredLiquidityCheck() callback, so contracts don't need to store transient data in storage

batchDispatch

Execute several operations in a single transaction
1
function batchDispatch(EulerBatchItem[] calldata items, address[] calldata deferLiquidityChecks) external returns (EulerBatchItemResponse[] memory);
Copied!
Parameters:
  • items: List of operations to execute
  • deferLiquidityChecks: List of user accounts to defer liquidity checks for
Returns:
  • List of operation results

EulerBatchExtra

Results of a batchDispatch, but with extra information
1
struct EulerBatchExtra {
2
EulerBatchItemResponse[] responses;
3
uint gasUsed;
4
AssetLiquidity[][] liquidities;
5
}
Copied!

batchDispatchExtra

Call batchDispatch, but return extra information. Only intended to be used with callStatic.
1
function batchDispatchExtra(EulerBatchItem[] calldata items, address[] calldata deferLiquidityChecks, address[] calldata queryLiquidity) external returns (EulerBatchExtra memory output);
Copied!
Parameters:
  • items: List of operations to execute
  • deferLiquidityChecks: List of user accounts to defer liquidity checks for
  • queryLiquidity: List of user accounts to return detailed liquidity information for
Returns:
  • output: Structure with extra information

trackAverageLiquidity

Enable average liquidity tracking for your account. Operations will cost more gas, but you may get additional benefits when performing liquidations
1
function trackAverageLiquidity(uint subAccountId, address delegate, bool onlyDelegate) external;
Copied!
Parameters:
  • subAccountId: subAccountId 0 for primary, 1-255 for a sub-account.
  • delegate: An address of another account that you would allow to use the benefits of your account's average liquidity (use the null address if you don't care about this). The other address must also reciprocally delegate to your account.
  • onlyDelegate: Set this flag to skip tracking average liquidity and only set the delegate.

unTrackAverageLiquidity

Disable average liquidity tracking for your account and remove delegate
1
function unTrackAverageLiquidity(uint subAccountId) external;
Copied!
Parameters:
  • subAccountId: subAccountId 0 for primary, 1-255 for a sub-account

getAverageLiquidity

Retrieve the average liquidity for an account
1
function getAverageLiquidity(address account) external returns (uint);
Copied!
Parameters:
  • account: User account (xor in subAccountId, if applicable)
Returns:
  • The average liquidity, in terms of the reference asset, and post risk-adjustment

getAverageLiquidityWithDelegate

Retrieve the average liquidity for an account or a delegate account, if set
1
function getAverageLiquidityWithDelegate(address account) external returns (uint);
Copied!
Parameters:
  • account: User account (xor in subAccountId, if applicable)
Returns:
  • The average liquidity, in terms of the reference asset, and post risk-adjustment

getAverageLiquidityDelegateAccount

Retrieve the account which delegates average liquidity for an account, if set
1
function getAverageLiquidityDelegateAccount(address account) external view returns (address);
Copied!
Parameters:
  • account: User account (xor in subAccountId, if applicable)
Returns:
  • The average liquidity delegate account

pTokenWrap

Transfer underlying tokens from sender's wallet into the pToken wrapper. Allowance should be set for the euler address.
1
function pTokenWrap(address underlying, uint amount) external;
Copied!
Parameters:
  • underlying: Token address
  • amount: The amount to wrap in underlying units

pTokenUnWrap

Transfer underlying tokens from the pToken wrapper to the sender's wallet.
1
function pTokenUnWrap(address underlying, uint amount) external;
Copied!
Parameters:
  • underlying: Token address
  • amount: The amount to unwrap in underlying units

usePermit

Apply EIP2612 signed permit on a target token from sender to euler contract
1
function usePermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
Copied!
Parameters:
  • token: Token address
  • value: Allowance value
  • deadline: Permit expiry timestamp
  • v: secp256k1 signature v
  • r: secp256k1 signature r
  • s: secp256k1 signature s

usePermitAllowed

Apply DAI like (allowed) signed permit on a target token from sender to euler contract
1
function usePermitAllowed(address token, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) external;
Copied!
Parameters:
  • token: Token address
  • nonce: Sender nonce
  • expiry: Permit expiry timestamp
  • allowed: If true, set unlimited allowance, otherwise set zero allowance
  • v: secp256k1 signature v
  • r: secp256k1 signature r
  • s: secp256k1 signature s

usePermitPacked

Apply allowance to tokens expecting the signature packed in a single bytes param
1
function usePermitPacked(address token, uint256 value, uint256 deadline, bytes calldata signature) external;
Copied!
Parameters:
  • token: Token address
  • value: Allowance value
  • deadline: Permit expiry timestamp
  • signature: secp256k1 signature encoded as rsv

doStaticCall

Execute a staticcall to an arbitrary address with an arbitrary payload.
1
function doStaticCall(address contractAddress, bytes memory payload) external view returns (bytes memory);
Copied!
Parameters:
  • contractAddress: Address of the contract to call
  • payload: Encoded call payload
Returns:
  • result: Encoded return data

IEulerEToken

Tokenised representation of assets

name

Pool name, ie "Euler Pool: DAI"
1
function name() external view returns (string memory);
Copied!

symbol

Pool symbol, ie "eDAI"
1
function symbol() external view returns (string memory);
Copied!

decimals

Decimals, always normalised to 18.
1
function decimals() external pure returns (uint8);
Copied!

underlyingAsset

Address of underlying asset
1
function underlyingAsset() external view returns (address);
Copied!

totalSupply

Sum of all balances, in internal book-keeping units (non-increasing)
1
function totalSupply() external view returns (uint);
Copied!

totalSupplyUnderlying

Sum of all balances, in underlying units (increases as interest is earned)
1
function totalSupplyUnderlying() external view returns (uint);
Copied!

balanceOf

Balance of a particular account, in internal book-keeping units (non-increasing)
1
function balanceOf(address account) external view returns (uint);
Copied!

balanceOfUnderlying

Balance of a particular account, in underlying units (increases as interest is earned)
1
function balanceOfUnderlying(address account) external view returns (uint);
Copied!

reserveBalance

Balance of the reserves, in internal book-keeping units (non-increasing)
1
function reserveBalance() external view returns (uint);
Copied!

reserveBalanceUnderlying

Balance of the reserves, in underlying units (increases as interest is earned)
1
function reserveBalanceUnderlying() external view returns (uint);
Copied!

convertBalanceToUnderlying

Convert an eToken balance to an underlying amount, taking into account current exchange rate
1
function convertBalanceToUnderlying(uint balance) external view returns (uint);
Copied!
Parameters:
  • balance: eToken balance, in internal book-keeping units (18 decimals)
Returns:
  • Amount in underlying units, (same decimals as underlying token)

convertUnderlyingToBalance

Convert an underlying amount to an eToken balance, taking into account current exchange rate
1
function convertUnderlyingToBalance(uint underlyingAmount) external view returns (uint);
Copied!
Parameters:
  • underlyingAmount: Amount in underlying units (same decimals as underlying token)
Returns:
  • eToken: balance, in internal book-keeping units (18 decimals)

touch

Updates interest accumulator and totalBorrows, credits reserves, re-targets interest rate, and logs asset status
1
function touch() external;
Copied!

deposit

Transfer underlying tokens from sender to the Euler pool, and increase account's eTokens
1
function deposit(uint subAccountId, uint amount) external;
Copied!
Parameters:
  • subAccountId: 0 for primary, 1-255 for a sub-account
  • amount: In underlying units (use max uint256 for full underlying token balance)

withdraw

Transfer underlying tokens from Euler pool to sender, and decrease account's eTokens
1
function withdraw(uint subAccountId, uint amount) external;
Copied!
Parameters:
  • subAccountId: 0 for primary, 1-255 for a sub-account
  • amount: In underlying units (use max uint256 for full pool balance)

mint

Mint eTokens and a corresponding amount of dTokens ("self-borrow")
1
function mint(uint subAccountId, uint amount) external;
Copied!
Parameters:
  • subAccountId: 0 for primary, 1-255 for a sub-account
  • amount: In underlying units

burn

Pay off dToken liability with eTokens ("self-repay")
1
function burn(uint subAccountId, uint amount) external;
Copied!
Parameters:
  • subAccountId: 0 for primary, 1-255 for a sub-account
  • amount: In underlying units (use max uint256 to repay the debt in full or up to the available underlying balance)

approve

Allow spender to access an amount of your eTokens in sub-account 0
1
function approve(address spender, uint amount) external returns (bool);
Copied!
Parameters:
  • spender: Trusted address
  • amount: Use max uint256 for "infinite" allowance

approveSubAccount

Allow spender to access an amount of your eTokens in a particular sub-account
1
function approveSubAccount(uint subAccountId, address spender, uint amount) external returns (bool);
Copied!
Parameters:
  • subAccountId: 0 for primary, 1-255 for a sub-account
  • spender: Trusted address
  • amount: Use max uint256 for "infinite" allowance

allowance

Retrieve the current allowance
1
function allowance(address holder, address spender) external view returns (uint);
Copied!
Parameters:
  • holder: Xor with the desired sub-account ID (if applicable)
  • spender: Trusted address

transfer

Transfer eTokens to another address (from sub-account 0)
1
function transfer(address to, uint amount) external returns (bool);
Copied!
Parameters:
  • to: Xor with the desired sub-account ID (if applicable)
  • amount: In internal book-keeping units (as returned from balanceOf).

transferFromMax

Transfer the full eToken balance of an address to another
1
function transferFromMax(address from, address to) external returns (bool);
Copied!
Parameters:
  • from: This address must've approved the to address, or be a sub-account of msg.sender
  • to: Xor with the desired sub-account ID (if applicable)

transferFrom

Transfer eTokens from one address to another
1
function transferFrom(address from, address to, uint amount) external returns (bool);
Copied!
Parameters:
  • from: This address must've approved the to address, or be a sub-account of msg.sender
  • to: Xor with the desired sub-account ID (if applicable)
  • amount: In internal book-keeping units (as returned from balanceOf).

IEulerDToken

Tokenised representation of debts

name

Debt token name, ie "Euler Debt: DAI"
1
function name() external view returns (string memory);
Copied!

symbol

Debt token symbol, ie "dDAI"
1
function symbol() external view returns (string memory);
Copied!

decimals

Decimals of underlying
1
function decimals() external view returns (uint8);
Copied!

underlyingAsset

Address of underlying asset
1
function underlyingAsset() external view returns (address);
Copied!

totalSupply

Sum of all outstanding debts, in underlying units (increases as interest is accrued)
1
function totalSupply() external view returns (uint);
Copied!

totalSupplyExact

Sum of all outstanding debts, in underlying units normalized to 27 decimals (increases as interest is accrued)
1
function totalSupplyExact() external view returns (uint);
Copied!

balanceOf

Debt owed by a particular account, in underlying units
1
function balanceOf(address account) external view returns (uint);
Copied!

balanceOfExact

Debt owed by a particular account, in underlying units normalized to 27 decimals
1
function balanceOfExact(address account) external view returns (uint);
Copied!

borrow

Transfer underlying tokens from the Euler pool to the sender, and increase sender's dTokens
1
function borrow(uint subAccountId, uint amount) external;
Copied!
Parameters:
  • subAccountId: 0 for primary, 1-255 for a sub-account
  • amount: In underlying units (use max uint256 for all available tokens)

repay

Transfer underlying tokens from the sender to the Euler pool, and decrease sender's dTokens
1
function repay(uint subAccountId, uint amount) external;
Copied!
Parameters:
  • subAccountId: 0 for primary, 1-255 for a sub-account
  • amount: In underlying units (use max uint256 for full debt owed)

approveDebt

Allow spender to send an amount of dTokens to a particular sub-account
1
function approveDebt(uint subAccountId, address spender, uint amount) external returns (bool);
Copied!
Parameters:
  • subAccountId: 0 for primary, 1-255 for a sub-account
  • spender: Trusted address
  • amount: In underlying units (use max uint256 for "infinite" allowance)

debtAllowance

Retrieve the current debt allowance
1
function debtAllowance(address holder, address spender) external view returns (uint);
Copied!
Parameters:
  • holder: Xor with the desired sub-account ID (if applicable)
  • spender: Trusted address

transfer

Transfer dTokens to another address (from sub-account 0)
1
function transfer(address to, uint amount) external returns (bool);
Copied!
Parameters:
  • to: Xor with the desired sub-account ID (if applicable)
  • amount: In underlying units. Use max uint256 for full balance.

transferFrom

Transfer dTokens from one address to another
1
function transferFrom(address from, address to, uint amount) external returns (bool);
Copied!
Parameters:
  • from: Xor with the desired sub-account ID (if applicable)
  • to: This address must've approved the from address, or be a sub-account of msg.sender
  • amount: In underlying units. Use max uint256 for full balance.

IEulerLiquidation

Liquidate users who are in collateral violation to protect lenders

LiquidationOpportunity

Information about a prospective liquidation opportunity
1
struct LiquidationOpportunity {
2
uint repay;
3
uint yield;
4
uint healthScore;
5
6
// Only populated if repay > 0:
7
uint baseDiscount;
8
uint discount;
9
uint conversionRate;
10
}
Copied!

checkLiquidation

Checks to see if a liquidation would be profitable, without actually doing anything
1
function checkLiquidation(address liquidator, address violator, address underlying, address collateral) external returns (LiquidationOpportunity memory liqOpp);
Copied!
Parameters:
  • liquidator: Address that will initiate the liquidation
  • violator: Address that may be in collateral violation
  • underlying: Token that is to be repayed
  • collateral: Token that is to be seized
Returns:
  • liqOpp: The details about the liquidation opportunity

liquidate

Attempts to perform a liquidation
1
function liquidate(address violator, address underlying, address collateral, uint repay, uint minYield) external;
Copied!
Parameters:
  • violator: Address that may be in collateral violation
  • underlying: Token that is to be repayed
  • collateral: Token that is to be seized
  • repay: The amount of underlying DTokens to be transferred from violator to sender, in units of underlying
  • minYield: The minimum acceptable amount of collateral ETokens to be transferred from violator to sender, in units of collateral

IEulerSwap

Trading assets on Uniswap V3 and 1Inch V4 DEXs

SwapUniExactInputSingleParams

Params for Uniswap V3 exact input trade on a single pool
1
struct SwapUniExactInputSingleParams {
2
uint subAccountIdIn;
3
uint subAccountIdOut;
4
address underlyingIn;
5
address underlyingOut;
6
uint amountIn;
7
uint amountOutMinimum;
8
uint deadline;
9
uint24 fee;
10
uint160 sqrtPriceLimitX96;
11
}
Copied!
Parameters:
  • subAccountIdIn: subaccount id to trade from
  • subAccountIdOut: subaccount id to trade to
  • underlyingIn: sold token address
  • underlyingOut: bought token address
  • amountIn: amount of token to sell
  • amountOutMinimum: minimum amount of bought token
  • deadline: trade must complete before this timestamp
  • fee: uniswap pool fee to use
  • sqrtPriceLimitX96: maximum acceptable price

SwapUniExactInputParams

Params for Uniswap V3 exact input trade routed through multiple pools
1
struct SwapUniExactInputParams {
2
uint subAccountIdIn;
3
uint subAccountIdOut;
4
uint amountIn;
5
uint amountOutMinimum;
6
uint deadline;
7
bytes path; // list of pools to hop - constructed with uni SDK
8
}
Copied!
Parameters:
  • subAccountIdIn: subaccount id to trade from
  • subAccountIdOut: subaccount id to trade to
  • underlyingIn: sold token address
  • underlyingOut: bought token address
  • amountIn: amount of token to sell
  • amountOutMinimum: minimum amount of bought token
  • deadline: trade must complete before this timestamp
  • path: list of pools to use for the trade

SwapUniExactOutputSingleParams

Params for Uniswap V3 exact output trade on a single pool
1
struct SwapUniExactOutputSingleParams {
2
uint subAccountIdIn;
3
uint subAccountIdOut;
4
address underlyingIn;
5
address underlyingOut;
6
uint amountOut;
7
uint amountInMaximum;
8
uint deadline;
9
uint24 fee;
10
uint160 sqrtPriceLimitX96;
11
}
Copied!
Parameters:
  • subAccountIdIn: subaccount id to trade from
  • subAccountIdOut: subaccount id to trade to
  • underlyingIn: sold token address
  • underlyingOut: bought token address
  • amountOut: amount of token to buy
  • amountInMaximum: maximum amount of sold token
  • deadline: trade must complete before this timestamp
  • fee