Skip to main content

Module fees

Module fees 

Source
Expand description

Fee math shared by the bonding-curve and AMM quote paths.

Ports @pump-fun/pump-sdk-internal/src/fees.ts and @pump-fun/pump-swap-sdk/src/sdk/fees.ts. All values are basis points (u64) the way the on-chain programs store them.

Structs§

AmmFeeBps
AMM fees split into LP, protocol, and coin-creator components.
BondingCurveFeeBps
Bonding-curve fees split into protocol and creator components. The AMM-style LP fee is not part of the bonding-curve fee model.

Functions§

bonding_curve_market_cap
Bonding-curve market cap in lamports. marketCap = virtualQuoteReserves * mintSupply / virtualTokenReserves.
ceil_div
ceil(a / b) for non-zero b. Mirrors ceilDiv in both TS SDKs.
compute_amm_fee_bps
Resolve the bps for an AMM trade. Mirrors pump-swap-sdk’s computeFeesBps: pump pools (creator == pool-authority PDA) get tiered fees; third-party pools get the flat_fees table; with no fee_config, fall back to flat globals on GlobalConfig.
compute_bonding_curve_fee_bps
Resolve the bps for a bonding-curve trade. When fee_config is None, fall back to the flat fees on Global. When provided, use the tiered fees indexed by current market cap.
fee_amount
ceil(amount * basis_points / 10_000). Mirrors fee() in both TS SDKs.
is_pump_pool
true iff pool_creator matches the canonical pump-program-derived pool authority for base_mint. Used to decide whether a pool gets tiered fees (pump pools) or flat fees (third-party pools).
pool_market_cap
AMM pool market cap in lamports. marketCap = quoteReserve * baseMintSupply / baseReserve.