UNPKG

@stabilis/c9-shape-liquidity-getter

Version:

A library for calculating redemption values of concentrated liquidity positions for C9 shape liquidity.

29 lines (28 loc) 1.13 kB
/** * Calculates the tick for a given price * @param price The price to calculate the tick for * @returns The calculated tick */ export declare function calculateTick(price: number | string): number; /** * Calculates the price for a given tick * @param tick The tick to calculate the price for * @returns The calculated price */ export declare function calculatePrice(tick: number): string; /** * Calculates the bin start tick for a given tick and bin span * @param tick The tick to calculate the bin start for * @param binSpan The bin span * @returns The bin start tick */ export declare function calculateBinStartTick(tick: number, binSpan: number): number; /** * Calculates the fraction of a bin that is within the price bounds * @param binStartTick The start tick of the bin * @param binSpan The bin span * @param lowerBoundTick The lower bound tick * @param upperBoundTick The upper bound tick * @returns The fraction of the bin that is within bounds (0-1) */ export declare function calculateBinFraction(binStartTick: number, binSpan: number, lowerBoundTick: number, upperBoundTick: number): number;