4-Tier Fee System
Worldbook implements a sophisticated 4-tier dynamic fee system that provides flexibility for different trading scenarios and user types.
Fee Structure Overview
The fee system consists of four layers that are applied sequentially:
Default Fees - Base protocol-wide fees
OrderBook Overrides - Specific fees for individual trading pairs
User Percentage Discounts - Volume-based or tier-based discounts
User Absolute Discounts - Fixed reductions in basis points
Fee Calculation
Fees are calculated in basis points where 1,000,000 basis points = 100%. The maximum allowed fee is 5,000 basis points (0.5%).
Taker fees are charged when your order executes against existing orders in the order book
Maker fees are charged when your limit order is added to the order book and later filled by another trader
Maker rebates - Maker fees can be negative, providing rebates to liquidity providers
4-Tier Fee System
Layer 1: Default Fees
The protocol sets base maker and taker fees that apply to all OrderBooks by default:
Default Maker Fee: Can be positive (fee) or negative (rebate)
Default Taker Fee: Always non-negative
Maximum Fee: 0.5% (5,000 basis points)
Layer 2: OrderBook-Specific Overrides
Each trading pair can have custom fee rates that override the defaults:
Allows different fees for different asset classes
Enables promotional rates for new pairs
Provides flexibility for market conditions
Layer 3: User Percentage Discounts
Users can receive percentage-based discounts on their fees:
Applied as a multiplier (e.g., 80% = 0.8x the base fee)
Only applies to positive maker fees (not rebates)
Can be based on trading volume, token holdings, or other criteria
Layer 4: User Absolute Discounts
Users can receive fixed discounts in basis points:
Subtracted from the fee after percentage discounts
Can turn positive maker fees into rebates
Provides additional flexibility for VIP traders
Fee Calculation Examples
Example 1: Standard User
Base Maker Fee: 50 basis points (0.05%)
Base Taker Fee: 80 basis points (0.08%)
No discounts applied
Final Maker Fee: 50 basis points
Final Taker Fee: 80 basis points
Example 2: User with Volume Discount
Base Maker Fee: 50 basis points
User Percentage Discount: 60% (0.6x multiplier)
User Absolute Discount: 10 basis points
Calculation: (50 × 0.6) - 10 = 20 basis points
Final Maker Fee: 20 basis points (0.02%)
Example 3: Maker Rebate Scenario
Base Maker Fee: -25 basis points (rebate)
Percentage discounts: Not applied to rebates
Absolute discounts: Not applied to rebates
Final Maker Fee: -25 basis points (0.025% rebate)
Example 4: High-Volume Trader
Base Taker Fee: 80 basis points
User Percentage Discount: 50% (0.5x multiplier)
User Absolute Discount: 30 basis points
Calculation: (80 × 0.5) - 30 = 10 basis points
Final Taker Fee: 10 basis points (0.01%)
Fee Collection
All fees are collected in the token being received:
Buy orders: Taker fees are paid in base tokens
Sell orders: Taker fees are paid in quote tokens
Maker rebates: Paid in the same token type as the taker fee
Fees are automatically deducted from the filled amount and sent to the protocol fee collector address.
Special Considerations
Maker Rebates
When maker fees are negative (rebates):
Rebates are funded from taker fees
Rebates cannot exceed the taker fee amount collected
Rebates are added to the maker's withdrawable balance
No percentage or absolute discounts apply to rebates
Self-Trade Prevention
When self-trade prevention is triggered:
No fees are charged on the prevented trade
The order continues to match with other traders
Normal fees apply to matches with different traders
Post-Only Orders
Post-only orders guarantee maker status:
Always receive maker fees/rebates
Never pay taker fees
Transaction reverts if the order would immediately match
Fee Transparency
All fee rates can be queried from the Manager contract:
getMakerFeeRate(orderbook, user)
- Returns the exact maker fee for a usergetTakerFeeRate(orderbook, user)
- Returns the exact taker fee for a usergetUserFeeRates(orderbook, user)
- Returns both fees in a single call
Last updated