Options Library

Frontend library for interacting with Option contracts

As we are not currently running a frontend for Option Tokens or Options Liquidity Mining, the Options Library is intended to allow protocols to easily integrate these into their own frontends.



The main benefits of this library are as follows:

  • Helper functions for common frontend tasks such as calculating prices, APRs, requesting commonly used data on Option Tokens etc

  • Getter functions for contract addresses/ABIs on a per chain basis (initially, these will all be identical, and ideally will stay that way. However, past experience with our Bond contracts shows that there is a possibility they may diverge later).

The library uses Viem, and some helper functions require a Viem PublicClient or WalletClient (the Viem equivalent of Ethers' Provider and Signer) to be passed in - this is easiest for frontends using wagmi v1+, but we have included an example UI using the legacy Ethers based version of wagmi in order to demonstrate manual setup of a PublicClient and WalletClient.