Skip to content

Feature/Referral fees by bps set up#8

Open
bathord wants to merge 11 commits intomainfrom
feature/referral-fees
Open

Feature/Referral fees by bps set up#8
bathord wants to merge 11 commits intomainfrom
feature/referral-fees

Conversation

@bathord
Copy link
Copy Markdown
Collaborator

@bathord bathord commented Mar 14, 2026

Summary

  • Introduced a configurable referral taker fee in bps as an alternative to the existing multiplier-based fee. Solves charging fees on whitelisted pools, where the multiplier approach doesn't work because taker fees are zero.
  • Added ReferralTakerFeeConfig dynamic field to Pool, keyed by referral ID, to store per-referral taker fee rates (max 10 bps).
  • Implemented update_pool_referral_taker_fee_rate to allow referral owners to set their bps taker fee rate.
  • Enforced mutual exclusivity: multiplier can only be set when bps taker fee rate is absent or zero; bps taker fee rate can only be set when multiplier is zero.
  • Updated process_referral_fees to apply exactly one fee mode: bps (fraction of traded volume) or multiplier (fraction of taker fees paid).
  • 100% test coverage.

@avernikoz avernikoz changed the base branch from main to feature/events-for-pnl March 15, 2026 07:04
@avernikoz avernikoz changed the base branch from feature/events-for-pnl to main March 15, 2026 07:04
@avernikoz avernikoz changed the title Feature/volume-based referral fees Feature/Referral fees bps set up Mar 15, 2026
@avernikoz avernikoz changed the title Feature/Referral fees bps set up Feature/Referral fees by bps set up Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants