Using Token Adapters

Don't forget to initialize DeFi SDK first! Read more about what TokenAdapters are here.

Get derivative token underlying components

>>> UNISWAP_DAI_POOL = '0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667'
>>> await defi_sdk.get_token_components('Uniswap V1 pool token', UNISWAP_DAI_POOL)
[
    TokenBalance(
        metadata=TokenMetadata(
            address='0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
            name='Ether',
            symbol='ETH',
            decimals=18
        ),
        balance=Decimal('1.115069671320704604')
    ),
    TokenBalance(
        metadata=TokenMetadata(
            address='0x6b175474e89094c44da98b954eedeac495271d0f',
            name='Dai Stablecoin',
            symbol='DAI',
            decimals=18
        ),
        balance=Decimal('216.692050327076500045')
    )
]

Last updated