# ZenSats Documentation

> ZenSats is an ERC-4626 vault system that automates collateralized carry trades on Ethereum mainnet. Deposit collateral, borrow stablecoins, deploy to yield strategies, earn the spread.

## Two Forms of Collateral Accounting

The vault tracks value in collateral units using two buckets:

- **Direct collateral** — collateral token held in the vault and loan manager path.
- **Debt-side value** — strategy and idle debt assets converted back to collateral-equivalent value via loan manager pricing.

## How It Works

1. **Deposit collateral** — receive ERC-4626 shares.
2. **Borrow debt asset** — vault posts collateral and borrows at target LTV.
3. **Deploy strategy** — active vaults: borrow crvUSD on LlamaLend → LP in Curve crvUSD/USDT → stake in StakeDAO.
4. **Permissionless upkeep** — anyone can call `rebalance()`, `harvestYield()`, `accrueYieldFees()`.
5. **Redeem shares** — withdraw/redeem returns collateral, unwinding positions when needed.

## Admin Model (Restricted Powers)

- **Owner** — bounded params, idle mode, protocol fees, emergency unwind. Cannot swap loan manager or strategy.
- **Gov** — swapper changes only, via 1-week timelock. Vault validates swapper output against oracle pricing.
- **Emergency mode** — one-way latch; cannot be reversed.

## Current Live Vaults

| Slug | Collateral | Loan manager | Status |
|------|------------|--------------|--------|
| `wbtc-llamalend` | WBTC | LlamaLend (crvUSD) | Active (testing) |
| `wsteth-llamalend` | wstETH | LlamaLend (crvUSD) | Active (testing) |

Implied carry ≈ `LTV × (StakeDAO yield APR − LlamaLend borrow APY)`.

## Legacy Vaults (withdraw-only)

| Slug | Collateral | Loan manager | Status |
|------|------------|--------------|--------|
| `wbtc-pmusd` | WBTC | Aave V3 (USDT) | Legacy |
| `wsteth-pmusd` | wstETH | Aave V3 (USDT) | Legacy |
| `xaut-pmusd` | XAUT | Aave V3 (USDT) | Legacy |

Legacy vaults return `maxDeposit() = 0`. Existing shareholders can withdraw.

## Related docs

- [Zenji Vault](/docs/vault.md) — ERC-4626 accounting and controls
- [Loan Manager](/docs/loan-manager.md) — Aave V3 and LlamaLend borrowing
- [Yield Strategy](/docs/strategy.md) — LlamaLend + StakeDAO and legacy pmUSD flows
- [Governance](/docs/governance.md) — roles, timelock, emergency authority
- [Risks](/docs/risks.md) — risk disclosure
- [Contracts](/docs/contracts.md) — addresses and integrations
- [llms-full.txt](/llms-full.txt) — complete docs in one file