import { a as TObject, s as TString } from "../../helpers-DutyHbVD.mjs"; import { t as TUnsafe } from "../../unsafe-C_mX8nG4.mjs"; import { t as TNumber } from "../../number-BDPWg_Sz.mjs"; import { t as TOptional } from "../../optional-Bis1WTKK.mjs"; //#region extensions/crypto/src/tools/cost-basis.d.ts /** * Cost Basis & P&L Tool — Track trade history and calculate profit/loss. * * Records buy/sell prices per token, computes unrealized and realized P&L * using FIFO (first-in, first-out) cost basis. Persists trade records to * disk so data survives agent restarts. * * Actions: * record_trade — Manually record a trade (buy/sell) with price data * portfolio_pnl — Show unrealized P&L for all held tokens * token_pnl — Show detailed P&L for a specific token * history — List recent trade records * export — Export full trade history as JSON * * The after_tool_call hook in index.ts should call recordSwapTrade() when * defi_swap completes to auto-record trades. */ /** * Called by after_tool_call hook when a swap completes. * Records the trade automatically. */ declare function recordSwapTrade(params: { token: string; symbol: string; amount: number; priceUsd: number; type: 'buy' | 'sell'; txHash?: string; }): void; declare function createCostBasisTool(): { name: string; label: string; ownerOnly: boolean; description: string; parameters: TObject<{ action: TUnsafe<"history" | "record_trade" | "portfolio_pnl" | "token_pnl" | "export">; token: TOptional; symbol: TOptional; type: TOptional>; amount: TOptional; price_usd: TOptional; current_price: TOptional; tx_hash: TOptional; limit: TOptional; }>; execute: (_toolCallId: string, args: unknown) => Promise<{ content: Array<{ type: "text"; text: string; }>; details: unknown; }>; }; //#endregion export { createCostBasisTool, recordSwapTrade }; //# sourceMappingURL=cost-basis.d.mts.map