Quoter
Quoter Class Reference
The ReadQuoter class provides a read-only interface to the Uniswap V4 Quoter contract for getting price quotes without executing transactions.
Constructor
new ReadQuoter(quoteV4Address: Address, drift: Drift<ReadAdapter>)Parameters:
quoteV4Address- Contract address of the V4 Quoterdrift- Drift instance for blockchain interaction (defaults to new instance)
Methods
quoteExactInputV4
Get a price quote for swapping an exact amount of input tokens.
async quoteExactInputV4(
params: FunctionArgs<V4QuoterABI, 'quoteExactInputSingle'>['params']
): Promise<FunctionReturn<V4QuoterABI, 'quoteExactInputSingle'>>Parameters:
params- Arguments for the quoteExactInputSingle contract method
Returns: Promise resolving to raw contract return values
quoteExactOutputV4
Get a price quote for receiving an exact amount of output tokens.
Parameters:
params- Arguments for the quoteExactOutputSingle contract method
Returns: Promise resolving to raw contract return values
Example Usage
Key Features
Price Quotes: Get accurate price quotes for both exact input and output swaps
No Gas Required: Simulate swap outcomes without executing transactions
V4 Compatible: Designed specifically for Uniswap V4 pools
Type Safety: Full TypeScript support with proper type definitions
Last updated