tokenPrice()

    function tokenPrice(Token token) external view returns (Price memory price);
        struct Price {
        uint128 sourceAmount;
        uint128 targetAmount;
    }

This function allows to identify the current price of the token. Keeping in mind that the price change over time, which means that once you query the price, a moment later it would be a less as more time has passed.

Function Arguments

Example

tokenPrice(
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 //token address
)
returns (
  {
   uint128 sourceAmount; 
   uint128 targetAmount; 
  } 
)

To check ETH, use the following address: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE

Last updated