NablaPortal
oracleAdapter
assetsByRouter
routers
routerAssets
Events
EthForExactTokensSwapped
ExactTokensForEthSwapped
ExactTokensForTokensSwapped
Functions
swapEthForExactTokens
Swap ETH for tokens using the NablaRouter
By calling this function the price feed gets be updated (IPriceOracleAdapter.updatePriceFeeds)
Parameters
_amountIn
uint256
The amount of input ETH to swap
_amountOutMin
uint256
The minimum amount of output token that the user will accept
_tokenPath
address[]
Array of tokens to swap along the route (first token must be WETH)
_routerPath
address[]
Array of routers to use
_to
address
The recipient of the output tokens
_deadline
uint256
Unix timestamp after which the transaction will revert
_priceUpdateData
bytes[]
Array of price update data
Return Values
amountOut_
uint256
Output amount of tokens
swapExactTokensForEth
Swap tokens using the NablaRouter and receive ETH
By calling this function the price feed gets be updated (IPriceOracleAdapter.updatePriceFeeds)
Parameters
_amountIn
uint256
The amount of input tokens to swap
_amountOutMin
uint256
The minimum amount of ETH that the user will accept
_tokenPath
address[]
Array of tokens to swap along the route (last token must be WETH)
_routerPath
address[]
Array of routers to use
_to
address
The recipient of ETH
_deadline
uint256
Unix timestamp after which the transaction will revert
_priceUpdateData
bytes[]
Array of price update data
Return Values
amountOut_
uint256
Output amount of ETH
swapExactTokensForTokens
Swap tokens using the NablaRouter
By calling this function the price feed gets be updated (IPriceOracleAdapter.updatePriceFeeds)
Parameters
_amountIn
uint256
The amount of input tokens to swap
_amountOutMin
uint256
The minimum amount of output token that the user will accept
_tokenPath
address[]
Array of tokens to swap along the route
_routerPath
address[]
Array of routers to use
_to
address
The recipient of the output tokens
_deadline
uint256
Unix timestamp after which the transaction will revert
_priceUpdateData
bytes[]
Array of price update data
Return Values
amountOut_
uint256
Output amount of tokens
quoteSwapExactTokensForTokens
Get a quote for how many _toToken
tokens _amountIn
many tokenIn
tokens can currently be swapped for.
Parameters
_amountIn
uint256
The amount of input tokens to swap
_tokenPath
address[]
Array of tokens to swap along the route
_routerPath
address[]
Array of routers to use
_tokenPrices
uint256[]
Array of token prices fetched off-chain
Return Values
amountOut_
uint256
Number of _toToken
tokens that such a swap would yield right now
getRouters
Retrieves the list of routers.
Return Values
routers_
address[]
An array of addresses representing the routers.
getRouterAssets
Retrieves the list of assets associated with a specific router.
Parameters
_router
address
The address of the router for which to retrieve the assets.
Return Values
routerAssets_
address[]
An array of addresses representing the assets associated with the specified router.
Last updated