Something.cool
  • Getting started
    • Why Something.cool?
    • 1st stage - Bonding curve
    • 2nd stage - CoolDEX trading
  • Zero-fee coins
    • What is Zero-fee coin?
    • How to launch Zero-fee coin
  • Community coins
    • What is Community coin?
    • Community contribution / How it works?
      • Holders
      • Liquidity providers
      • Burning
    • How to launch Сommunity coin
  • Features
    • Coin Explore
      • New Pairs
      • Coin Vision
    • Spaces
    • Rewards
  • Community
    • Referral program
    • X
    • Media kit
  • Developer Resources
  • Platform Architecture
    • Technical Introduction
    • Overview
    • Components
  • SC Bonding Curve
    • Overview
    • Functions
      • Create Token
      • Buy Token
      • Sell Token
      • Migrate
      • Admin Set Properties
    • Price Calculation
    • Fees
  • CoolDEX
    • Overview
    • Functions
      • Initialize Pool
      • Swap Base In
      • Swap Base Out
      • Deposit
      • Withdraw
      • Withdraw PnL
    • Price Calculation
    • Fees
  • Token Types
    • Token Types
  • Migration Process
    • Migration Process
  • Rewards Claiming
    • Overview
    • Authentication
    • Endpoints
    • Errors
    • Example
  • Reference
    • SC Bonding Curve IDL
    • CoolDEX IDL
    • Log Structure
    • DEVNET EXAMPLES
  • INTERNAL API
    • Overview
    • Register
  • Example: Registering a User via Internal API (JavaScript)
Powered by GitBook
On this page
  • Token Types and Fee Structures
  • 1. Zero Fee Tokens
  • 2. Community Contribution Tokens
  • Fee Collection and Distribution
  • Fee Collection
  • Fee Distribution Mechanisms
  • Direction-Specific Fee Logic
  • Fee Parameters
  • Example Fee Calculation
  1. CoolDEX

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:

  1. Swap Base In: Fees are deducted from the input amount

  2. 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:

  1. A portion of the input tokens is deducted as fee

  2. 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

  3. 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:

  1. A portion of the input SOL is deducted as fee

  2. 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

  3. 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:

swap_fee = 1000 * 0.05 = 50 TOKEN
platform_fee = 50 * 0.1 = 5 TOKEN
remaining_fee = 50 - 5 = 45 TOKEN

burn_amount = 45 * 0.5 = 22.5 TOKEN
holders_amount = 45 * 0.3 = 13.5 TOKEN
lp_amount = 45 * 0.2 = 9 TOKEN

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

PreviousPrice CalculationNextToken Types

Last updated 2 months ago