YieldOptions
The YieldOptions class lets you access yield data for various protocols on multiple chains. Use it to compare farm yields for your assets or discover new opportunities. It covers supported protocols, assets, and expected yields across different networks.
We currently support the following networks and protocols, with more being added soon:
Initialization
To set it up, provide a yield data source and specify the cache duration (in seconds).
Choose Provider
Cached Provider
The CachedProvider is the most efficient solution. It is a simple wrapper class for static yield data. You pass it a URL pointing to a JSON file on initialization and it stores the data in memory.
Protocol Provider
The LiveProvider utilizes real-time yield data obtained from on-chain contracts or the protocol's API. To access on-chain data, it requires a connection to a viem public client.
Check our GitHub for available methods.
Last updated