Defi Module

Defi module handles operations related to DeFi protocols, including farms and whitelisted tokens.

To learn more about how to use the AI Agent SDK to interact with the wallet module, please visit AI Agent SDK Defi Operations.

7.1 Get Whitelisted Tokens

Fetches whitelisted tokens for a specific DeFi protocol.

Function Name

get_whitelisted_tokens
  • Arguments

    protocol (DefiProtocol): The DeFi protocol (e.g., DefiProtocol.H2, DefiProtocol.VVS)
  • Example Code

    from crypto_com_developer_platform_client import Defi, DefiProtocol
    
    tokens = Defi.get_whitelisted_tokens(DefiProtocol.H2)
    print(tokens)

7.2 Get All Farms

Fetches all farms for a specific DeFi protocol.

Function Name

get_all_farms
  • Arguments

    protocol (DefiProtocol): The DeFi protocol (e.g., DefiProtocol.H2, DefiProtocol.VVS)
  • Example Code

    from crypto_com_developer_platform_client import Defi, DefiProtocol
    
    farms = Defi.get_all_farms(DefiProtocol.VVS)
    print(farms)

7.3 Get Farm By Symbol

Fetches a specific farm by its symbol for a DeFi protocol.

Function Name

get_farm_by_symbol
  • Arguments

    protocol (DefiProtocol): The DeFi protocol (e.g., DefiProtocol.H2, DefiProtocol.VVS)
    symbol (str): The farm symbol (e.g., 'zkCRO-MOON', 'CRO-GOLD')
  • Example Code

    from crypto_com_developer_platform_client import Defi, DefiProtocol
    
    farm = Defi.get_farm_by_symbol(DefiProtocol.H2, 'zkCRO-MOON')
    print(farm)

Last updated

Was this helpful?