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
- Fees are charged at position open, not close.
- Partners keep 100% of their configured markup — collected atomically on-chain.
- Your
feeBpsis set during onboarding and can be customized per token. - LONG fees don't reduce the position. They're paid separately from the user's wallet.
- 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
feeBpsis 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
feeBpsis 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
positionSizegoes to the Jupiter swap. - On-chain flow:
- Fee collected from user's quote token account (protocol + partner split)
- Borrowed tokens arrive from lender's node wallet
- 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:
- Lender's node wallet sends
borrowAmountto user's volatile token account - Fee collected from that account (protocol + partner split)
- Remaining tokens go to Jupiter swap
- Lender's node wallet sends
Comparison
| LONG | SHORT | |
|---|---|---|
| Fee calculated on | positionSize (total position) | borrowAmount (borrowed only) |
| Paid from | User's wallet (separate) | Borrowed tokens (before swap) |
| Reduces swap amount? | No | Yes |
| User cost | collateral + fee | collateral (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
| Cost | Amount | When |
|---|---|---|
| Solana network fee | ~0.000005 SOL | Every transaction |
| Account rent | ~0.01 SOL | Refunded 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
feeBpsfor estimation. The exact total fee is computed on-chain. Use the/quoteendpoint 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
feeWalletAddresson-chain.
Getting Started
To set up partner fee revenue:
- Contact us at lavarage.xyz/partners to set up your partner account
- Provide your
feeWalletAddress(Solana wallet to receive fee revenue) - Choose your
feeBpsmarkup - Optionally configure per-token fee overrides
- We'll associate the fee config with your API key — fees route automatically on every trade through your integration
Updated 24 days ago