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.

GitHubarrow-up-right

NPMarrow-up-right

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 Viemarrow-up-right, and some helper functions require a Viem PublicClientarrow-up-right or WalletClientarrow-up-right (the Viem equivalent of Ethersarrow-up-right' Providerarrow-up-right and Signerarrow-up-right) to be passed in - this is easiest for frontends using wagmiarrow-up-right 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.