Readonly premiaThe Premia SDK instance.
Protected streamThe current index of quote streams. Used to cancel stale streams.
Filters a list of pool objects according to the provided options.
An array of pool objects to filter.
Optional options: { An object containing filter conditions.
Optional maturity?: BigNumberishThe maturity time.
Optional priceThe address of the price oracle (optional).
Optional quoteArray of quote tokens' addresses (optional).
Optional strike?: BigNumberishThe strike price.
Parses a token input to return a token address string.
The token input which can be either a Token object or a string representing the address.
Cancels the streaming of quotes for the provided pool address, isCall, and isBuy parameters.
The pool address.
Whether the quote is for a call option.
Whether the quote is for a buy or sell.
Gets the implied volatility for a given pool, price, and spot price. The implied volatility is calculated using the Black-Scholes model.
{PoolMinimal} The pool object.
{BigNumberish} The price of the option.
{BigNumberish} The spot price of the underlying asset.
The implied volatility of the option.
Gets the profit or loss for a given pool, action (buy/sell), and premium.
The address of the pool.
Whether the action is a buy.
The premium for the transaction.
Optional provider: ProviderThe custom provider to use for this call.
Provides the best quotes available for each pool that matches the provided options.
Multi-quote options object.
Whether the quote is for a buy or sell.
Whether the quote is for a call option.
The maturity time.
Optional minimumThe minimum size of the trade (optional).
Optional priceThe address of the price oracle (optional).
Optional quoteArray of quote tokens' addresses (optional).
Optional referrer?: stringThe address of the referrer (optional).
The size of the trade.
The strike price.
Optional taker?: stringThe address of the taker (optional).
The token object or address.
Provides the best quote available from different sources (RFQ, Pool, Vault) based on the provided options.
Quote options object.
Whether the quote is a buy or sell.
Optional maxThe maximum slippage percent (optional).
Optional minimumThe minimum size of the trade (optional).
Optional pool?: PoolMinimalThe pool's address.
Optional poolOptional referrer?: stringThe address of the referrer (optional).
Optional showWhether to show errors (optional).
Optional showWhether to show orderbook errors (optional).
Optional showWhether to show pool errors (optional).
Optional showWhether to show vault errors (optional).
The size of the trade.
Optional taker?: stringThe address of the taker (optional).
Provides the best quotes available from each provider (RFQ, Pool, Vault) for each pool that matches the provided options.
Quotes by provider options object.
Whether the quote is for a buy or sell.
Whether the quote is for a call option.
The maturity time.
Optional minimumThe minimum size of the trade (optional).
Optional priceThe address of the price oracle (optional).
Optional quoteArray of quote tokens' addresses (optional).
Optional referrer?: stringThe address of the referrer (optional).
The size of the trade.
The strike price.
Optional taker?: stringThe address of the taker (optional).
The token object or address.
Streams best quotes available for each pool that matches the provided options. Quotes are updated in real-time and passed to a callback.
Quote options object.
Whether the quote is for a buy or sell.
Whether the quote is for a call option.
The maturity time.
Optional maxThe maximum slippage percent (optional).
Optional minimumThe minimum size of the trade (optional).
Optional priceThe address of the price oracle (optional).
Optional quoteArray of quote tokens' addresses (optional).
Optional referrer?: stringThe address of the referrer (optional).
The size of the trade.
The strike price.
Optional taker?: stringThe address of the taker (optional).
The token object or address.
Function to be called when new quotes are available.
Streams the best quotes available from each provider (RFQ, Pool, Vault) for the pool that matches the provided options. The best quote among all providers is updated in real-time and passed to a callback.
Quote options object.
Optional forceWhether to force sending/listening for Request-for-Quotes (optional).
Whether the quote is for a buy or sell.
Optional maxThe maximum slippage percent (optional).
Optional minimumThe minimum size of the trade (optional).
Optional pool?: PoolMinimalThe pool address.
Optional poolOptional referrer?: stringThe address of the referrer (optional).
The size of the trade.
Optional taker?: stringThe address of the taker (optional).
Function to be called when a new best quote is available.
Streams best quotes available from each provider (RFQ, Pool, Vault) for each pool that matches the provided options. Quotes are updated in real-time and passed to a callback.
Quote options object.
Optional forceWhether to force sending/listening for Request-for-Quotes (optional).
Whether the quote is for a buy or sell.
Whether the quote is for a call option.
The maturity time.
Optional maxThe maximum slippage percent (optional).
Optional minimumThe minimum size of the trade (optional).
Optional priceThe address of the price oracle (optional).
Optional quoteArray of quote tokens' addresses (optional).
Optional referrer?: stringThe address of the referrer (optional).
The size of the trade.
The strike price.
Optional taker?: stringThe address of the taker (optional).
The token object or address.
Function to be called when new quotes are available.
Generated using TypeDoc
This class provides an API for interacting with options in the Premia system. All methods are asynchronous and return promises.