Expand description
Fee math for bonding-curve and AMM quotes (basis points as u64).
Structs§
- AmmFee
Bps - AMM fees split into LP, protocol, and coin-creator components.
- Bonding
Curve FeeBps - 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-zerob.- compute_
amm_ fee_ bps - AMM trade fee bps: tiered for pump pools,
flat_feesfor others, else globals. - compute_
bonding_ curve_ fee_ bps - Resolve the bps for a bonding-curve trade. When
fee_configisNone, fall back to the flat fees onGlobal. When provided, use the tiered fees indexed by current market cap. - creator_
fee_ amount fee_amount(amount, basis_points), or0whencreatorisPubkey::default()(the convention for “no creator fee on this trade”).- fee_
amount ceil(amount * basis_points / 10_000).- is_
pump_ pool trueiffpool_creatormatches the canonical pump-program-derived pool authority forbase_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.