import { BigNumberish, ContractTransaction, ContractTransactionResponse, Provider } from 'ethers'; import { FillableQuote, OrderType, Pool, PoolExtended, PoolKey, PoolMinimal, PositionKey, Quote, QuoteWithSignatureT, Signature, Token, TransactionData } from '../entities'; import { Position } from '@premia/v3-abi/typechain/IPool'; import { BaseAPI } from './baseAPI'; import { TokenPairOrId } from '..'; export declare enum InvalidQuoteError { None = 0, QuoteExpired = 1, QuoteCancelled = 2, QuoteOverfilled = 3, OutOfBoundsPrice = 4, InvalidQuoteTaker = 5, InvalidQuoteSignature = 6, InvalidAssetUpdate = 7, InsufficientCollateralAllowance = 8, InsufficientCollateralBalance = 9, InsufficientLongBalance = 10, InsufficientShortBalance = 11 } export interface ValidQuoteResponse { isValid: boolean; error: string; } /** * Represents a class for handling pool operations related to the voidnode server and the pool contracts. * * @class PoolAPI * @extends {BaseAPI} */ export declare class PoolAPI extends BaseAPI { /** * 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. * * @param lower - The lower bound of the range order. * @param upper - The upper bound of the range order. * @param orderType - The type of the order. If it's LONG_COLLATERAL, the lower bound is adjusted; * otherwise, the upper bound is adjusted. * * @returns 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. */ snapToValidRange(lower: BigNumberish, upper: BigNumberish, orderType: OrderType): { lower: bigint; upper: bigint; }; /** * Fetches the current market price of a specific pool using its address. * * @param {string} poolAddress - The address of the pool. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} - Returns a promise that resolves to the market price. */ marketPrice(poolAddress: string, provider?: Provider): Promise; /** * 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. * * @param {string} poolAddress - The address of the pool. * @param {Object} [poolSettings] - The pool settings. If not provided, they are fetched from the pool contract. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} - Returns a promise that resolves to the spot price. */ spotPrice(poolAddress: string, poolSettings?: { base: string; quote: string; oracleAdapter: string; }, provider?: Provider): Promise; /** * 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. * * @param {string} poolAddress - The address of the pool. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} - Returns a promise that resolves to the settlement price. */ settlementPrice(poolAddress: string, provider?: Provider): Promise; /** * Determines if the market price is stranded by comparing the upper and lower bounds of the stranded area. * * @param {string} poolAddress - The address of the pool. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} Whether the market price is stranded. */ isMarketPriceStranded(poolAddress: string, provider?: Provider): Promise; /** * Gets the stranded area, defined by its lower and upper bounds. * * @param {string} poolAddress - The address of the pool. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise<{ lower: bigint; upper: bigint }>} The stranded area. */ getStrandedArea(poolAddress: string, provider?: Provider): Promise<{ lower: bigint; upper: bigint; }>; /** * Returns the balance of long / short options for a given address. * @param poolAddress {string} The contract address of the pool. * @param userAddress {string} The address of which the long / short option balance should be queried. * @param short {boolean} Whether to return the long or short balance of the address. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the long / short option balance of the address. */ balanceOf(poolAddress: string, userAddress: string, short?: boolean, provider?: Provider): Promise; /** * Retrieves the balance of a position in a specified pool. * * @param {string} poolAddress - The address of the pool. * @param {PositionKey} positionKey - The position identifier. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} The balance of the position. */ balanceOfRange(poolAddress: string, positionKey: PositionKey, provider?: Provider): Promise; /** * Resolves the referrer address. Defaults to a pre-configured referrer if none is provided. * * @param {string} referrer - The address of the referrer. * @returns {string} The address of the referrer. */ toReferrer(referrer?: string): string; /** * Calculates the exercise value of an option from a specified pool. * * @param {string} poolAddress - The address of the pool. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} The exercise value of the option. */ getExerciseValue(poolAddress: string, provider?: Provider): Promise; /** * Computes the breakeven price for an option. * @param strike {BigNumberish} The strike price. * @param isCall {boolean} Whether the option is a call or put. * @param price {BigNumberish} The price that was paid for the option in terms of the quote. * @param spotPrice {BigNumberish} The spot price at the time of purchase. * @param isFullPrice {boolean} Whether the option price is not normalized. * @returns {bigint} The breakeven spot price at expiration. */ getBreakevenPrice(strike: BigNumberish, isCall: boolean, price: BigNumberish, spotPrice: BigNumberish, isFullPrice?: boolean): bigint; /** * Generates a token ID from a position key. * * @param {PositionKey} positionKey - The key identifying the position. * @returns {bigint} The generated token ID. */ getTokenId(positionKey: PositionKey): bigint; /** * Returns the contract address of a pool corresponding to a PoolKey. * @param key {PoolKey} The pool key. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract address if it exists. */ getPoolAddress(key: PoolKey, provider?: Provider): Promise; /** * Returns the fee charged to initialize a pool corresponding to the supplied PoolKey. * * @deprecated To be removed in next major version. Initilization fee is no longer charged. * * @param key {PoolKey} The relevant pool key. * @returns {Promise} Promise containing the */ initializationFee(key: PoolKey): Promise; /** * Returns the takerFee charged when trading with the pool. * @param poolAddress {string} The contract address of the relevant pool. * @param size {bigint} The amount of contracts to be bought / sold. * @param premium {bigint} The premium paid for the contracts . * @param isPremiumNormalized {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. * @param taker {string} The taker's address. Relevant in case staking discounts apply. Default: ZeroAddress. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the taker fee charged for trading on the exchange, * denominated in the pool token. */ takerFee(poolAddress: string, size: bigint, premium: bigint, isPremiumNormalized?: boolean, isOrderbook?: boolean, taker?: string, provider?: Provider): Promise; /** * Returns the takerFee charged when trading with the pool. * Calculated synchronously (may be outdated, does not include taker discounts) * @param poolAddress {string} The contract address of the relevant pool. * @param size {bigint} The amount of contracts to be bought / sold. * @param premiumWad {bigint} The non-normalized premium paid for the contracts. * @param isOrderbook {boolean} Whether the trade is an orderbook trade. * @returns {bigint} The taker fee charged for trading on the exchange denominated in 18 decimals. */ takerFeeSync(size: bigint, premiumWad: bigint, isOrderbook?: boolean): bigint; /** * Validates a quote for its correctness. * * @param {QuoteWithSignatureT} quote - The quote with the signature to validate. * @param {Object} [options] - Additional options for validation. * @param {string} [options.poolAddress] - The address of the Pool contract. * @param {BigNumberish} [options.size] - The size of the quote. * @param {string} [options.taker] - The address of the taker. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to the validation result with error information if the quote is invalid. */ isQuoteValid(quote: QuoteWithSignatureT, options?: { taker?: string; poolAddress?: string; size?: BigNumberish; }, provider?: Provider): Promise; /** * Requests a quote from the pool with optional parameters. * * @param {string} poolAddress - The address of the pool. * @param {BigNumberish} size - The size of the quote. * @param {boolean} isBuy - Whether it's a buy or sell. * @param {string} [referrer] - The address of the referrer. * @param {string} [taker] - The address of the taker. * @param {number} [maxSlippagePercent] - The maximum slippage percent. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to the fillable quote. */ quote(poolAddress: string, size: BigNumberish, isBuy: boolean, referrer?: string, taker?: string, maxSlippagePercent?: number, provider?: Provider, poolKey?: PoolKey, pool?: PoolMinimal): Promise; /** * Streams quotes for a specified size and direction (buy/sell). * * @param {Object} options - The options for the quote stream. * @param {string} options.poolAddress - The address of the pool. * @param {BigNumberish} options.size - The size of the quote. * @param {boolean} options.isBuy - Whether it's a buy or sell. * @param {BigNumberish} [options.minimumSize] - The minimum size of the quote. * @param {string} [options.referrer] - The address of the referrer. * @param {string} [options.taker] - The address of the taker. * @param {number} [options.maxSlippagePercent] - The maximum slippage percent. * @param {boolean} [options.showErrors] - Whether to show errors in the console. * @param {Provider} [options.provider] - The custom provider to use for this call. * @param {(quote: FillableQuote | null) => void} callback - The callback function to handle each new quote. * @returns {Promise} */ streamQuotes(options: { poolAddress: string; size: BigNumberish; isBuy: boolean; minimumSize?: BigNumberish; referrer?: string; taker?: string; maxSlippagePercent?: number; showErrors?: boolean; provider?: Provider; poolKey?: PoolKey; pool?: PoolMinimal; }, callback: (quote: FillableQuote | null) => void): Promise; /** * Cancels the quote stream for a given pool. * * @param {string} poolAddress - The address of the pool. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} */ cancelQuoteStream(poolAddress: string, provider?: Provider): Promise; /** * Returns the PoolKey given the contract address of a pool. * @param poolAddress {string} The contract address of the relevant pool. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} */ getPoolKeyFromAddress(poolAddress: string, provider?: Provider): Promise; /** * Returns the corresponding PoolMinimal object from a PoolKey. * @param key {PoolKey} The relevant PoolKey. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing PoolMinimal. */ getPoolMinimalFromKey(key: PoolKey, provider?: Provider): Promise; /** * Returns the corresponding PoolMinimal object from the contract address of a pool. * * @param address {string} The relevant contract address. * @returns {Promise} Promise containing PoolMinimal. */ getPoolMinimal(address: string): Promise; /** * Retrieves the pool information given its address. * * @param {string} address - The address of the pool. * @returns {Promise} A promise that resolves to a `Pool` object. */ getPool(address: string): Promise; /** * Retrieves extended pool information given its address. * * @param {string} address - The address of the Pool contract. * @returns {Promise} A promise that resolves to a `PoolExtended` objects. */ getPoolExtended(address: string): Promise; /** * Retrieves pools based on the base address. * * @param {string} baseAddress - The address of the base token. * @param {boolean} isExpired - A filter for [non-] expired pools. * @returns {Promise} A promise that resolves to an array of `Pool` objects. */ getPools(baseAddress: string, isExpired?: boolean): Promise; /** * Retrieves extended pools based on the base address. * * @param {string} baseAddress - The address of the base token. * @param {boolean} isExpired - A filter for [non-] expired pools. * @returns {Promise} A promise that resolves to an array of `PoolExtended` objects. */ getPoolsExtended(baseAddress: string, isExpired?: boolean): Promise; /** * Retrieves pools for a given token. * * @param {Token} token - The token information. * @param {boolean} [isQuote=false] - A flag to indicate if the token is quote token. * @returns {Promise} A promise that resolves to an array of `Pool` objects. */ getPoolsForToken(token: Token, isQuote?: boolean): Promise; /** * Retrieves extended pools for a given token. * * @param {Token} token - The token information. * @param {boolean} [isQuote=false] - A flag to indicate if the token is quote token. * @returns {Promise} A promise that resolves to an array of `PoolExtended` objects. */ getPoolsExtendedForToken(token: Token, isQuote?: boolean): Promise; /** * Retrieves pools for a given token pair. * * @param {TokenPairOrId} pair - The token pair or pair id. * @param {boolean} isExpired - A filter for [non-] expired pools. * @returns {Promise} A promise that resolves to an array of `Pool` objects. */ getPoolsForPair(pair: TokenPairOrId, isExpired?: boolean): Promise; /** * Retrieves extended pools for a given token pair. * * @param {TokenPairOrId} pair - The token pair or pair id. * @param {boolean} isExpired - A filter for [non-] expired pools. * @returns {Promise} A promise that resolves to an array of `PoolExtended` objects. */ getPoolsExtendedForPair(pair: TokenPairOrId, isExpired?: boolean): Promise; /** * 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. * @param base {string} Contract address of the base token. * @param quote {string} Contract address of the quote token. * @param oracleAdapter {string} Contract address of the oracleAdapter. * @param strike {BigNumberish} Strike of the pool; denominated in the quote token. * @param maturity {BigNumberish} Maturity of the pool (UNIX timestamp). * @param isCall {boolean} Whether the pool supports call or put options. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeDeploy(base: string, quote: string, oracleAdapter: string, strike: BigNumberish, maturity: BigNumberish, isCall: boolean, provider?: Provider): Promise; /** * 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. * @param base {string} Contract address of the base token. * @param quote {string} Contract address of the quote token. * @param oracleAdapter {string} Contract address of the oracleAdapter. * @param strike {BigNumberish} Strike of the pool; denominated in the quote token. * @param maturity {BigNumberish} Maturity of the pool (UNIX timestamp). * @param isCall {boolean} Whether the pool supports call or put options. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeDeploySync(base: string, quote: string, oracleAdapter: string, strike: BigNumberish, maturity: BigNumberish, isCall: boolean, provider?: Provider): TransactionData; /** * Returns the promise containing a transaction to deploy a pool parametrized by the input parameters. * @param base {string} Contract address of the base token. * @param quote {string} Contract address of the quote token. * @param oracleAdapter {string} Contract address of the oracleAdapter. * @param strike {BigNumberish} Strike of the pool; denominated in the quote token. * @param maturity {BigNumberish} Maturity of the pool (UNIX timestamp). * @param isCall {boolean} Whether the pool supports call or put options. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ deploy(base: string, quote: string, oracleAdapter: string, strike: BigNumberish, maturity: BigNumberish, isCall: boolean, provider?: Provider): Promise; /** * 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. * @param key {PoolKey} PoolKey containing parameters of the pool to be deployed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeDeployWithKey(key: PoolKey, provider?: Provider): Promise; /** * 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. * @param key {PoolKey} PoolKey containing parameters of the pool to be deployed. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeDeployWithKeySync(key: PoolKey, provider?: Provider): TransactionData; /** * Returns the promise containing a transaction to deploy a pool parametrized by the PoolKey. * @param key {PoolKey} PoolKey containing parameters of the pool to be deployed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ deployWithKey(key: PoolKey, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be deposited. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the deposit to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the deposit to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeDeposit(poolAddress: string, { owner, lower, upper, size, orderType, operator, minMarketPrice, maxMarketPrice, }: { owner: string; lower: BigNumberish; upper: BigNumberish; size: BigNumberish; orderType: OrderType; operator?: string; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * Returns the promise containing a signed transaction to make a deposit parametrized by the inputs. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be deposited. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the deposit to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the deposit to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ deposit(poolAddress: string, { owner, lower, upper, size, orderType, operator, minMarketPrice, maxMarketPrice, }: { owner: string; lower: BigNumberish; upper: BigNumberish; size: BigNumberish; orderType: OrderType; operator?: string; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param positionKey {PositionKey} PositionKey parametrizing the range order. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be deposited. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the deposit to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the deposit to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeDepositWithKey(poolAddress: string, { positionKey, size, minMarketPrice, maxMarketPrice, }: { positionKey: PositionKey; size: BigNumberish; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * Returns the promise containing a signed transaction to make a deposit parametrized by the inputs. * @param poolAddress {string} Contract address of the pool. * @param positionKey {PositionKey} PositionKey parametrizing the range order. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be deposited. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the deposit to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the deposit to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ depositWithKey(poolAddress: string, { positionKey, size, minMarketPrice, maxMarketPrice, }: { positionKey: PositionKey; size: BigNumberish; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be deposited. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the deposit to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the deposit to be processed.* @param size {BigNumberish} The amount of liquidity denominated in options contracts to be deposited. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the position's delta struct. */ previewDeposit(poolAddress: string, { owner, lower, upper, size, orderType, operator, minMarketPrice, maxMarketPrice, }: { owner: string; lower: BigNumberish; upper: BigNumberish; size: BigNumberish; orderType: OrderType; operator?: string; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param positionKey {PositionKey} PositionKey parametrizing the range order. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be deposited. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the deposit to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the deposit to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the position's delta struct. */ previewDepositWithKey(poolAddress: string, { positionKey, size, minMarketPrice, maxMarketPrice, }: { positionKey: PositionKey; size: BigNumberish; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be withdrawn. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the withdrawal to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the withdrawal to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeWithdraw(poolAddress: string, { owner, lower, upper, orderType, size, operator, minMarketPrice, maxMarketPrice, }: { owner: string; lower: BigNumberish; upper: BigNumberish; orderType: OrderType; size: BigNumberish; operator?: string; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * Returns the promise containing a signed transaction to make a withdrawal parametrized through the input parameters. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be withdrawn. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the withdrawal to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the withrawal to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ withdraw(poolAddress: string, { owner, lower, upper, orderType, size, operator, minMarketPrice, maxMarketPrice, }: { owner: string; lower: BigNumberish; upper: BigNumberish; orderType: OrderType; size: BigNumberish; operator?: string; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param positionKey {PositionKey} PositionKey parametrizing the range order. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be withdrawn. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the withdrawal to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the withdrawal to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeWithdrawWithKey(poolAddress: string, { positionKey, size, minMarketPrice, maxMarketPrice, }: { positionKey: PositionKey; size: BigNumberish; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * Returns the promise containing a signed transaction to make a withdrawal parametrized by the PositionKey. * @param poolAddress {string} Contract address of the pool. * @param positionKey {PositionKey} PositionKey parametrizing the range order. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be withdrawn. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the withdrawal to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the withdrawal to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ withdrawWithKey(poolAddress: string, { positionKey, size, minMarketPrice, maxMarketPrice, }: { positionKey: PositionKey; size: BigNumberish; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be withdrawn. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the withdrawal to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the withrawal to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the position's delta struct. */ previewWithdraw(poolAddress: string, { owner, lower, upper, size, orderType, operator, minMarketPrice, maxMarketPrice, }: { owner: string; lower: BigNumberish; upper: BigNumberish; size: BigNumberish; orderType: OrderType; operator?: string; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param positionKey {PositionKey} PositionKey parametrizing the range order. * @param size {BigNumberish} The amount of liquidity denominated in options contracts to be withdrawn. * @param minMarketPrice {BigNumberish} Optional argument specifying the minimum admissible market price for the withdrawal to be processed. * @param maxMarketPrice {BigNumberish} Optional argument specifying the maximum admissible market price for the withdrawal to be processed. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the position's delta struct. */ previewWithdrawWithKey(poolAddress: string, { positionKey, size, minMarketPrice, maxMarketPrice, }: { positionKey: PositionKey; size: BigNumberish; minMarketPrice?: BigNumberish; maxMarketPrice?: BigNumberish; }, provider?: Provider): Promise; /** * Returns the promise containing the amount of fees that are claimable. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the amount of claimable fees. */ getClaimableFees(poolAddress: string, { owner, lower, upper, orderType, operator, }: { owner: string; lower: BigNumberish; upper: BigNumberish; orderType: OrderType; operator?: string; }, provider?: Provider): Promise; /** * Returns the promise containing the amount of fees that are claimable. * @param poolAddress {string} Contract address of the pool. * @param key {PositionKey} PositionKey parametrizing the range order. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the amount of claimable fees. */ getClaimableFeesWithKey(poolAddress: string, key: PositionKey, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeClaim(poolAddress: string, { owner, lower, upper, orderType, operator, }: { owner: string; lower: BigNumberish; upper: BigNumberish; orderType: OrderType; operator?: string; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ claim(poolAddress: string, { owner, lower, upper, orderType, operator, }: { owner: string; lower: BigNumberish; upper: BigNumberish; orderType: OrderType; operator?: string; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param key {PositionKey} PositionKey parametrizing the range order. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeClaimWithKey(poolAddress: string, key: PositionKey, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param key {PositionKey} PositionKey parametrizing the range order. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeClaimWithKeySync(poolAddress: string, key: PositionKey, provider?: Provider): TransactionData; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param key {PositionKey} PositionKey parametrizing the range order. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ claimWithKey(poolAddress: string, key: PositionKey, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param underwriter {string} Address of the underwriter receiving the short options. * @param longReceiver {string} Address receiving the long options. * @param size {BigNumberish} Amount of options to be underwritten (minted). * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeWriteOption(poolAddress: string, { underwriter, longReceiver, size, referrer, }: { underwriter: string; size: BigNumberish; longReceiver?: string; referrer?: string; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param underwriter {string} Address of the underwriter receiving the short options. * @param longReceiver {string} Address receiving the long options. * @param size {BigNumberish} Amount of options to be underwritten (minted). * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeWriteOptionSync(poolAddress: string, { underwriter, longReceiver, size, referrer, }: { underwriter: string; size: BigNumberish; longReceiver?: string; referrer?: string; }, provider?: Provider): TransactionData; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param underwriter {string} Address of the underwriter receiving the short options. * @param longReceiver {string} Address receiving the long options. * @param size {BigNumberish} Amount of options to be underwritten (minted). * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ writeOption(poolAddress: string, { underwriter, longReceiver, size, }: { underwriter: string; size: BigNumberish; longReceiver?: string; }, provider?: Provider): Promise; /** * Returns a promise containing a populated transaction to trade options. Allows users to use the SDK without providing a signer. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} The amount of options to buy / sell. * @param isBuy {boolean} Whether to buy or sell options. * @param premiumLimit {BigNumberish} If isBuy is true the premiumLimit is the maximum amount to be spent to buy the option amount. If isBuy is false the premiumLimit is the minimum amount received for selling the option amount. * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeTrade(poolAddress: string, { size, isBuy, premiumLimit, referrer, }: { size: BigNumberish; isBuy: boolean; premiumLimit: BigNumberish; referrer: string; }, provider?: Provider): Promise; /** * Returns a promise containing a populated transaction to trade options. Allows users to use the SDK without providing a signer. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} The amount of options to buy / sell. * @param isBuy {boolean} Whether to buy or sell options. * @param premiumLimit {BigNumberish} If isBuy is true the premiumLimit is the maximum amount to be spent to buy the option amount. If isBuy is false the premiumLimit is the minimum amount received for selling the option amount. * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeTradeSync(poolAddress: string, { size, isBuy, premiumLimit, referrer, }: { size: BigNumberish; isBuy: boolean; premiumLimit: BigNumberish; referrer: string; }, provider?: Provider): TransactionData; /** * Returns a promise containing a signed transaction to trade options. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} The amount of options to buy / sell. * @param isBuy {boolean} Whether to buy or sell options. * @param premiumLimit {BigNumberish} If isBuy is true the premiumLimit is the maximum amount to be spent to buy the option amount. If isBuy is false the premiumLimit is the minimum amount received for selling the option amount. * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ trade(poolAddress: string, { size, isBuy, premiumLimit, referrer, }: { size: BigNumberish; isBuy: boolean; premiumLimit: BigNumberish; referrer: string; }, provider?: Provider): Promise; /** * Returns a promise containing a populated transaction to buy options. Allows users to use the SDK without providing a signer. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} The amount of options to buy. * @param premiumLimit {BigNumberish} The premiumLimit is the maximum amount to be spent to buy the option amount. * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeBuy(poolAddress: string, { size, premiumLimit, referrer, }: { size: BigNumberish; premiumLimit: BigNumberish; referrer?: string; }, provider?: Provider): Promise; /** * Returns a promise containing a populated transaction to buy options. Allows users to use the SDK without providing a signer. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} The amount of options to buy. * @param premiumLimit {BigNumberish} The premiumLimit is the maximum amount to be spent to buy the option amount. * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeBuySync(poolAddress: string, { size, premiumLimit, referrer, }: { size: BigNumberish; premiumLimit: BigNumberish; referrer?: string; }, provider?: Provider): TransactionData; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} The amount of options to buy. * @param premiumLimit {BigNumberish} The premiumLimit is the maximum amount to be spent to buy the option amount. * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ buy(poolAddress: string, { size, premiumLimit, referrer, }: { size: BigNumberish; premiumLimit: BigNumberish; referrer?: string; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} The amount of options to sell. * @param premiumLimit {BigNumberish} The premiumLimit is the minimum amount to be received to sell the option amount. * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeSell(poolAddress: string, { size, premiumLimit, referrer, }: { size: BigNumberish; premiumLimit: BigNumberish; referrer?: string; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} The amount of options to sell. * @param premiumLimit {BigNumberish} The premiumLimit is the minimum amount to be received to sell the option amount. * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeSellSync(poolAddress: string, { size, premiumLimit, referrer, }: { size: BigNumberish; premiumLimit: BigNumberish; referrer?: string; }, provider?: Provider): TransactionData; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} The amount of options to sell. * @param premiumLimit {BigNumberish} The premiumLimit is the minimum amount to be received to sell the option amount. * @param referrer {string} Address of the referrer. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ sell(poolAddress: string, { size, premiumLimit, referrer, }: { size: BigNumberish; premiumLimit: BigNumberish; referrer?: string; }, provider?: Provider): Promise; /** * Encodes the fill quote request, preparing the transaction for execution. * * @param {string} poolAddress - The address of the pool. * @param {Object} options - The options for the fill quote request. * @param {Quote} options.quote - The quote object. * @param {BigNumberish} options.size - The size to fill. * @param {Signature} options.signature - The signature of the quote provider. * @param {string} [options.referrer] - The address of the referrer. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to the encoded fill quote request. */ encodeFillQuote(poolAddress: string, { quote, size, signature, referrer, }: { quote: Quote; size: BigNumberish; signature: Signature; referrer?: string; }, provider?: Provider): Promise; /** * Encodes the fill quote request, preparing the transaction for execution. * * @param {string} poolAddress - The address of the pool. * @param {Object} options - The options for the fill quote request. * @param {Quote} options.quote - The quote object. * @param {BigNumberish} options.size - The size to fill. * @param {Signature} options.signature - The signature of the quote provider. * @param {string} [options.referrer] - The address of the referrer. * @param {Provider} provider - The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeFillQuoteSync(poolAddress: string, { quote, size, signature, referrer, }: { quote: Quote; size: BigNumberish; signature: Signature; referrer?: string; }, provider?: Provider): TransactionData; /** * Sends a fill quote request. * * @param {string} poolAddress - The address of the pool. * @param {Object} options - The options for the fill quote request. * @param {Quote} options.quote - The quote object. * @param {BigNumberish} options.size - The size to fill. * @param {Signature} options.signature - The signature of the quote provider. * @param {string} [options.referrer] - The address of the referrer. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to the transaction response. */ fillQuote(poolAddress: string, options: { quote: Quote; size: BigNumberish; signature: Signature; referrer?: string; }, provider?: Provider): Promise; /** * Retrieves the filled amount of a quote. * * @param {string} poolAddress - The address of the pool. * @param {string} quoteProvider - The address of the quote provider. * @param {string} quoteHash - The hash of the quote. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to the filled amount of the quote. */ getFilledQuoteAmount(poolAddress: string, quoteProvider: string, quoteHash: string, provider?: Provider): Promise; /** * Encodes the cancel quote request, preparing the transaction for execution. * * @param {string} poolAddress - The address of the pool. * @param {string} quoteHash - The hash of the quote to be cancelled. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to the encoded cancel quote request. */ encodeCancelQuote(poolAddress: string, quoteHash: string, provider?: Provider): Promise; /** * Encodes the cancel quote request, preparing the transaction for execution. * * @param {string} poolAddress - The address of the pool. * @param {string} quoteHash - The hash of the quote to be cancelled. * @param {Provider} provider - The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeCancelQuoteSync(poolAddress: string, quoteHash: string, provider?: Provider): TransactionData; /** * Sends a cancel quote request. * * @param {string} poolAddress - The address of the pool. * @param {string} quoteHash - The hash of the quote to be cancelled. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to the transaction response. */ cancelQuote(poolAddress: string, quoteHash: string, provider?: Provider): Promise; /** * Encodes the cancel quotes request for multiple quotes, preparing the transaction for execution. * * @param {string} poolAddress - The address of the pool. * @param {string[]} quoteHashes - An array of hashes of the quotes to be cancelled. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to the encoded cancel quotes request. */ encodeCancelQuotes(poolAddress: string, quoteHashes: string[], provider?: Provider): Promise; /** * Encodes the cancel quotes request for multiple quotes, preparing the transaction for execution. * * @param {string} poolAddress - The address of the pool. * @param {string[]} quoteHashes - An array of hashes of the quotes to be cancelled. * @param {Provider} provider - The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeCancelQuotesSync(poolAddress: string, quoteHashes: string[], provider?: Provider): TransactionData; /** * Cancels multiple quotes. * * @param {string} poolAddress - The address of the pool. * @param {string[]} quoteHashes - An array of hashes of the quotes to be cancelled. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} A promise that resolves to the transaction response. */ cancelQuotes(poolAddress: string, quoteHashes: string[], provider?: Provider): Promise; /** * Returns a promise containing a populated transaction to exercise long option positions. Allows the user to use the SDK without providing a signer. * @param poolAddress {string} The address of the pool. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} A promise that resolves to the transaction response. */ encodeExercise(poolAddress: string, provider?: Provider): Promise; /** * Returns a promise containing a populated transaction to exercise long option positions. Allows the user to use the SDK without providing a signer. * @param poolAddress {string} The address of the pool. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeExerciseSync(poolAddress: string, provider?: Provider): TransactionData; /** * Returns a promise containing a signed transaction to exercise long option positions. * @param poolAddress {string} Contract address of the pool. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ exercise(poolAddress: string, provider?: Provider): Promise; /** * Previews the result of exercising the options in the specified pool. * * @param {string} poolAddress - The address of the pool. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise<[bigint, bigint]>} The result of exercising the options. */ previewExercise(poolAddress: string, provider?: Provider): Promise<[ bigint, bigint ] & { exerciseValue: bigint; exerciseFee: bigint; }>; /** * Returns a promise containing a populated transaction to settle short option positions. Allows the user to use the SDK without providing a signer. * @param poolAddress {string} Contract address of the pool. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeSettle(poolAddress: string, provider?: Provider): Promise; /** * Returns a promise containing a populated transaction to settle short option positions. Allows the user to use the SDK without providing a signer. * @param poolAddress {string} Contract address of the pool. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeSettleSync(poolAddress: string, provider?: Provider): TransactionData; /** * Returns a promise containing a signed transaction to settle short option positions. * @param poolAddress {string} Contract address of the pool. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ settle(poolAddress: string, provider?: Provider): Promise; /** * Previews the result of settling the options in the specified pool. * * @param {string} poolAddress - The address of the pool. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} The result of settling the options. */ previewSettle(poolAddress: string, provider?: Provider): Promise; /** * Returns a promise containing a populated transaction to settle a range order position. Allows the user to use the SDK without providing a signer. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeSettlePosition(poolAddress: string, { owner, lower, upper, orderType, operator, }: { owner: string; lower: BigNumberish; upper: BigNumberish; orderType: OrderType; operator?: string; }, provider?: Provider): Promise; /** * Returns a promise containing a signed transaction to settle a range order position. * @param poolAddress {string} Contract address of the pool. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ settlePosition(poolAddress: string, { owner, lower, upper, orderType, operator, }: { owner: string; lower: BigNumberish; upper: BigNumberish; orderType: OrderType; operator?: string; }, provider?: Provider): Promise; /** * Previews the result of settling a specific position in the specified pool. * * @param {string} poolAddress - The address of the pool. * @param {Object} positionData - Data defining the position to settle. * @param {string} positionData.owner - The address of the position owner. * @param {BigNumberish} positionData.lower - The lower bound of the position. * @param {BigNumberish} positionData.upper - The upper bound of the position. * @param {OrderType} positionData.orderType - The order type of the position. * @param {string} [positionData.operator] - The address of the operator. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} The result of settling the position. */ previewSettlePosition(poolAddress: string, { owner, lower, upper, orderType, operator, }: { owner: string; lower: BigNumberish; upper: BigNumberish; orderType: OrderType; operator?: string; }, provider?: Provider): Promise; /** * Returns a promise containing a populated transaction to settle a range order position. Allows the user to use the SDK without providing a signer. * @param poolAddress {string} Contract address of the pool. * @param positionKey {PositionKey} PositionKey parametrizing the range order. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeSettlePositionWithKey(poolAddress: string, positionKey: PositionKey, provider?: Provider): Promise; /** * Returns a promise containing a populated transaction to settle a range order position. Allows the user to use the SDK without providing a signer. * @param poolAddress {string} Contract address of the pool. * @param positionKey {PositionKey} PositionKey parametrizing the range order. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeSettlePositionWithKeySync(poolAddress: string, positionKey: PositionKey, provider?: Provider): TransactionData; /** * Returns a promise containing a signed transaction to settle a range order position. * @param poolAddress {string} Contract address of the pool. * @param positionKey {PositionKey} PositionKey parametrizing the range order. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ settlePositionWithKey(poolAddress: string, positionKey: PositionKey, provider?: Provider): Promise; /** * Previews the result of settling a specific position in the specified pool using a position key. * * @param {string} poolAddress - The address of the pool. * @param {PositionKey} positionKey - The key identifying the position. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} The result of settling the position. */ previewSettlePositionWithKey(poolAddress: string, positionKey: PositionKey, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param holderAddresses {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. * @param costPerHolder {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. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeExerciseFor(poolAddress: string, holderAddresses: string[], costPerHolder: BigNumberish, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param holderAddresses {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. * @param costPerHolder {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. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeExerciseForSync(poolAddress: string, holderAddresses: string[], costPerHolder: BigNumberish, provider?: Provider): TransactionData; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param holderAddresses {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. * @param costPerHolder {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. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ exerciseFor(poolAddress: string, holderAddresses: string[], costPerHolder: BigNumberish, provider?: Provider): Promise; /** * Previews the result of exercising the options for a list of holders in the specified pool. * * @param {string} poolAddress - The address of the pool. * @param {string[]} holderAddresses - The array of holder addresses. * @param {BigNumberish} costPerHolder - The cost per holder. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise<[bigint[], bigint[]]>} The result of exercising the options for the holders. */ previewExerciseFor(poolAddress: string, holderAddresses: string[], costPerHolder: BigNumberish, provider?: Provider): Promise<[ bigint[], bigint[] ] & { exerciseValues: bigint[]; exerciseFees: bigint[]; }>; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param underwriterAddresses {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. * @param costPerUnderwriter {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 * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeSettleFor(poolAddress: string, underwriterAddresses: string[], costPerUnderwriter: BigNumberish, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param underwriterAddresses {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. * @param costPerUnderwriter {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 * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeSettleForSync(poolAddress: string, underwriterAddresses: string[], costPerUnderwriter: BigNumberish, provider?: Provider): TransactionData; /** * Returns a promise containing a signed transaction to settle option positions on behalf of other users. * @param poolAddress {string} Contract address of the pool. * @param underwriterAddresses {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. * @param costPerUnderwriter {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 * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ settleFor(poolAddress: string, underwriterAddresses: string[], costPerUnderwriter: BigNumberish, provider?: Provider): Promise; /** * Previews the result of settling the options for a list of underwriters in the specified pool. * * @param {string} poolAddress - The address of the pool. * @param {string[]} underwriterAddresses - The array of underwriter addresses. * @param {BigNumberish} costPerUnderwriter - The cost per underwriter. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} The result of settling the options for the underwriters. */ previewSettleFor(poolAddress: string, underwriterAddresses: string[], costPerUnderwriter: BigNumberish, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param positionKeys {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. * @param costPerHolder {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 * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeSettlePositionFor(poolAddress: string, positionKeys: PositionKey[], costPerHolder: BigNumberish, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param positionKeys {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. * @param costPerHolder {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 * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeSettlePositionForSync(poolAddress: string, positionKeys: PositionKey[], costPerHolder: BigNumberish, provider?: Provider): TransactionData; /** * Returns a promise containing a signed transaction to settle option positions on behalf of other users. * @param poolAddress {string} Contract address of the pool. * @param positionKeys {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. * @param costPerHolder {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 * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ settlePositionFor(poolAddress: string, positionKeys: PositionKey[], costPerHolder: BigNumberish, provider?: Provider): Promise; /** * Previews the result of settling the positions for a list of holders in the specified pool. * * @param {string} poolAddress - The address of the pool. * @param {PositionKey[]} positionKeys - The array of position keys. * @param {BigNumberish} costPerHolder - The cost per holder. * @param {Provider} provider - The custom provider to use for this call. * @returns {Promise} The result of settling the positions for the holders. */ previewSettlePositionFor(poolAddress: string, positionKeys: PositionKey[], costPerHolder: BigNumberish, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} Amount of liquidity transferred. Liquidity is denominated in option contracts that can be sold or (potentially) bought. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param toOwner {string} Address of the owner receiving the range order liquidity. * @param toOperator {string} Address of the owner receiving the range order liquidity. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeTransferPosition(poolAddress: string, { size, owner, lower, upper, orderType, operator, toOwner, toOperator, }: { size: BigNumberish; owner: string; lower: BigNumberish; upper: BigNumberish; orderType: OrderType; operator?: string; toOwner: string; toOperator?: string; }, provider?: Provider): Promise; /** * Returns a promise containing a signed transaction to transfer range order liquidity to another owner and operator. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} Amount of liquidity transferred. Liquidity is denominated in option contracts that can be sold or (potentially) bought. * @param owner {string} Address of the owner. * @param lower {BigNumberish} Lower tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param upper {BigNumberish} Upper tick price of the range order. Tick price is quoted in the base for calls and in the quote for puts where it is additionally normalized by the strike. * @param orderType {OrderType} Type of the range order (LC or CS). * @param operator {string} Address of the operator. * @param toOwner {string} Address of the owner receiving the range order liquidity. * @param toOperator {string} Address of the owner receiving the range order liquidity. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ transferPosition(poolAddress: string, { size, owner, lower, upper, orderType, operator, toOwner, toOperator, }: { size: BigNumberish; owner: string; lower: BigNumberish; upper: BigNumberish; orderType: OrderType; operator?: string; toOwner: string; toOperator?: string; }, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} Amount of liquidity transferred. Liquidity is denominated in option contracts that can be sold or (potentially) bought. * @param positionKey {PositionKey} Position key parametrizing the range order that should be transferred. * @param toOwner {string} Address of the owner receiving the range order liquidity. * @param toOperator {string} Address of the owner receiving the range order liquidity. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ encodeTransferPositionWithKey(poolAddress: string, size: BigNumberish, positionKey: PositionKey, toOwner: string, toOperator?: string, provider?: Provider): Promise; /** * 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. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} Amount of liquidity transferred. Liquidity is denominated in option contracts that can be sold or (potentially) bought. * @param positionKey {PositionKey} Position key parametrizing the range order that should be transferred. * @param toOwner {string} Address of the owner receiving the range order liquidity. * @param toOperator {string} Address of the owner receiving the range order liquidity. * @param provider {Provider} The custom provider to use for this call. * @returns {TransactionData} The encoded transaction data. */ encodeTransferPositionWithKeySync(poolAddress: string, size: BigNumberish, positionKey: PositionKey, toOwner: string, toOperator?: string, provider?: Provider): TransactionData; /** * Returns a promise containing a signed transaction to transfer range order liquidity to another owner and operator. * @param poolAddress {string} Contract address of the pool. * @param size {BigNumberish} Amount of liquidity transferred. Liquidity is denominated in option contracts that can be sold or (potentially) bought. * @param positionKey {PositionKey} Position key parametrizing the range order that should be transferred. * @param toOwner {string} Address of the owner receiving the range order liquidity. * @param toOperator {string} Address of the owner receiving the range order liquidity. * @param provider {Provider} The custom provider to use for this call. * @returns {Promise} Promise containing the contract transaction. */ transferPositionWithKey(poolAddress: string, size: BigNumberish, positionKey: PositionKey, toOwner: string, toOperator?: string, provider?: Provider): Promise; }