/** * Adaptive Bonding Curve Client * * Wraps the base DBC program with an intelligent adaptation layer: * 1. Reads sentiment state from clawd_protocol PDA * 2. Adjusts effective fee before quoting * 3. Builds update_curve_sentiment instructions when interval has elapsed * 4. Exposes enriched swap quotes with sentiment context */ import type { Connection, PublicKey } from "@solana/web3.js"; import type { AdaptiveCurveConfig, SwapQuote, SdkInstructions } from "../types/index.js"; import type { CurveRange } from "./curve-math.js"; export interface EnrichedSwapQuote extends SwapQuote { effectiveFeeNumerator: bigint; sentimentScore: bigint; sentimentLabel: string; isAdaptiveActive: boolean; } export interface AdaptiveSwapParams { sqrtPrice: bigint; quoteReserve: bigint; baseReserve: bigint; buyBaseForQuote: boolean; amountIn: bigint; } export declare class AdaptiveCurve { private readonly config; private readonly dbcPool; private ranges; constructor(config: AdaptiveCurveConfig, dbcPool: PublicKey); /** Quote a swap with sentiment-adjusted fee */ quoteSwap(connection: Connection, params: AdaptiveSwapParams): Promise; /** Quote without network call (offline, uses base fee only) */ quoteOffline(params: AdaptiveSwapParams): SwapQuote; /** * Build an update_curve_sentiment instruction if the interval has elapsed. * Returns null if too soon to update. */ buildSentimentUpdateInstruction(connection: Connection, caller: PublicKey, recentBuyVolume: bigint, recentSellVolume: bigint, windowSlots: number, currentSlot: bigint, lastUpdateSlot: bigint): SdkInstructions | null; /** Rebuild curve ranges (call after config update) */ refreshRanges(): void; get currentRanges(): CurveRange[]; } /** * Design a default 10-range bonding curve for agent token launches. * * Price increases exponentially from start → migration. * Liquidity is front-loaded (more liquidity at lower prices for early stability). */ export declare function designDefaultAgentCurve(opts: { startPrice: number; migrationPrice: number; numRanges?: number; frontLoadFactor?: number; }): AdaptiveCurveConfig; //# sourceMappingURL=adaptive-curve.d.ts.map