Skip to main content

Module fees

Module fees 

Source
Expand description

Fee math for bonding-curve and AMM quotes (basis points as u64).

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.
compute_amm_fee_bps
AMM trade fee bps: tiered for pump pools, flat_fees for others, else globals.
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.
creator_fee_amount
fee_amount(amount, basis_points), or 0 when creator is Pubkey::default() (the convention for “no creator fee on this trade”).
fee_amount
ceil(amount * basis_points / 10_000).
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.