Skip to content

SurfSolana/Jupiter-Ultra-Revenue-Sharing-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 JURSM: Jupiter Ultra Revenue Sharing Manager

Universal Solana transaction verification with yield-optimized revenue sharing

πŸ† Overview

JURSM (Jupiter Ultra Revenue Sharing Manager) is an on-chain escrow and verification system specifically built for Jupiter Ultra API transactions.

Jupiter Ultra is Jupiter's hosted swap API service that handles RPC calls for you, and JURSM provides a trustless way to verify these transactions and distribute referral commissions.

While the signature verification system can work with any Solana transaction, JURSM was purpose-built to solve Jupiter Ultra's fee sharing and verification challenges.

🌟 Why "Jupiter Ultra Revenue Sharing Manager"?

  • Jupiter Ultra: Built specifically for Jupiter's Ultra API service
  • Revenue Sharing: Distributes fees between platform and referral partners
  • Manager: Handles complex multi-party escrow and distribution

⚑ Core Benefits

  • Universal Verification: Works with any Solana transaction, not just Jupiter
  • Dual Mode Flexibility: Choose USDC/CRT or SOL/LST accounting at initialization
  • 100% Yield Generation: All fees immediately converted to yield-bearing tokens
  • Perfect Security: Cryptographically unique transaction signatures
  • No Currency Risk Option: Mode 2 eliminates SOL/USD liability
  • Smart Governance: Single owner start β†’ multisig when needed
  • Zero Complexity: Simple fee tiers, minimal accounts

πŸ”„ Two Revenue Maximization Modes

Mode 1: USDC Payouts

SOL fees β†’ Carrot β†’ Withdrawal as exact USDC amount
  • Platform keeps: ALL Carrot yield above USDC obligations
  • Partners get: Exact USDC amounts (stable, predictable)
  • Best for: Partners who want USD stability

Mode 2: SOL Payouts

SOL fees β†’ LST (JitoSOL) β†’ Withdrawal as exact SOL amount
  • Platform keeps: ALL LST staking yield above SOL obligations
  • Partners get: Exact SOL amounts (crypto native)
  • Best for: Partners comfortable with SOL

Platform always wins: Collect yield on 100% of funds, pay exact amounts, keep the difference!


🧩 Feature Deep Dive

πŸ” Feature 1: Jupiter Ultra Transaction Verification

What it does: Verifies Jupiter Ultra API transactions using cryptographic signatures

Why signature verification is perfect for Jupiter Ultra:

  • Cryptographically Impossible to Fake: Each transaction signature is mathematically unique
  • No Oracle Dependency: Verification happens on-chain using transaction data
  • Trustless Verification: Don't need to trust Jupiter's API or any third party
  • Perfect Audit Trail: Mathematical proof that the exact transaction was executed

The Jupiter Ultra challenge: When using Jupiter Ultra API, your application doesn't directly control the transaction execution - Jupiter's infrastructure does.

This creates a trust problem: how do you verify that Jupiter actually executed the trade as requested? JURSM solves this by requiring users to submit the actual transaction signature after Jupiter executes it, providing cryptographic proof.

Technical reasoning: Solana transactions are signed with ed25519 cryptography. Each signature is unique to that specific transaction data. By requiring users to submit the actual transaction signature from Jupiter's execution, we have mathematical proof that the transaction occurred exactly as specified, without needing to trust Jupiter or any intermediary.

πŸ”’ Feature 2: On-Chain Escrow System

What it does: Creates escrow accounts that hold fees until Jupiter Ultra transaction execution is verified

Why escrow is essential for Jupiter Ultra:

  • Trust Gap Solution: Bridges the gap between fee payment and transaction verification
  • Atomic Fee Collection: Users pay fees upfront, but funds are locked until proof is provided
  • Referral Guarantee: Partners are guaranteed their commission once transaction is verified
  • Fraud Prevention: No way to collect fees without actually executing the Jupiter trade

The timing problem escrow solves:

Without Escrow: User pays fee β†’ Claims they executed trade β†’ How do you verify?
With JURSM Escrow: User pays fee β†’ Fee locked in escrow β†’ User submits signature β†’ Escrow releases funds

