Defining Underlying Tokens
4. Input the underlying token address
Input the address of the underlying token. This could be 1 token address you input, or sourced from a method called on the token contract. If you want to call a method on the contract to get the underlying token address, type @
to see the available methods. Note that only methods resulting in an output of type address
are displayed in the menu, as only an address can be an underlying token.
- In the case where you have multiple underlying tokens, you can:
- paste them directly into the input box and call multiple methods on the contract (such as
@token0
and@token1
) or - select a method that returns a list of addresses (such as
@underlyingTokens
, which may return an array of the underlying addresses)
- paste them directly into the input box and call multiple methods on the contract (such as
If you want to call a method on a contract different from the contract you are interpreting, you can do so via the "+ Add" button in the method input modal.
Input multiple underlying tokens
It is common for some types of positions to have multiple underlying tokens, such as liquidity pool tokens (often have a pair of tokens) or vault tokens (often have 4 or 5 underlying tokens).
You can input multiple underlying tokens by pasting them directly into the input box.
If there are multiple methods to call for each underlying token, you can do those in the input box.
In the above example, the @token0
and @token1
methods are called on the Uni V2 LP token contract to get the underlying tokens.
Lastly, you can also call a method that returns a list of addresses, such as @underlyingTokens
, which may return an array of the underlying addresses.