> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebelfi.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# RebelFi SDK

> TypeScript SDK for yield integrations

## Yield Infrastructure for Everyone

The RebelFi SDK enables platforms to generate yield on stablecoin balances. You keep full custody of funds while earning competitive returns from DeFi protocols.

<Tabs>
  <Tab title="Ethereum / EVM">
    ```typescript theme={null}
    import { RebelfiClient } from '@rebelfi/sdk';
    import { ethers } from 'ethers';

    const client = new RebelfiClient({ apiKey: process.env.REBELFI_API_KEY });

    // Discover yield opportunities
    const { venues } = await client.venues.list({ blockchain: 'ethereum', token: 'USDC' });
    const strategy = venues[0].strategies[0];

    // Plan a supply operation
    const operation = await client.operations.supply({
      walletAddress: userWallet,
      strategyId: strategy.strategyId,
      amount: '1000000', // 1 USDC (6 decimals)
      tokenAddress: strategy.tokenAddress
    });

    // Sign and submit each transaction (EVM may have approve + supply steps)
    for (const tx of operation.transactions) {
      const unsignedTx = JSON.parse(Buffer.from(tx.unsignedTransaction, 'hex').toString());
      const signedTx = await wallet.signTransaction(unsignedTx);
      const txResponse = await wallet.sendTransaction(signedTx);
      const receipt = await txResponse.wait();

      await client.transactions.submitHash({
        operationId: operation.operationId,
        txHash: receipt.hash
      });
    }
    ```
  </Tab>

  <Tab title="Solana">
    ```typescript theme={null}
    import { RebelfiClient } from '@rebelfi/sdk';
    import { Connection, VersionedTransaction } from '@solana/web3.js';

    const client = new RebelfiClient({ apiKey: process.env.REBELFI_API_KEY });

    // Discover yield opportunities
    const { venues } = await client.venues.list({ blockchain: 'solana', token: 'USDC' });
    const strategy = venues[0].strategies[0];

    // Plan a supply operation
    const operation = await client.operations.supply({
      walletAddress: userWallet,
      strategyId: strategy.strategyId,
      amount: '1000000', // 1 USDC (6 decimals)
      tokenAddress: strategy.tokenAddress
    });

    // Sign the transaction
    const unsignedTxBase64 = operation.transactions[0].unsignedTransaction;
    const unsignedTxBuffer = Buffer.from(unsignedTxBase64, 'base64');
    const transaction = VersionedTransaction.deserialize(unsignedTxBuffer);
    transaction.sign([userKeypair]);

    // Broadcast and confirm
    const connection = new Connection('https://api.mainnet-beta.solana.com');
    const txHash = await connection.sendTransaction(transaction);
    await connection.confirmTransaction(txHash, 'confirmed');

    // Submit the hash to RebelFi
    await client.transactions.submitHash({
      operationId: operation.operationId,
      txHash
    });
    ```
  </Tab>
</Tabs>

### How It Works

<Steps>
  <Step title="Discover Venues">
    Query available yield venues and strategies with current APYs
  </Step>

  <Step title="Plan Operations">
    Request supply or unwind operations to get unsigned transactions
  </Step>

  <Step title="Sign">
    Transactions are signed via your custody solution or wallet
  </Step>

  <Step title="Submit & Track">
    Submit the signed transaction and track confirmation status
  </Step>
</Steps>

### Key Benefits

<CardGroup cols={2}>
  <Card title="Non-Custodial" icon="shield">
    You retain full custody. We generate transactions; you sign and broadcast.
  </Card>

  <Card title="Simple Integration" icon="code">
    TypeScript SDK with full type safety. One API key, four endpoints.
  </Card>

  <Card title="Real Yields" icon="chart-line">
    Access institutional DeFi strategies with competitive APYs.
  </Card>

  <Card title="Instant Liquidity" icon="bolt">
    Unwind positions anytime. No lock-up periods.
  </Card>
</CardGroup>

## Get Started

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/sdk/quickstart">
    Install the SDK and make your first supply operation
  </Card>

  <Card title="Integration Tutorial" icon="book" href="/sdk/integration-tutorial">
    Full walkthrough: supply, track, and unwind
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Complete endpoint documentation
  </Card>

  <Card title="GitHub" icon="github" href="https://github.com/rebelfi/sdk">
    View source, report issues, contribute
  </Card>
</CardGroup>

<Note>
  Supporting **Solana**, **Ethereum**, **Polygon**, and **Base**. USDC, USDT, and other stablecoins supported.
</Note>

## Looking for Platform Documentation?

For deeper dives into platform capabilities, architecture, and advanced use cases, see the **Guides** section:

<CardGroup cols={2}>
  <Card title="Platform Overview" icon="diagram-project" href="/guides/welcome">
    Full platform documentation for all use cases
  </Card>

  <Card title="Why RebelFi" icon="lightbulb" href="/guides/why-rebelfi">
    The business case for yield infrastructure
  </Card>
</CardGroup>