How escrow accounts work:

  1. Fee Deposit: User deposits SOL fee into unique escrow account (per transaction)
  2. Immediate CRT Conversion: Escrowed SOL converts directly to CRT for yield generation
  3. USD Accounting: Track exact USD amounts owed (using SOL/USD price at deposit time)
  4. Verification Wait: Funds locked until user submits Jupiter transaction signature
  5. Signature Verification: Smart contract verifies signature matches expected transaction
  6. Automatic Release: Upon verification, partners and platform can claim their shares

Security benefits:

  • No Double-Spending: Each escrow is tied to one specific Jupiter transaction
  • Cryptographic Proof: Can only be unlocked with the actual transaction signature
  • Automatic Enforcement: No human intervention needed for verification
  • Dispute Resolution: Clear on-chain record of all payments and proofs

πŸ’° Feature 3: Exact Amount Tracking

Both modes track exact amounts owed while maximizing yield:

Mode 1: Track USDC amounts owed

  • User pays SOL β†’ Convert to Carrot β†’ Track USD value
  • Partner withdrawal: Exact USDC amount
  • Platform profit: Carrot yield - USDC paid

Mode 2: Track SOL amounts owed

  • User pays SOL β†’ Convert to LST β†’ Track SOL amount
  • Partner withdrawal: Exact SOL amount
  • Platform profit: LST yield - SOL paid

Example:

Mode 1: Collect 1 SOL β†’ Convert to $100 worth of CRT β†’ CRT grows to $106 β†’ Pay $100 USDC β†’ Keep $6
Mode 2: Collect 1 SOL β†’ Convert to 1 jitoSOL β†’ jitoSOL grows to 1.06 SOL value β†’ Pay 1 SOL β†’ Keep 0.06 SOL

πŸš€ Feature 4: Automated Yield Generation

The key to platform profitability: Generate yield on 100% of funds

Mode 1: Carrot (CRT)

  • Optimized DeFi yield across Solana protocols
  • Platform keeps ALL yield above USDC obligations
  • Higher potential returns through active management

Mode 2: JitoSOL (LST)

  • Traditional staking yield (~6% APY)
  • Platform keeps ALL yield above SOL obligations
  • Simple, predictable returns

Revenue example (1000 SOL collected):

Mode 1: 1000 SOL β†’ CRT β†’ 8% yield β†’ Pay exact USDC β†’ Platform keeps ~$8,000/year
Mode 2: 1000 SOL β†’ jitoSOL β†’ 6% yield β†’ Pay exact SOL β†’ Platform keeps ~60 SOL/year

🏦 Feature 5: Smart Payout System

Partners always get exact amounts:

  • Mode 1: Exact USDC payouts
  • Mode 2: Exact SOL payouts

Platform owners get yield-bearing tokens:

  • Mode 1: Keep CRT (continues earning DeFi yield)
  • Mode 2: Keep jitoSOL (continues earning staking yield)

Why this maximizes platform revenue:

  1. Collect 100% of fees as yield-bearing tokens
  2. Pay partners/users exact amounts they're owed
  3. Platform keeps ALL excess yield forever
  4. Owners' tokens continue appreciating after payout

πŸ›‘οΈ Feature 6: Smart Governance Evolution

What it does: Starts as single owner, automatically becomes multisig when second owner added

Why this progression is perfect:

Phase 1 - Single Owner (Launch):

  • Speed: Fast decisions during early development
  • Simplicity: No coordination overhead when building
  • Flexibility: Can pivot quickly based on market feedback
  • Lower Costs: No multisig transaction fees

Phase 2 - Multisig (Growth):

  • Trust & Safety: Multiple parties must agree on ownership changes
  • Investor Protection: Prevents single-party rug pulls
  • Shared Decision Making: Multiple perspectives on major decisions
  • Institutional Ready: Meets requirements for larger partnerships

Automatic Transition:

  • No Manual Setup: Adding second owner automatically enables multisig
  • Irreversible Security: Can't go back to single owner (prevents backdoors)
  • Graduated Complexity: Only add complexity when actually needed

πŸ”„ Feature 7: Multi-Tier Fee Structure

What it does: Three fee tiers with different partner benefits and user discounts

Why tiered structure works:

