How It Works: A Practical Example

Let's walk through a story to understand how internet.fund works.

User Story: Alex Wants to Earn Yield

Alex is a crypto enthusiast with some SOL and USDC. He sees a trusted influencer on Twitter share a link to a hot "SOL-USDC Turbo Pool" on internet.fund that's generating great returns.

In the world of traditional DeFi: Alex clicks the link and lands on a page full of charts and jargon. He has to calculate the token ratio, worry about impermanent loss, and research how to stake the LP token he'll receive. After a few minutes of confusion and frustration, he gives up.

In the world of internet.fund:

  1. Alex clicks the influencer's link and sees a clean, simple page.

  2. There's one big button that says "One-Click Join Pool" and an input field.

  3. Alex types in the total value he wants to invest, like "$1,000".

  4. The protocol automatically shows: "This will use approx. X of your SOL and Y of your USDC."

  5. Alex clicks "Confirm," and his wallet prompts for a single signature.

  6. Signature approved. The page updates: "Success! You are now in the pool and earning yield."

The Code Behind the Click (Pseudo-code)

When Alex clicked confirm, our backend constructed an atomic transaction containing multiple instructions:

Rust

// A single transaction built by the internet.fund router
let transaction = Transaction::new_with_payer(
    &[
        // Instruction 1: If needed, create the user's USDC associated account
        create_associated_token_account_if_needed(&payer, &usdc_mint),

        // Instruction 2: Wrap a portion of the user's SOL into wSOL
        wrap_sol(&payer, amount_sol),

        // Instruction 3: Call our core contract to execute a "smart deposit"
        internet_fund::instruction::smart_deposit(
            &payer,
            &pool_state,
            amount_sol_in,
            amount_usdc_in,
        ),
        
        // Instruction 4 (Optional): Auto-stake the resulting LP token into a yield aggregator
        internet_fund::instruction::auto_stake_lp(&payer, &pool_state),
    ],
    Some(&payer.pubkey()),
);

The user signs once, but our protocol executes 3-4 steps for them on-chain. This is how we achieve radical simplicity.

Last updated