NablaPortal

oracleAdapter

address oracleAdapter

assetsByRouter

mapping(address => mapping(address => bool)) assetsByRouter

routers

address[] routers

routerAssets

mapping(address => address[]) routerAssets

Events

EthForExactTokensSwapped

event EthForExactTokensSwapped(address sender, address to, address[] routerPath, address[] tokenPath, uint256[] swapAmounts)

ExactTokensForEthSwapped

event ExactTokensForEthSwapped(address sender, address to, address[] routerPath, address[] tokenPath, uint256[] swapAmounts)

ExactTokensForTokensSwapped

event ExactTokensForTokensSwapped(address sender, address to, address[] routerPath, address[] tokenPath, uint256[] swapAmounts)

Functions

swapEthForExactTokens

function swapEthForExactTokens(uint256 _amountIn, uint256 _amountOutMin, address[] _tokenPath, address[] _routerPath, address _to, uint256 _deadline, bytes[] _priceUpdateData) external payable returns (uint256 amountOut_)

Swap ETH for tokens using the NablaRouter

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

Parameters

Return Values

swapExactTokensForEth

function swapExactTokensForEth(uint256 _amountIn, uint256 _amountOutMin, address[] _tokenPath, address[] _routerPath, address _to, uint256 _deadline, bytes[] _priceUpdateData) external payable returns (uint256 amountOut_)

Swap tokens using the NablaRouter and receive ETH

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

Parameters

Return Values

swapExactTokensForTokens

function swapExactTokensForTokens(uint256 _amountIn, uint256 _amountOutMin, address[] _tokenPath, address[] _routerPath, address _to, uint256 _deadline, bytes[] _priceUpdateData) external payable returns (uint256 amountOut_)

Swap tokens using the NablaRouter

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

Parameters

Return Values

quoteSwapExactTokensForTokens

function quoteSwapExactTokensForTokens(uint256 _amountIn, address[] _tokenPath, address[] _routerPath, uint256[] _tokenPrices) external view returns (uint256 amountOut_)

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

Parameters

Return Values

getRouters

function getRouters() external view returns (address[] routers_)

Retrieves the list of routers.

Return Values

getRouterAssets

function getRouterAssets(address _router) external view returns (address[] routerAssets_)

Retrieves the list of assets associated with a specific router.

Parameters

Return Values

Last updated