Fees
CoolDEX implements a sophisticated fee structure that varies based on token type and configuration. This page details the different fee structures and their distribution mechanisms.
Token Types and Fee Structures
1. Zero Fee Tokens
Tokens that have migrated from SC Bonding Curve with a zero fee setting (after_migration_fee = 0):
Swap Fee: 0%
No fee distribution: No fees are collected or distributed
2. Community Contribution Tokens
Tokens that have migrated from SC Bonding Curve with a positive fee setting:
Swap Fee Options: 0.25%, 0.5%, 1%, 2%, or 5% (specified during token creation)
Fee Distribution:
Platform: 10% of collected fees go to the platform
Remaining 90% is distributed according to the token creator's specifications:
Burn: Specified percentage of tokens are burned (reduces supply)
Holders: Specified percentage allocated to token holders
LP Providers: Specified percentage allocated to liquidity providers
Fee Collection and Distribution
Fee Collection
Fees are collected during swap operations:
Swap Base In: Fees are deducted from the input amount
Swap Base Out: Fees are added to the calculated input amount
Fee Distribution Mechanisms
Immediate Distribution
Some fees are distributed immediately during the swap transaction:
Burns: For tokens with a burn component, the specified percentage of tokens is burned directly during the swap
Platform Fees: Platform fees are transferred to the platform fee account during the swap
Accumulated Distribution
Other fees accumulate and can be claimed by eligible recipients:
Holder Rewards: Accumulated for token holders who can claim them
LP Rewards: Accumulated for liquidity providers who can claim them
Direction-Specific Fee Logic
Selling Tokens (Coin2PC)
When selling tokens for SOL:
A portion of the input tokens is deducted as fee
Of this fee:
A percentage is burned (if applicable)
A percentage is sent to CULT contribution account
The remaining tokens are added to the pool
From the output SOL:
A percentage is sent to platform tax account
A percentage is sent to CULT contribution account
The remaining SOL is sent to the user
Buying Tokens (PC2Coin)
When buying tokens with SOL:
A portion of the input SOL is deducted as fee
Of this fee:
A percentage is sent to platform tax account
A percentage is sent to CULT contribution account
The remaining SOL is added to the pool
From the output tokens:
A percentage is burned (if applicable)
A percentage is sent to CULT contribution account
The remaining tokens are sent to the user
Fee Parameters
The key fee parameters in the system include:
swap_fee_numerator and swap_fee_denominator: Determine the overall swap fee percentage
cooldex_team_fee_wsol_fee_numerator and cooldex_team_fee_wsol_fee_denominator: Determine the platform's portion of the fee
burn_rate: Determines what percentage of the token fee is burned
SC BONDING CURVE_BURN_RATE_DENOMINATOR: Fixed at 10000, used to calculate percentages
Example Fee Calculation
For a 5% fee token with 50% burn, 30% holders, 20% LP distribution, assuming a 1000 TOKEN swap:
In this example:
22.5 TOKEN would be burned
13.5 TOKEN would accumulate for holder rewards
9 TOKEN would accumulate for LP rewards
5 TOKEN would go to the platform
Last updated