deepbook-margin-referral

Installation
SKILL.md

DeepBook Margin: Supply Referral System

The supply referral system allows users to earn a portion of the protocol fees generated by liquidity suppliers they refer. When a supplier deposits assets using a referral ID, the referrer earns fees proportional to the interest paid by borrowers over time.


1. How It Works

The referral system uses a shares-based tracking mechanism:

  1. Create Referral: Mint a SupplyReferral object for a specific margin pool.
  2. Referral ID: Suppliers provide your referral ID when depositing/supplying liquidity to the pool.
  3. Accumulate Shares: The referrer's shares in the pool's referral tracker increase proportionally to the supplier's deposited position size.
  4. Earn Fees: As borrowers pay interest, a percentage goes to protocol fees, and a portion of those protocol fees is distributed to the referrer's claimable fees.
  5. Withdrawal Decrease: When a referred supplier withdraws their liquidity, the referrer's tracking shares decrease.
  6. Claim Fees: Referrers can claim and withdraw accumulated fees at any time.

Installs
1
First Seen
Sep 4, 2026
deepbook-margin-referral — nickthelegend/sui-deepbook-skills