Default Tier (1% fee, no sharing):

  • Simple Entry: Anyone can use the system
  • Maximum Platform Revenue: 100% of fees to platform
  • Baseline Experience: Standard fee rate

Referred Tier (0.9% effective, 0.1% partner share):

  • User Incentive: 0.1% discount encourages referral usage
  • Partner Motivation: 0.1% commission drives referral activity
  • Balanced Economics: Small discount, small commission

Premium Tier (0.9% effective, 0.3% partner share):

  • High-Value Partners: Rewards partners who bring significant volume
  • Competitive Advantage: Higher commissions attract top partners
  • Quality Focus: Partners work harder to maintain premium status

Economic reasoning: The tiered structure balances user acquisition costs with revenue generation, while providing clear upgrade incentives for partners.


πŸ”„ How Platform Revenue Maximization Works

Both Modes Follow Same Pattern

1. Collect SOL fees
2. Immediately convert to yield-bearing token (CRT or LST)
3. Track exact amounts owed
4. Pay exact amounts on withdrawal
5. Platform keeps ALL excess yield

Mode 1 Example (USDC Payouts)

Day 1: Collect 1 SOL fee ($100) β†’ Convert to CRT
Day 30: CRT worth $108 (8% APY) β†’ Partner claims β†’ Pay $100 USDC
Platform profit: $8 (keeps growing if unclaimed)

Mode 2 Example (SOL Payouts)

Day 1: Collect 1 SOL fee β†’ Convert to 1 jitoSOL
Day 365: 1 jitoSOL = 1.06 SOL β†’ Partner claims β†’ Pay 1 SOL
Platform profit: 0.06 SOL (keeps growing if unclaimed)

πŸ’° Fee Structure

Default (No Partner)

  • User pays: 1.0% of trade amount
  • Platform gets: 1.0%

Referred Tier

  • User pays: 0.9% (gets 0.1% discount)
  • Partner gets: 0.1%
  • Platform gets: 0.8%

Premium Tier

  • User pays: 0.9% (gets 0.1% discount)
  • Partner gets: 0.3%
  • Platform gets: 0.6%

πŸ—οΈ System Architecture

Smart Contract Accounts

UserRegistry

  • Simple list of authorized wallet addresses
  • Admin can add/remove users

PartnerRegistry

  • Partner codes (e.g., "ALEX_REFERRALS")
  • Fee tiers (Default/Referred/Premium)
  • USD earnings tracking

PlatformOwners

  • Ownership percentages
  • Smart governance (single β†’ multisig)
  • LST earnings tracking

FeeTransaction (Per-transaction)

  • User, partner, signature verification
  • USD amounts owed
  • Proof submission status

GlobalTreasury

  • CRT vault (all fees stored here)
  • Price oracle connection
  • Admin permissions

πŸ”§ Core Functions

Administrative

// Start with single owner
initialize(admin, initial_owner)

// Add authorized users
authorize_user(admin, user_wallet)

// Register referral partners  
register_partner(admin, partner_wallet, "ALEX_REFERRALS", PartnerTier::Premium)

// Upgrade to multi-owner (triggers multisig automatically)
add_platform_owner(current_owner, new_owner, percentage_bps)

Fee Processing

// User pays fee for Jupiter trade
deposit_fee(user, partner_code?, trade_amount_usd, expected_signature, seed)

// User submits proof of Jupiter execution
submit_execution(user, escrow, execution_signature)

Claiming

// Partners get stable USDC payouts
claim_partner_earnings(partner, amount_usd)

// Platform owners get LST (keeps earning yield)
claim_platform_owner_earnings(owner, amount_usd)

πŸ“Š Example Flow

1. Setup

# Initialize with single owner
initialize(admin_wallet, platform_owner_wallet)

# Add authorized user
authorize_user(admin, user_123)

# Register premium partner
register_partner(admin, partner_abc, "CRYPTO_ALEX", Premium)

2. Fee Transaction

# User trades $1000 via "CRYPTO_ALEX" partner
# - Platform fee: $10 (1%)
# - User discount: $1 (0.1%) 
# - User pays: $9 in SOL
# - Partner earns: $3 (0.3%)
# - Platform earns: $6 (0.6%)
# - $9 worth of SOL β†’ CRT directly (automatic yield optimization)

