@devasher/kuru-sdk
Version:
Ethers v6 SDK to interact with Kuru (forked from @kuru-labs/kuru-sdk)
55 lines • 3.66 kB
TypeScript
import { ethers } from 'ethers';
import { MarketParams } from '../types';
export declare abstract class CostEstimator {
/**
* @dev Estimates the amount of quote tokens that would be received for a market sell order of a given size.
* @param providerOrSigner - The ethers.js provider to interact with the blockchain.
* @param orderbookAddress - The address of the order book contract.
* @param marketParams - The market parameters including price and size precision.
* @param size - The size of the base asset to sell.
* @returns A promise that resolves to the amount of quote tokens received.
*/
static estimateMarketSell(providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, orderbookAddress: string, marketParams: MarketParams, size: number): Promise<{
output: number;
estimatedGas: bigint;
}>;
static returnMarketSellEstimate(providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, orderbookAddress: string, size: bigint): Promise<{
output: bigint;
estimatedGas: bigint;
}>;
/**
* @dev Estimates the amount of base tokens required to receive a given amount of quote tokens from a market sell order.
* @param providerOrSigner - The ethers.js provider to interact with the blockchain.
* @param orderbookAddress - The address of the order book contract.
* @param marketParams - The market parameters including price and size precision.
* @param quoteAmount - The amount of quote tokens desired.
* @returns A promise that resolves to the amount of base tokens required.
*/
static estimateRequiredBaseForSell(providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, orderbookAddress: string, marketParams: MarketParams, quoteAmount: number, l2Book: any, contractVaultParams: any): Promise<number>;
/**
* @dev Estimates the amount of base tokens that would be received for a market buy order given a certain amount of quote tokens.
* @param providerOrSigner - The ethers.js provider to interact with the blockchain.
* @param orderbookAddress - The address of the order book contract.
* @param marketParams - The market parameters including price and size precision.
* @param quoteAmount - The amount of quote tokens to spend.
* @returns A promise that resolves to the amount of base tokens received.
*/
static estimateMarketBuy(providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, orderbookAddress: string, marketParams: MarketParams, quoteAmount: number): Promise<{
output: number;
estimatedGas: bigint;
}>;
static returnMarketBuyEstimate(providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, orderbookAddress: string, size: bigint): Promise<{
output: bigint;
estimatedGas: bigint;
}>;
/**
* @dev Estimates the amount of quote tokens required to buy a given amount of base tokens in a market buy order.
* @param providerOrSigner - The ethers.js provider to interact with the blockchain.
* @param orderbookAddress - The address of the order book contract.
* @param marketParams - The market parameters including price and size precision.
* @param baseSize - The size of the base tokens to buy.
* @returns A promise that resolves to the amount of quote tokens required.
*/
static estimateRequiredQuoteForBuy(providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, orderbookAddress: string, marketParams: MarketParams, baseTokenAmount: number, l2Book: any, contractVaultParams: any): Promise<number>;
}
//# sourceMappingURL=estimator.d.ts.map