export declare const MAX_FEE_BPS = 10000n; export declare const SECONDS_PER_YEAR: bigint; /** * Matches `DEAD_WEIGHT` in the program. The first deposit ever made into a * vault donates this many LP units permanently to the vault to prevent * inflation/donation attacks; subsequent deposits are unaffected. */ export declare const DEAD_WEIGHT_LP = 1000n; export declare function maxBigInt(a: bigint, b: bigint): bigint; export declare function minBigInt(a: bigint, b: bigint): bigint; /** Ceiling division for positive bigints. */ export declare function ceilDivBigInt(a: bigint, b: bigint): bigint; export declare function nowSeconds(): bigint; /** * Mirrors the program-side locked-profit decay: the locked profit drops * linearly over `lockedProfitDegradationDuration` and is zero once that * window has elapsed. Note: the legacy JS SDK measured elapsed time from * `lastUpdatedLockedProfit` (an amount, not a timestamp), which produced * incorrect values; this port follows the program, which uses `lastReport`. */ export declare function calculateLockedProfit(lastUpdatedLockedProfit: bigint, lockedProfitDegradationDuration: bigint, currentTimeSec: bigint, lastReport: bigint): bigint; /** * Estimates the LP that would be minted to cover management fees accrued * since `lastManagementFeeUpdateTs`. Returns 0n when the inputs make the * fee calculation undefined (no time elapsed, no assets, etc.). * * Both rounding steps are ceiling divisions, matching the program's * `calc_management_fee_amount_in_asset` and `calc_fee_lp_to_mint` — flooring * the asset fee first would understate the LP that should be minted whenever * the accrued fee isn't an exact multiple of the denominator. */ export declare function calculateUnrealisedLpFees(currentTotalLp: bigint, assetTotalValue: bigint, lastManagementFeeUpdateTs: bigint, managementFeeBps: bigint, currentTimeSec?: bigint): bigint; /** * Total LP supply the program treats as outstanding for accounting: * circulating LP + accumulated (but unharvested) fee LP + dead weight LP. * Matches `Vault::get_total_lp_supply_incl_fees` in the program. */ export declare function getTotalLpSupplyInclFees(args: { lpSupply: bigint; vaultAccumulatedLpAdminFees: bigint; vaultAccumulatedLpManagerFees: bigint; vaultAccumulatedLpProtocolFees: bigint; vaultDeadWeight: bigint; }): bigint; export type AssetsForWithdrawInputs = { vaultTotalValue: bigint; vaultLastUpdatedLockedProfit: bigint; vaultLastReport: bigint; vaultLockedProfitDegradationDuration: bigint; vaultAccumulatedLpAdminFees: bigint; vaultAccumulatedLpManagerFees: bigint; vaultAccumulatedLpProtocolFees: bigint; vaultDeadWeight: bigint; vaultRedemptionFeeBps: number; vaultManagementFeeBps: number; vaultLastManagementFeeUpdateTs: bigint; lpSupply: bigint; lpAmount: bigint; currentTimeSec?: bigint; }; export declare function calculateAssetsForWithdrawAmount(inputs: AssetsForWithdrawInputs): bigint; export type LpForWithdrawInputs = Omit & { assetAmount: bigint; }; /** * Computes the LP that must be burned to redeem at least `assetAmount`, * matching `calc_withdraw_lp_to_burn` in the program (which rounds up so * the burn always covers the requested asset amount). Flooring here would * underquote the burn and either revert or short-redeem. */ export declare function calculateLpForWithdrawAmount(inputs: LpForWithdrawInputs): bigint; export type LpForDepositInputs = { vaultTotalValue: bigint; vaultAccumulatedLpAdminFees: bigint; vaultAccumulatedLpManagerFees: bigint; vaultAccumulatedLpProtocolFees: bigint; vaultDeadWeight: bigint; vaultIssuanceFeeBps: number; vaultManagementFeeBps: number; vaultLastManagementFeeUpdateTs: bigint; lpSupply: bigint; assetAmount: bigint; /** Required when the pool is empty so the 1:1 mint can scale precision correctly. */ assetDecimals: number; /** Required when the pool is empty so the 1:1 mint can scale precision correctly. */ lpDecimals: number; currentTimeSec?: bigint; }; export declare function calculateLpForDepositAmount(inputs: LpForDepositInputs): bigint; //# sourceMappingURL=math.d.ts.map