deposit_fee(user_123, "CRYPTO_ALEX", 100000, jupiter_sig_123, 1678901234)

3. Verification

# User submits Jupiter transaction signature
submit_execution(user_123, escrow_account, actual_jupiter_signature)

4. Claims

# Partner claims $100 in stable USDC
claim_partner_earnings(partner_abc, 10000) # $100.00 in cents

# Platform owner claims $500 in LST (keeps earning yield)
claim_platform_owner_earnings(platform_owner, 50000) # $500.00 worth

πŸ” Security Model

Signature Verification

  • Cryptographically unique Jupiter transaction signatures
  • No replay attacks possible
  • Perfect proof of trade execution

Access Control

  • User authorization required for all trading
  • Admin manages users/partners (not ownership)
  • Multisig governance for ownership changes

Smart Governance Evolution

Single Owner (Launch) β†’ Add Second Owner β†’ Multisig Mode (Forever)

πŸ’Ž Platform Revenue Strategy

Core Principle: Keep ALL Yield

Collect fees β†’ Generate yield on 100% β†’ Pay exact amounts β†’ Keep difference

Revenue Sources

  1. Base Fees: 60-80% of all fees (after partner shares)
  2. Yield Differential: Keep ALL appreciation above obligations
  3. Time Value: Longer funds stay, more yield accumulated

Mode Comparison

Mode 1 (Carrot/USDC):

  • Higher yield potential (DeFi optimization)
  • Stable USDC obligations
  • Platform keeps Carrot appreciation

Mode 2 (JitoSOL/SOL):

  • Predictable staking yield (~6% APY)
  • SOL obligations match SOL holdings
  • Platform keeps jitoSOL appreciation

$10M Annual Volume Example

Fees collected: $100,000 (1%)
Platform share: $70,000 (after partners)

Mode 1: $70,000 in CRT @ 8% APY = $5,600 extra/year
Mode 2: 700 SOL in jitoSOL @ 6% APY = 42 SOL extra/year

Platform keeps growing yield even after payouts!

πŸš€ Governance Security Deep Dive

The Single→Multi Owner Evolution

Why start with single owner?

  • Launch Speed: No coordination delays during rapid development
  • Market Validation: Can pivot quickly based on user feedback
  • Cost Efficiency: No multisig overhead for early operations
  • Decision Clarity: Clear accountability in early stages

When to add second owner?

  • Revenue Milestone: When sustainable revenue justifies shared ownership
  • Partnership Needs: When bringing on co-founders or investors
  • Security Requirements: When value at risk justifies multisig protection
  • Growth Phase: When scaling requires shared decision making

What happens automatically?

add_platform_owner(current_owner, new_owner, 3000) // Give 30%
↓
Automatic changes:
- multisig_mode = true (irreversible)
- Current owner: 70%, New owner: 30%
- multisig_threshold = 2 (majority required)
- All future ownership changes require 2/2 signatures

Security implications:

  • Irreversible Protection: Can never return to single owner mode
  • Rug Pull Prevention: No single party can change ownership alone
  • Admin Separation: Day-to-day admin functions still work normally
  • Emergency Proof: Even if one owner disappears, funds remain secure

Multisig Security Model

What requires multisig?

  • βœ… Changing ownership percentages
  • βœ… Adding/removing platform owners
  • ❌ NOT day-to-day operations (user/partner management)

Example multisig scenarios:

// βœ… REQUIRES MULTISIG: Change profit sharing
update_platform_owners(
  [owner_a_signature, owner_b_signature],
  [{ wallet: owner_a, percentage: 6000 }, { wallet: owner_b, percentage: 4000 }]
)

// ❌ NO MULTISIG NEEDED: Admin adds new user
authorize_user(admin, new_user_wallet) // Admin can do this alone

Business continuity:

  • Operations Continue: Admin manages users/partners independently
  • Revenue Flows: Owners claim their shares independently
  • Growth Unblocked: Only ownership changes require coordination
  • Secure Foundation: Core ownership locked behind multisig protection

πŸ› οΈ Technical Integration

Mode-Specific Dependencies

