> ## 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.

# How RebelFi Works

> Understanding the flow of funds and architecture

## How RebelFi Works

RebelFi operates as a **non-custodial orchestration layer** that manages your stablecoin yield operations while you maintain complete control over custody and execution.

<Info>
  **Key Principle**: RebelFi never holds your private keys or controls your funds. We build unsigned transactions; your key management system signs them.
</Info>

### The Core Flow

<Steps>
  <Step title="You request a supply operation">
    Call the API or SDK with the wallet, strategy, and amount.
  </Step>

  <Step title="RebelFi returns unsigned transaction(s)">
    You receive raw transactions ready for signing. EVM operations may include an approve + supply pair.
  </Step>

  <Step title="You sign and submit">
    Sign with your custody solution (Fireblocks, BitGo, Crossmint, or any signer) and submit back to RebelFi.
  </Step>

  <Step title="RebelFi manages everything after that">
    Allocation tracking, yield accounting, position reporting, risk monitoring, and protocol health checks.
  </Step>
</Steps>

RebelFi never holds your keys or funds. You maintain full custody throughout.

### What RebelFi Manages Post-Deployment

* **Allocation tracking** — Real-time position data across all wallets and strategies
* **Yield accounting** — Double-entry ledger tracking principal, yield accrual, and returns
* **Reporting** — Daily earnings history, per-venue breakdowns, exportable data for your finance team
* **Risk monitoring** — Protocol health monitoring, exposure tracking
* **Compliance** — KYT (Know Your Transaction) available for institutional deployments ([contact us](mailto:team@rebelfi.io))

## Supported Blockchains

| Blockchain | Token Support | Status      |
| ---------- | ------------- | ----------- |
| Solana     | USDC, USDT    | Live        |
| Polygon    | USDC, USDT    | Live        |
| Ethereum   | USDC, USDT    | Live        |
| Base       | USDC          | Live        |
| Arbitrum   | USDC, USDT    | Coming Soon |

## Operations

RebelFi supports two operation types:

* **Supply Operations**: Deploy idle funds to yield-generating protocols
* **Unwind Operations**: Withdraw funds from yield back to your wallets

### SDK Execution

Operations are driven by the SDK. After planning, transactions come back unsigned — you sign them externally and submit:

```typescript theme={null}
// Plan a supply operation (returns unsigned transactions)
const operation = await client.operations.supply({
  walletAddress: '0xYourWalletAddress',
  strategyId: strategy.strategyId,
  amount: '1000000000',  // 1000 USDC (6 decimals)
  tokenAddress: strategy.tokenAddress
});

// Sign with your key management system (Fireblocks, BitGo, hardware wallet, etc.)
const signedTx = await yourKeyManager.sign(operation.transactions[0].unsignedTransaction);

// Option A: You broadcast and submit the hash
const txHash = await yourKeyManager.broadcast(signedTx);
await client.transactions.submitHash({ operationId: operation.operationId, txHash });

// Option B: Let RebelFi broadcast for you
await client.transactions.submitSigned({
  operationId: operation.operationId,
  signedTransaction: signedTxBase64
});
```

<Note>
  **You maintain complete signing authority.** RebelFi builds unsigned transactions but cannot sign or execute them.
  Your key management system — whether that's Fireblocks, BitGo, a hardware wallet, or your own key infrastructure
  — remains fully in control.
</Note>

<Accordion title="Architecture Deep Dive" icon="diagram-project">
  ### Non-Custodial Design

  Your custody provider holds keys → RebelFi generates operation plans → your custody signs & broadcasts → blockchain settles → RebelFi tracks confirmation and updates state.

  ### Operation Lifecycle

  ```
  PENDING → AWAITING_SIGNATURE → SUBMITTED → CONFIRMED → FAILED
                                                  ↓
                                             CANCELLED
  ```

  * **PENDING**: Operation created, building transactions
  * **AWAITING\_SIGNATURE**: Unsigned transactions ready for signing
  * **SUBMITTED**: Transaction submitted and awaiting on-chain confirmation
  * **CONFIRMED**: Confirmed on-chain, financial state updated
  * **CANCELLED**: Cancelled before submission
  * **FAILED**: Transaction failed on-chain

  ### Financial State Management

  Double-entry ledger with: **Reservations** (temporary locks), **Expected Receipts** (matched on arrival), **Journal Entries** (immutable), **Positions** (read-optimized balances), **Allocations** (deployed funds earning yield).
</Accordion>

<Accordion title="Example: Supply Operation Financial Flow" icon="money-bill-transfer">
  | Stage             | Available   | Reserved   | Deployed   |
  | ----------------- | ----------- | ---------- | ---------- |
  | Initial           | 10,000 USDC | —          | —          |
  | Operation created | 5,000 USDC  | 5,000 USDC | —          |
  | Confirmed         | 5,000 USDC  | —          | 5,000 USDC |
</Accordion>

## Security Model

### Zero Trust Architecture

RebelFi is designed with zero trust principles:

* **No Key Access** - We cannot access your private keys under any circumstances
* **No Fund Control** - We cannot move funds without your custody solution signing
* **No Direct Execution** - All transactions require your explicit signing authority
* **Complete Audit Trail** - Every operation, reservation, and state change is logged

### Transaction Safety

Operations include safety mechanisms:

* **Atomic Reservations**: Funds are locked during operations to prevent double-spending
* **Idempotency**: Operations can be safely retried without duplicate effects
* **State Validation**: Each state transition is validated against allowed progressions
* **Timeout Handling**: Operations that don't complete within timeframes are automatically released

### Protocol Vetting

RebelFi only integrates with audited, battle-tested protocols. Yield protocols are evaluated for:

* Smart contract audits and audit history
* Historical performance and uptime
* Total value locked (TVL)
* Institutional usage
* Risk-adjusted returns

<Info>
  RebelFi focuses on battle-tested protocols with institutional adoption and comprehensive audit histories.
</Info>

## Next Steps

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/guides/quickstart">
    Get started with RebelFi
  </Card>

  <Card title="Wallet Profiles" icon="layer-group" href="/guides/wallet-profiles">
    Configure wallet profiles and API keys
  </Card>
</CardGroup>
