Readonly premiaThe Premia SDK instance.
Protected streamThe current index of quote streams. Used to cancel stale streams.
Private bestPrivate
Selects the best quote from a list of quotes based on a pricing strategy.
An array of quotes.
The size of the trade.
Optional minimumSize: BigNumberishThe minimum size of the trade (optional).
Optional taker: stringThe address of the taker (optional).
Optional provider: ProviderThe custom provider to use for this call.
Calculates the hash of a quote.
calculateQuoteHash
The quote to hash.
The address of the pool.
The calculated hash of the quote.
Checks whether a quote is valid. Can optionally throw an error if the quote is invalid.
The quote to check.
Optional size: BigNumberishThe size of the trade (optional).
Optional taker: stringThe address of the taker (optional).
Optional throwError: boolean = falseWhether to throw an error if the quote is invalid (default is false).
Optional provider: ProviderThe custom provider to use for this call (optional).
Publishes a quote.
The quote to publish.
Optional provider: ProviderThe custom provider to use for this call.
A promise that resolves to the transaction receipt or null if failed.
Publishes a quote using an API key.
The quote to publish.
Publishes a list of quotes.
The list of quotes to publish.
Optional provider: ProviderThe custom provider to use for this call.
A promise that resolves to the transaction receipt or null if failed.
Publishes a list of quotes with an API key.
The list of quotes to publish.
A promise that resolves to the list of returned OB quotes.
Publishes an unsigned quote.
The address of the pool.
The unsigned quote to publish.
Optional provider: ProviderThe custom provider to use for this call.
A promise that resolves to the transaction receipt or null if failed.
Publishes an unsigned quote with an API key.
The address of the pool.
The unsigned quote to publish.
A promise that resolves to the list of returned OB quotes.
Publishes a list of unsigned quotes.
The address of the pool.
The list of unsigned quotes to publish.
Optional provider: ProviderThe custom provider to use for this call.
A promise that resolves to the transaction receipt or null if failed.
Publishes a list of unsigned quotes with an API key.
The address of the pool.
The list of unsigned quotes to publish.
A promise that resolves to the list of returned OB quotes.
Fetches the best quote for a specified pool address and trade size.
The address of the pool.
The size of the trade.
Whether it's a buy or a sell.
Optional minimumSize: BigNumberishThe minimum size of the trade (optional).
Optional referrer: stringThe address of the referrer (optional).
Optional taker: stringThe address of the taker (optional).
Optional provider: ProviderThe custom provider to use for this call (optional).
Optional pool: PoolMinimalThe pool to stream quotes from, passed for optimization purposes (optional).
Signs a quote.
The address of the pool.
The quote to be signed.
A promise that resolves to the signed quote.
Streams quotes for the given options and executes a callback for the best quote.
The options for the quotes stream:
Optional forceWhether to force sending/listening for Request-for-Quotes (optional).
Whether it's a buy or a sell.
Optional minimumThe minimum size of the trade (optional).
Optional pool?: PoolMinimalThe pool to stream quotes from, passed for optimization purposes (optional).
The address of the pool.
Optional poolThe pool key to stream quotes from, passed for optimization purposes (optional).
Optional provider?: ProviderThe custom provider to use for this call (optional).
Optional referrer?: stringThe address of the referrer (optional).
The size of the trade.
Optional taker?: stringThe address of the taker (optional).
The callback to execute for the best quote.
Private tradePrivate
Converts a quote into a fillable quote, with additional properties required for execution.
The address of the pool.
The size of the trade.
The orderbook quote to be converted.
Optional createdAt: numberThe timestamp of the quote's creation (optional).
Optional referrer: stringThe address of the referrer (optional).
Optional provider: ProviderThe custom provider to use for this call.
Optional pool: PoolMinimalStatic calculateCalculates the hash of a quote. This is a static method.
The quote to hash.
The address of the pool.
The id of the chain.
The calculated hash of the quote.
Generated using TypeDoc
Represents a class for handling Orderbook (OB) related operations.