Mode 1 (USDC/CRT):

  • Jupiter CPI: SOL β†’ CRT β†’ USDC swaps
  • Carrot Protocol: CRT token yield optimization
  • Pyth Oracle: Real-time SOL/USD pricing
  • CRT Mint: CRTx1JouZhzSU6XytsE42UQraoGqiHgxabocVfARTy2s

Mode 2 (SOL/LST):

  • Jupiter CPI: SOL ↔ LST swaps
  • LST Protocol: jitoSOL or similar LST
  • No Oracle Needed: Pure SOL accounting
  • LST Mint: Depends on chosen LST

Common Requirements

  • Solana devnet/mainnet
  • Jupiter program access
  • Solana Token Program

Key Resources


πŸ“ˆ Business Benefits & Use Cases

Beyond Jupiter: Universal Applications

JURSM can power revenue sharing for any Solana protocol:

DEX Integrations:

  • Jupiter: Original use case - swap fee sharing
  • Raydium: Pool fee distribution to liquidity providers
  • Orca: Concentrated liquidity rewards sharing
  • Any DEX: Universal signature verification works everywhere

DeFi Protocols:

  • Lending Platforms: Interest revenue sharing
  • Yield Farms: Harvest fee distribution
  • Liquid Staking: Commission sharing between validators/delegators
  • Options/Perps: Trading fee revenue splits

NFT & Gaming:

  • Marketplaces: Trading fee revenue sharing
  • Gaming Platforms: In-game purchase commissions
  • Creator Platforms: Royalty distribution systems
  • Subscription Services: Recurring payment splits

Enterprise Applications:

  • Payment Processors: Transaction fee sharing
  • API Services: Usage-based revenue distribution
  • SaaS Platforms: Affiliate commission management
  • White-label Solutions: Partner revenue sharing

Stakeholder Benefits

For Users:

  • Familiar Payments: Pay fees in SOL (no new tokens to buy)
  • Discount Incentives: Save money through partner referrals
  • Transparent Verification: On-chain proof of all transactions
  • Universal Experience: Same system across all integrated protocols

For Partners:

  • Stable Income: USDC payouts eliminate volatility risk
  • Tiered Growth: Clear path from basic to premium commissions
  • Real-time Tracking: Always know exactly what you're owed
  • Cross-protocol Reach: One partnership, multiple revenue streams

For Platforms:

  • Maximum Revenue: Automated yield generation on all collected fees
  • Flexible Integration: Works with any Solana transaction type
  • Scalable Security: Governance evolves with business growth
  • Zero Operational Overhead: Fully automated distribution system
  • Institutional Ready: Multisig security meets enterprise requirements

Why This Model is Genius

Traditional Fee Model:

Collect fees β†’ Hold in treasury β†’ Pay out β†’ No extra revenue

JURSM Yield Model:

Collect fees β†’ Convert to yield tokens β†’ Pay exact amounts β†’ Keep ALL yield

Compound Benefits:

  1. Immediate Yield: Every fee starts earning from day 1
  2. No Idle Capital: 100% of funds working 24/7
  3. Scalable Profit: More volume = more yield base
  4. Time Advantage: Unclaimed funds keep earning
  5. Zero Overhead: Fully automated yield generation

Real Numbers (1M SOL lifetime fees):

  • Traditional: 1M SOL revenue
  • Mode 1 (8% CRT): 1M SOL + 80,000 SOL/year in yield
  • Mode 2 (6% LST): 1M SOL + 60,000 SOL/year in yield

Platform owners get rich from yield, not just fees!


🎯 Success Metrics

  • βœ… Maximum Revenue: Platform keeps 100% of yield differential
  • βœ… Zero rent overhead: Shared registry accounts
  • βœ… Immediate yield: All fees working from day 1
  • βœ… Perfect verification: Cryptographic transaction proofs
  • βœ… Flexible payouts: USDC or SOL based on mode
  • βœ… Smart governance: Evolves with business growth
  • βœ… Compound profits: Yield on yield on yield

πŸ”— Related Documentation


Built with ⚑ Solana β€’ πŸ—οΈ Anchor β€’ πŸ”„ Jupiter β€’ πŸ“Š Pyth

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors