Fee Structure
Complete breakdown of all protocol fees
Fee Structure
Section titled “Fee Structure”All fees charged by the Turbine.cash protocol.
Overview
Section titled “Overview”| Operation | Fee Rate | Paid By |
|---|---|---|
| Deposit | [PLACEHOLDER: FEE_DEPOSIT_PCT] | Depositor |
| Withdraw | [PLACEHOLDER: FEE_WITHDRAW_PCT] | Withdrawn amount |
| Swap | [PLACEHOLDER: FEE_SWAP_PCT] | Withdrawn amount |
| Revert | Same as deposit | Original depositor |
Deposit Fees
Section titled “Deposit Fees”When you deposit tokens, a fee is deducted:
netDeposit = depositAmount - depositFeedepositFee = depositAmount * (depositFeeBps / 10000)Example
Section titled “Example”const depositAmount = 100_000_000; // 100 USDCconst depositFeeBps = 50; // 0.5% [PLACEHOLDER]
const fee = depositAmount * depositFeeBps / 10000;// fee = 500_000 (0.5 USDC)
const netDeposit = depositAmount - fee;// netDeposit = 99_500_000 (99.5 USDC)Withdrawal Fees
Section titled “Withdrawal Fees”The relayer deducts a fee from withdrawals:
recipientReceives = withdrawAmount - relayFeerelayFee = withdrawAmount * (withdrawFeeBps / 10000)Example
Section titled “Example”const withdrawAmount = 99_500_000; // Amount in poolconst withdrawFeeBps = 100; // 1% [PLACEHOLDER]
const fee = withdrawAmount * withdrawFeeBps / 10000;// fee = 995_000 (0.995 USDC)
const received = withdrawAmount - fee;// received = 98_505_000 (98.505 USDC)Swap Fees
Section titled “Swap Fees”Withdraw+swap has additional fees:
totalFee = withdrawFee + swapFee + jupiterFees
recipientReceives = (swapOutput - swapFee) * (1 - jupiterFees)Components
Section titled “Components”| Fee | Description |
|---|---|
| Withdraw Fee | Protocol withdrawal fee |
| Swap Fee | Additional fee for swap service |
| Jupiter Fees | DEX routing fees (varies) |
Example
Section titled “Example”// Withdraw 100 USDC, swap to SOLconst withdrawAmount = 100_000_000;const withdrawFeeBps = 100; // 1%const swapFeeBps = 50; // 0.5%
// Step 1: Withdraw feeconst afterWithdrawFee = withdrawAmount * (10000 - withdrawFeeBps) / 10000;// 99_000_000 USDC
// Step 2: Swap (Jupiter handles conversion + their fees)const jupiterOutput = /* varies by market */;
// Step 3: Swap feeconst afterSwapFee = jupiterOutput * (10000 - swapFeeBps) / 10000;// Final SOL amount receivedFee Distribution
Section titled “Fee Distribution”| Recipient | Share |
|---|---|
| Protocol Treasury | ~90% (varies) |
| Affiliate | [PLACEHOLDER: AFFILIATE_FEE_PCT] |
Fee Calculation Helpers
Section titled “Fee Calculation Helpers”const BPS_DENOMINATOR = 10000;
function calculateFee(amount: bigint, feeBps: number): bigint { return (amount * BigInt(feeBps)) / BigInt(BPS_DENOMINATOR);}
function calculateNetAmount(amount: bigint, feeBps: number): bigint { return amount - calculateFee(amount, feeBps);}
function calculateGrossFromNet(netAmount: bigint, feeBps: number): bigint { return (netAmount * BigInt(BPS_DENOMINATOR)) / BigInt(BPS_DENOMINATOR - feeBps);}
// Examplesconst deposit = 100_000_000n;const depositFee = calculateFee(deposit, 50); // 0.5%const netDeposit = calculateNetAmount(deposit, 50);
console.log(`Deposit: ${deposit}`);console.log(`Fee: ${depositFee}`);console.log(`Net: ${netDeposit}`);On-Chain Fee Configuration
Section titled “On-Chain Fee Configuration”Fees are stored in the MerkleState account:
interface MerkleState { // ... depositFeeBps: number; // Deposit fee in basis points withdrawFeeBps: number; // Withdrawal fee in basis points}
// Query current feesconst merkle = await program.account.merkleState.fetch(merklePda);console.log('Deposit fee:', merkle.depositFeeBps / 100, '%');console.log('Withdraw fee:', merkle.withdrawFeeBps / 100, '%');Fee Changes
Section titled “Fee Changes”Fee rates may change over time:
- Changes require admin transaction
- Changes apply to future transactions only
- Historical fees remain as recorded
Comparison: Total Cost
Section titled “Comparison: Total Cost”| Scenario | Total Fees |
|---|---|
| Deposit → Wait → Withdraw | Deposit + Withdraw |
| Deposit → Withdraw+Swap | Deposit + Withdraw + Swap + Jupiter |
| Deposit → Revert | Deposit fee (no withdrawal) |
Total Cost Example
Section titled “Total Cost Example”Deposit 100 USDC, withdraw to SOL:
Initial: 100.00 USDC- Deposit: -0.50 USDC (0.5%)In pool: 99.50 USDC- Withdraw: -0.995 USDC (1%)After fee: 98.505 USDC→ Jupiter: ~X.XX SOL (market rate - Jupiter fees)- Swap fee: -0.5%Final: ~X.XX SOLGas Costs
Section titled “Gas Costs”In addition to protocol fees, transactions require SOL for:
| Transaction | Typical Cost |
|---|---|
| Deposit | ~0.005 SOL |
| Withdraw (via relayer) | Paid by relayer |
| Revert | ~0.005 SOL |
| Create Affiliate | ~0.01 SOL |