Readonly
premiaReturns the balance of long / short options for a given address.
{string} The contract address of the pool.
{string} The address of which the long / short option balance should be queried.
{boolean} Whether to return the long or short balance of the address.
Promise containing the long / short option balance of the address.
Retrieves the balance of a position in a specified pool.
The address of the pool.
The position identifier.
The balance of the position.
Returns a promise containing a signed transaction to buy options. Buying options can be in the form of buying long options positions or buying to close short option positions.
{string} Contract address of the pool.
Optional
referrer?: stringPromise containing the contract transaction.
Sends a cancel quote request.
The address of the pool.
The hash of the quote to be cancelled.
A promise that resolves to the transaction response.
Cancels multiple quotes.
The address of the pool.
An array of hashes of the quotes to be cancelled.
A promise that resolves to the transaction response.
Returns a promise containing a signed transaction to make claim fees generated by a range order. Allows the SDK to be used without providing a signer.
Promise containing the contract transaction.
Returns a promise containing a signed transaction to claim fees generated by the range order specified by the PositionKey. Allows the SDK to be used without providing a signer.
{string} Contract address of the pool.
{PositionKey} PositionKey parametrizing the range order.
Promise containing the contract transaction.
Returns the promise containing a transaction to deploy a pool parametrized by the input parameters.
{string} Contract address of the base token.
{string} Contract address of the quote token.
{string} Contract address of the oracleAdapter.
{BigNumberish} Strike of the pool; denominated in the quote token.
{BigNumberish} Maturity of the pool (UNIX timestamp).
{boolean} Whether the pool supports call or put options.
Promise containing the contract transaction.
Returns the promise containing a transaction to deploy a pool parametrized by the PoolKey.
{PoolKey} PoolKey containing parameters of the pool to be deployed.
Promise containing the contract transaction.
Returns the promise containing a signed transaction to make a deposit parametrized by the inputs.
{string} Contract address of the pool.
Optional
maxOptional
minOptional
operator?: stringPromise containing the contract transaction.
Returns the promise containing a signed transaction to make a deposit parametrized by the inputs.
{string} Contract address of the pool.
Optional
maxOptional
minPromise containing the contract transaction.
Returns a promise containing a populated transaction to buy options. Allows users to use the SDK without providing a signer.
{string} Contract address of the pool.
Optional
referrer?: stringPromise containing the contract transaction.
Encodes the cancel quote request, preparing the transaction for execution.
The address of the pool.
The hash of the quote to be cancelled.
A promise that resolves to the encoded cancel quote request.
Encodes the cancel quotes request for multiple quotes, preparing the transaction for execution.
The address of the pool.
An array of hashes of the quotes to be cancelled.
A promise that resolves to the encoded cancel quotes request.
Returns a promise containing a populated transaction to make claim fees generated by a range order. Allows the SDK to be used without providing a signer.
Promise containing the contract transaction.
Returns a promise containing a populated transaction to claim fees generated by the range order specified by the PositionKey. Allows the SDK to be used without providing a signer.
{string} Contract address of the pool.
{PositionKey} PositionKey parametrizing the range order.
Promise containing the contract transaction.
Returns a promise containing a populated transaction to deploy a pool parametrized by the input parameters. Allows SDK users to sign the transaction without providing a signer.
{string} Contract address of the base token.
{string} Contract address of the quote token.
{string} Contract address of the oracleAdapter.
{BigNumberish} Strike of the pool; denominated in the quote token.
{BigNumberish} Maturity of the pool (UNIX timestamp).
{boolean} Whether the pool supports call or put options.
Promise containing the contract transaction.
Returns the promise containing a populated transaction to deploy a pool parametrized by the PoolKey. Allows SDK users to sign the transaction without providing a signer.
{PoolKey} PoolKey containing parameters of the pool to be deployed.
Promise containing the contract transaction.
Returns the promise containing a populated transaction to make a deposit parametrized by the inputs. Allows the SDK to be used without providing a signer.
{string} Contract address of the pool.
Optional
maxOptional
minOptional
operator?: stringPromise containing the contract transaction.
Returns the promise containing a populated transaction to make a deposit parametrized by the inputs. Allows the SDK to be used without providing a signer.
{string} Contract address of the pool.
Optional
maxOptional
minPromise containing the contract transaction.
Returns a promise containing a populated transaction to exercise long option positions. Allows the user to use the SDK without providing a signer.
{string} The address of the pool.
A promise that resolves to the transaction response.
Returns a promise containing a populated transaction to exercise option positions on behalf of other users. Allows the user to use the SDK without providing a signer.
{string} Contract address of the pool.
{string[]} Addresses of which the long option positions should be exercised. Note a user can only exercise long option positions on behalf of other users if the holder granted permission via the UserSettings.
{BigNumberish} Amount charged for exercising the long options per holder. Note the maximum amount charged is specified by each option holder individually in the UserSettings. If the amount charged is above the exercise value the transaction will revert.
Promise containing the contract transaction.
Encodes the fill quote request, preparing the transaction for execution.
A promise that resolves to the encoded fill quote request.
Returns a promise containing a populated transaction to sell options. Selling options can be in the form of selling long option positions or selling to open short positions. Allows users to use the SDK without providing a signer.
{string} Contract address of the pool.
Optional
referrer?: stringPromise containing the contract transaction.
Returns a promise containing a populated transaction to settle short option positions. Allows the user to use the SDK without providing a signer.
{string} Contract address of the pool.
Promise containing the contract transaction.
Returns a promise containing a populated transaction to settle option positions on behalf of other users. Allows the user to use the SDK without providing a signer.
{string} Contract address of the pool.
{string[]} List containing the addresses for which the short options should be settled. Note a user can only settle short option positions on behalf of other users if the holder granted permission via the UserSettings.
{BigNumberish} Amount charged by the user to each underwriter. Note the maximum amount charged is specified by each underwriter individually in the UserSettings. If the amount charged is above the settlement value the transaction will revert. // todo
Promise containing the contract transaction.
Returns a promise containing a populated transaction to settle a range order position. Allows the user to use the SDK without providing a signer.
Promise containing the contract transaction.
Returns a promise containing a populated transaction to settle range orders / positions on behalf of other users. Allows the user to use the SDK without providing a signer.
{string} Contract address of the pool.
{string[]} List containing the position keys parametrizing the range orders that should be settled. Note a user can only settle range order positions on behalf of other users if the liquidity providers granted permission via the UserSettings.
{BigNumberish} Amount charged by the user to each liquidity provider. Note the maximum amount charged is specified by each liquidity provider individually in the UserSettings. If the amount charged is above the settlement value of the range order the transaction will revert. // todo
Promise containing the contract transaction.
Returns a promise containing a populated transaction to settle a range order position. Allows the user to use the SDK without providing a signer.
{string} Contract address of the pool.
{PositionKey} PositionKey parametrizing the range order.
Promise containing the contract transaction.
Returns a promise containing a populated transaction to trade options. Allows users to use the SDK without providing a signer.
{string} Contract address of the pool.
Promise containing the contract transaction.
Returns a promise containing a populated transaction to transfer range order liquidity to another owner and operator. Allows the user to use the SDK without providing a signer.
{string} Contract address of the pool.
Optional
operator?: stringOptional
toPromise containing the contract transaction.
Returns a promise containing a populated transaction to transfer range order liquidity to another owner and operator. Allows the user to use the SDK without providing a signer.
{string} Contract address of the pool.
{BigNumberish} Amount of liquidity transferred. Liquidity is denominated in option contracts that can be sold or (potentially) bought.
{PositionKey} Position key parametrizing the range order that should be transferred.
{string} Address of the owner receiving the range order liquidity.
Optional
toOperator: string{string} Address of the owner receiving the range order liquidity.
Promise containing the contract transaction.
Returns the promise containing a populated transaction to make a withdrawal parametrized through the input parameters. Allows users to use the SDK without a signer.
{string} Contract address of the pool.
Optional
maxOptional
minOptional
operator?: stringPromise containing the contract transaction.
Returns the promise containing a populated transaction to make a withdrawal parametrized by the PositionKey. Allows the SDK to be used without providing a signer.
{string} Contract address of the pool.
Optional
maxOptional
minPromise containing the contract transaction.
Returns a promise containing a populated transaction to underwrite an option. The option's strike and maturity are specified through the contract address of the pool. Allows users to use the SDK without providing a signer.
{string} Contract address of the pool.
Optional
longOptional
referrer?: stringPromise containing the contract transaction.
Returns a promise containing a signed transaction to exercise long option positions.
{string} Contract address of the pool.
Promise containing the contract transaction.
Returns a promise containing a signed transaction to exercise option positions on behalf of other users. Allows the user to use the SDK without providing a signer.
{string} Contract address of the pool.
{string[]} Addresses of which the long option positions should be exercised. Note a user can only exercise long option positions on behalf of other users if the holder granted permission via the UserSettings.
{BigNumberish} Amount charged for exercising the long options per holder. Note the maximum amount charged is specified by each option holder individually in the UserSettings. If the amount charged is above the exercise value the transaction will revert.
Promise containing the contract transaction.
Sends a fill quote request.
A promise that resolves to the transaction response.
Computes the breakeven price for an option.
{BigNumberish} The strike price.
{boolean} Whether the option is a call or put.
{BigNumberish} The price that was paid for the option in terms of the quote.
{BigNumberish} The spot price at the time of purchase.
{boolean} Whether the option price is not normalized.
The breakeven spot price at expiration.
Returns the promise containing the amount of fees that are claimable.
{string} Contract address of the pool.
{PositionKey} PositionKey parametrizing the range order.
Promise containing the amount of claimable fees.
Retrieves the filled amount of a quote.
The address of the pool.
The address of the quote provider.
The hash of the quote.
A promise that resolves to the filled amount of the quote.
Returns the contract address of a pool corresponding to a PoolKey.
{PoolKey} The pool key.
Promise containing the contract address if it exists.
Retrieves extended pool information given its address. Cached per minute.
The address of the Pool contract.
A promise that resolves to a PoolExtended
objects.
Returns the corresponding PoolMinimal object from the contract address of a pool.
{string} The relevant contract address.
Promise containing PoolMinimal.
Returns the corresponding PoolMinimal object from a PoolKey.
{PoolKey} The relevant PoolKey.
Promise containing PoolMinimal.
Retrieves extended pools based on the base address. Cached daily.
The address of the base token.
A promise that resolves to an array of PoolExtended
objects.
Retrieves extended pools for a given token pair. Cached per minute.
The token pair.
A promise that resolves to an array of PoolExtended
objects.
Retrieves extended pools for a given token. Cached per minute.
The token information.
Optional
isQuote: boolean = falseA flag to indicate if the token is quote token.
A promise that resolves to an array of PoolExtended
objects.
Retrieves pools for a given token pair. Cached daily.
The token pair.
A promise that resolves to an array of Pool
objects.
Retrieves pools for a given token. Cached daily.
The token information.
Optional
isQuote: boolean = falseA flag to indicate if the token is quote token.
A promise that resolves to an array of Pool
objects.
Generates a token ID from a position key.
The key identifying the position.
The generated token ID.
Returns the fee charged to initialize a pool corresponding to the supplied PoolKey.
{PoolKey} The relevant pool key.
Promise containing the
Validates a quote for its correctness.
The quote with the signature to validate.
Optional
options: { Additional options for validation.
Optional
poolThe address of the Pool contract.
Optional
size?: BigNumberishThe size of the quote.
A promise that resolves to the validation result with error information if the quote is invalid.
Returns a promise containing the range order position's delta struct that would be transferred from the user to the pool upon deposit. The delta struct contains the amount of collateral / longs / shorts transferred to the pool when the deposit is executed given the current market price.
{string} Contract address of the pool.
Optional
maxOptional
minOptional
operator?: stringPromise containing the position's delta struct.
Returns a promise containing the range order position's delta struct that would be transferred from the user to the pool upon deposit. The delta struct contains the amount of collateral / longs / shorts transferred to the pool when the deposit is executed given the current market price.
{string} Contract address of the pool.
Optional
maxOptional
minPromise containing the position's delta struct.
Previews the result of exercising the options in the specified pool.
The address of the pool.
The result of exercising the options.
Previews the result of exercising the options for a list of holders in the specified pool.
The address of the pool.
The array of holder addresses.
The cost per holder.
The result of exercising the options for the holders.
Previews the result of settling the options for a list of underwriters in the specified pool.
The address of the pool.
The array of underwriter addresses.
The cost per underwriter.
The result of settling the options for the underwriters.
Previews the result of settling a specific position in the specified pool.
The address of the pool.
Data defining the position to settle.
The lower bound of the position.
Optional
operator?: stringThe address of the operator.
The order type of the position.
The address of the position owner.
The upper bound of the position.
The result of settling the position.
Previews the result of settling the positions for a list of holders in the specified pool.
The address of the pool.
The array of position keys.
The cost per holder.
The result of settling the positions for the holders.
Previews the result of settling a specific position in the specified pool using a position key.
The address of the pool.
The key identifying the position.
The result of settling the position.
Returns the promise containing the range order position's delta struct. The delta struct contains the amount of collateral / longs / shorts received when the withdrawal is executed given the current market price.
{string} Contract address of the pool.
Optional
maxOptional
minOptional
operator?: stringPromise containing the position's delta struct.
Returns the promise containing the range order position's delta struct. The delta struct contains the amount of collateral / longs / shorts received when the withdrawal is executed given the current market price.
{string} Contract address of the pool.
Optional
maxOptional
minPromise containing the position's delta struct.
Requests a quote from the pool with optional parameters.
The address of the pool.
The size of the quote.
Whether it's a buy or sell.
Optional
referrer: stringThe address of the referrer.
Optional
taker: stringThe address of the taker.
Optional
maxSlippagePercent: BigNumberishThe maximum slippage percent.
A promise that resolves to the fillable quote.
Returns a promise containing a signed transaction to sell options. Selling options can be in the form of selling long option positions or selling to open short positions.
{string} Contract address of the pool.
Optional
referrer?: stringPromise containing the contract transaction.
Returns a promise containing a signed transaction to settle short option positions.
{string} Contract address of the pool.
Promise containing the contract transaction.
Returns a promise containing a signed transaction to settle option positions on behalf of other users.
{string} Contract address of the pool.
{string[]} List containing the addresses for which the short options should be settled. Note a user can only settle short option positions on behalf of other users if the holder granted permission via the UserSettings.
{BigNumberish} Amount charged by the user to each underwriter. Note the maximum amount charged is specified by each underwriter individually in the UserSettings. If the amount charged is above the settlement value the transaction will revert. // todo
Promise containing the contract transaction.
Returns a promise containing a signed transaction to settle option positions on behalf of other users.
{string} Contract address of the pool.
{string[]} List containing the position keys parametrizing the range orders that should be settled. Note a user can only exercise long option positions on behalf of other users if the holder granted permission via the UserSettings.
{BigNumberish} Amount charged by the user to each liquidity provider. Note the maximum amount charged is specified by each liquidity provider individually in the UserSettings. If the amount charged is above the settlement value of the range order the transaction will revert. // todo
Promise containing the contract transaction.
Returns a promise containing a signed transaction to settle a range order position.
{string} Contract address of the pool.
{PositionKey} PositionKey parametrizing the range order.
Promise containing the contract transaction.
Fetches the final settlement price of a specific pool using its address.
The settlement price is the spot price of the reference oracle for the pool, at the time of the pool's expiration. This can be used to calculate the exercise price of options in the pool. The settlement price is only available after the pool has expired, otherwise 0 is returned.
The address of the pool.
Gets the new lower and upper bounds that are snapped to the closest valid range order width. The valid range widths are multiples of 2^n*5^m.
The lower bound of the range order.
The upper bound of the range order.
The type of the order. If it's LONG_COLLATERAL, the lower bound is adjusted; otherwise, the upper bound is adjusted.
An object with the adjusted lower and upper bounds, as bigints. The lower and upper bounds are snapped to the closest width in validWidths (multiples of 2^n*5^m), and are ensured to be within the bounds of minTickDistance and maxTickPrice, respectively.
Fetches the current spot price of a specific pool using its address.
The reference oracle for the pool is used to calculate the spot price.
The address of the pool.
Streams quotes for a specified size and direction (buy/sell).
The options for the quote stream.
Whether it's a buy or sell.
The address of the pool.
The size of the quote.
The callback function to handle each new quote.
Returns the takerFee charged when trading with the pool.
{string} The contract address of the relevant pool.
{size} The amount of contracts to be bought / sold.
{bigint} The premium paid for the contracts .
{isPremiumNormalized} Whether the premium is normalized. Relevant for put options where the price can be quoted normalized, which is the price divided by the strike, or unnormalized.
Optional
taker: string{string} The taker's address. Relevant in case staking discounts apply. Default: ZeroAddress.
Promise containing the taker fee charged for trading on the exchange.
Returns a promise containing a signed transaction to trade options.
{string} Contract address of the pool.
Promise containing the contract transaction.
Returns a promise containing a signed transaction to transfer range order liquidity to another owner and operator.
{string} Contract address of the pool.
Optional
operator?: stringOptional
toPromise containing the contract transaction.
Returns a promise containing a signed transaction to transfer range order liquidity to another owner and operator.
{string} Contract address of the pool.
{BigNumberish} Amount of liquidity transferred. Liquidity is denominated in option contracts that can be sold or (potentially) bought.
{PositionKey} Position key parametrizing the range order that should be transferred.
{string} Address of the owner receiving the range order liquidity.
Optional
toOperator: string{string} Address of the owner receiving the range order liquidity.
Promise containing the contract transaction.
Returns the promise containing a signed transaction to make a withdrawal parametrized through the input parameters.
{string} Contract address of the pool.
Optional
maxOptional
minOptional
operator?: stringPromise containing the contract transaction.
Returns the promise containing a signed transaction to make a withdrawal parametrized by the PositionKey.
{string} Contract address of the pool.
Optional
maxOptional
minPromise containing the contract transaction.
Returns a promise containing a signed transaction to underwrite an option. The option's strike and maturity are specified through the contract address of the pool.
{string} Contract address of the pool.
Optional
longPromise containing the contract transaction.
Generated using TypeDoc
Represents a class for handling pool operations related to the subgraph and the pool contracts.