/** * Multi-range bonding curve math — mirrors the Rust DBC program's curve.rs. * Supports up to 16 active price ranges (20 in config storage). */ import type { CurvePoint, SwapQuote } from "../types/index.js"; export interface CurveRange { sqrtPriceLower: bigint; sqrtPriceUpper: bigint; liquidity: bigint; } /** Build ordered ranges from PoolConfig curve points + start price */ export declare function buildRanges(sqrtStartPrice: bigint, curvePoints: CurvePoint[]): CurveRange[]; /** * Quote an exact-in swap (buy: quote → base). * Iterates through ranges until amountIn is consumed. */ export declare function quoteExactInBuy(sqrtPrice: bigint, ranges: CurveRange[], amountIn: bigint, feeNumerator: bigint): SwapQuote; /** * Quote an exact-in swap (sell: base → quote). */ export declare function quoteExactInSell(sqrtPrice: bigint, ranges: CurveRange[], amountIn: bigint, feeNumerator: bigint): SwapQuote; /** Check if current price has reached the migration threshold */ export declare function hasReachedMigration(quoteReserve: bigint, migrationQuoteThreshold: bigint): boolean; /** Clamp sqrt_price to protocol bounds */ export declare function clampSqrtPrice(sqrtPrice: bigint): bigint; //# sourceMappingURL=curve-math.d.ts.map