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

# Architecture

> The components that make up a Thaler vault and how they coordinate. Custody, rules, execution, and signing are each isolated and verifiable on chain.

## Components

A Thaler vault is composed of four parts. Each part has one responsibility, and the boundaries between them are enforced on chain.

| Component            | Responsibility                                           | Held by                                 | Mutable after creation                |
| -------------------- | -------------------------------------------------------- | --------------------------------------- | ------------------------------------- |
| Squads smart account | Holds the deposit and any accrued yield                  | User and protocol (multisig co-signers) | Account address is permanent          |
| Policy extension     | Defines what the smart account will sign                 | User signs once at creation             | No                                    |
| Dedicated worker     | Reads market conditions and proposes instructions        | Protocol operations                     | Worker can be replaced, policy cannot |
| Agent wallet         | Co-signs permitted instructions alongside the user's key | Protocol                                | Authority is scoped by the policy     |

The smart account is the address of record. Funds enter and leave through it, and every instruction it executes is checked against the policy before any signature is honoured.

## Coordination loop

```mermaid theme={null}
sequenceDiagram
    autonumber
    participant Market
    participant Worker
    participant Agent as Agent wallet
    participant Account as Squads account
    participant Solana
    Market->>Worker: Rate, yield, or funding update
    Worker->>Worker: Compose policy-compliant instruction
    Worker->>Agent: Request co-signature
    Agent->>Account: Submit signed instruction
    Account->>Account: Verify against policy extension
    Account->>Solana: Broadcast if valid; reject if not
    Solana-->>Account: Execution receipt
    Account-->>Worker: State update
```

Every action follows the same five steps. If any step fails the policy check, the network rejects the transaction. There is no off-chain override.

## Why separate four concerns

The structure keeps each layer independently reviewable.

| Concern   | Owned by         | Why it is isolated                                            |
| --------- | ---------------- | ------------------------------------------------------------- |
| Custody   | Smart account    | Funds cannot leave without policy-compliant instructions      |
| Rules     | Policy extension | Reviewers can verify the rule set in one place, once          |
| Execution | Worker           | Worker can be replaced or upgraded without touching the rules |
| Signing   | Agent wallet     | Signing authority is scoped, time-bounded, and audited        |

A reviewer can inspect any one layer without needing the others. The smart account refuses to sign anything outside the policy regardless of who proposes it.

## What the user signs at creation

The creation transaction bundles four actions into a single signature.

| Action                                 | Effect                                                     |
| -------------------------------------- | ---------------------------------------------------------- |
| Create the Squads smart account        | A new on-chain account with the user as a co-signer        |
| Co-sign the policy extension           | The rule set is bound to the account and becomes immutable |
| Take the vault creation fee            | A small SOL amount goes to the protocol treasury           |
| Route the deposit into the staking leg | 2 SOL is staked through the chosen provider                |

After creation, the user signs only for `claim` and `close`. Every other action happens inside the policy bounds.

## Continuity

Squads smart accounts can be recovered by the user even if the protocol disappears. The deposit and any accrued yield are held by the smart account, not by the protocol. As long as the user holds their share of the multisig, they can interact with the account directly.

The worker is a convenience layer. It can be replaced or removed without losing access to the assets the smart account holds. If the worker stops responding, the user can still sign a manual close.

## Next read

<Columns cols={2}>
  <Card title="Custody and policy" icon="key" href="/overview/custody-and-policy">
    What the policy controls and how to verify it on chain.
  </Card>

  <Card title="Strategies" icon="line-chart" href="/strategies/index">
    The three pillars the policy authorises and how they earn together.
  </Card>
</Columns>
