Revenue & Fees

How partners earn revenue on leveraged trades.

This document explains how fees work on Lavarage, how partners earn revenue, and how to compute fees in your integration.

Key Takeaways

  1. Fees are charged at position open, not close.
  2. Partners keep 100% of their configured markup — collected atomically on-chain.
  3. Your feeBps is set during onboarding and can be customized per token.
  4. LONG fees don't reduce the position. They're paid separately from the user's wallet.
  5. SHORT fees reduce the swap amount. They're deducted from borrowed tokens before the Jupiter swap.

How Partner Fees Work

When a trade is placed through your integration, the on-chain program collects a fee and splits it automatically:

  • Protocol base fee — a small fixed fee retained by Lavarage
  • Partner fee (feeBps) — your markup, transferred directly to your wallet

The user pays a single combined fee. The on-chain program handles the split atomically — your share arrives in your feeWalletAddress in the same transaction as the trade.

Your fee configuration

  • feeBps is set during partner onboarding and stored in your partner profile
  • Per-token overrides are supported — set different fees for specific tokens (e.g., higher on volatile tokens, lower on majors)
  • If no per-token override exists, your default feeBps is used
  • Contact us to configure or update your fee settings

Fee Basis: LONG vs SHORT

Your feeBps applies the same way for both sides. What differs is what the fee is calculated on and where it comes from. This matters for position sizing and UX.

LONG positions

  • Fee calculated on: positionSize = collateral x leverage (the total position)
  • Paid from: User's wallet, as a separate transfer on top of collateral
  • Impact on position: None. The full positionSize goes to the Jupiter swap.
  • On-chain flow:
    1. Fee collected from user's quote token account (protocol + partner split)
    2. Borrowed tokens arrive from lender's node wallet
    3. Account now holds exactly positionSize → goes to Jupiter swap

SHORT positions

  • Fee calculated on: borrowAmount = collateral x (leverage - 1) (only the borrowed portion)
  • Paid from: Borrowed tokens, deducted before the swap
  • Impact on position: The swap input is borrowAmount - fee. This reduces the effective position size.
  • On-chain flow:
    1. Lender's node wallet sends borrowAmount to user's volatile token account
    2. Fee collected from that account (protocol + partner split)
    3. Remaining tokens go to Jupiter swap

Comparison

LONGSHORT
Fee calculated onpositionSize (total position)borrowAmount (borrowed only)
Paid fromUser's wallet (separate)Borrowed tokens (before swap)
Reduces swap amount?NoYes
User costcollateral + feecollateral (fee absorbed from borrow)

Why this matters for your UI: For LONG, you can show the fee as a line item above the swap. For SHORT, the fee reduces what gets swapped — the effective position is slightly smaller than the leverage would suggest.


Other Transaction Costs

CostAmountWhen
Solana network fee~0.000005 SOLEvery transaction
Account rent~0.01 SOLRefunded when position closes
Jito tip (optional)Configurable (astralaneTipLamports)If using MEV protection

Computing Fees in Your Integration

You can estimate the fee your users will pay before submitting a trade.

LONG

fee = positionSize x feeBps / 10000
totalUserCost = collateralAmount + fee

SHORT

fee = borrowAmount x feeBps / 10000
swapInput = borrowAmount - fee

Note: The actual on-chain fee includes both the protocol base fee and your partner fee. The formulas above use your feeBps for estimation. The exact total fee is computed on-chain. Use the /quote endpoint to preview the trade including fees — see Leverage Mechanics.

Per-token override

If you've configured a per-token feeBps for a specific token, that value is used instead of your default:

fee = positionSize x tokenSpecificFeeBps / 10000

Revenue Settlement

  • Fees are collected atomically on-chain at position open — not batched or delayed.
  • Your share is transferred directly to the token account (ATA) of your configured feeWalletAddress.
  • If your ATA doesn't exist for a given token, it's created automatically as part of the transaction.
  • You can track your earned fees via the partner dashboard or by monitoring your feeWalletAddress on-chain.

Getting Started

To set up partner fee revenue:

  1. Contact us at lavarage.xyz/partners to set up your partner account
  2. Provide your feeWalletAddress (Solana wallet to receive fee revenue)
  3. Choose your feeBps markup
  4. Optionally configure per-token fee overrides
  5. We'll associate the fee config with your API key — fees route automatically on every trade through your integration