tradeOutputBySourceAmount()

Function tradeOutputBySourceAmount()

BancorNetworkInfo.sol
function tradeOutputBySourceAmount(Token sourceToken, Token targetToken, uint256 sourceAmount) 
external view validTokensForTrade(sourceToken, targetToken) greaterThanZero(sourceAmount) 
returns (uint256)

This function is used to determine the number of tokens expected to be received by trading one token to another.

Function Arguments

NameTypeDescription

sourceToken

Token

The token being sold.

targetToken

Token

The token being bought.

sourceAmount

uint256

The number of tokens being sold.

Return Variables

This function returns the number of tokens expected to be received.

Variable TypeReturns

uint256

The number of target tokens expected to be received by the trade.

Last updated