NablaRouter

oracleAdapter

contract IPriceOracleGetter oracleAdapter

poolByAsset

mapping(address => contract ISwapPoolPermissioned) poolByAsset

swapExactTokensForTokens

function swapExactTokensForTokens(uint256 _amountIn, uint256 _amountOutMin, address[] _tokenInOut, address _to, uint256 _deadline, bytes[] _priceUpdateData) external payable returns (uint256[] amounts_)

Swap some _fromToken tokens for _toToken tokens, ensures _amountOutMin and _deadline, sends funds to _to address msg.sender needs to grant the router contract a sufficient allowance beforehand

By calling this function the price feed gets be updated (IPriceOracleAdapter.updatePriceFeeds)

Parameters

Return Values


getAmountOut

function getAmountOut(uint256 _amountIn, address[] _tokenInOut, uint256[] _tokenPrices) external view returns (uint256 amountOut_, uint256 swapFee_)

Get a quote for how many _toToken tokens _amountIn many tokenIn tokens can currently be swapped for.

Parameters

Return Values

Last updated