# Yield Strategy

> The strategy receives borrowed stablecoins and deploys them to earn yield. Profit is the spread between yield earned and borrow cost.

## Active Strategy (LlamaLend + StakeDAO)

Active vaults (`wbtc-llamalend`, `wsteth-llamalend`):

1. Borrow **crvUSD** from LlamaLend loan manager.
2. Provide liquidity in Curve **crvUSD/USDT** pool.
3. Stake LP in StakeDAO OnlyBoost gauge.
4. Harvest CRV → swap to crvUSD → compound.

### Strategy Economics

```
implied yield ≈ LTV × (StakeDAO yield APR − LlamaLend borrow APY)
```

- **Yield APR** — `GET /api/stakedao-apr?gauge={stakedaoGauge}`
- **Borrow APY** — `GET /api/llamalend?controller={llamaLendController}`
- **LTV** — `getCurrentLTV()` on loan manager (÷ 1e16 for %)

While TVL is small, measured historical APR can be noisy. Stats page shows implied carry from live on-chain inputs for testing vaults.

## Legacy Strategy (Aave + RAAC pmUSD)

Legacy vaults (`wbtc-pmusd`, `wsteth-pmusd`, `xaut-pmusd`) use `PmUsdCrvUsdStrategy` (withdraw-only):

1. Borrow USDT from Aave V3.
2. Swap USDT → crvUSD (Curve).
3. Add liquidity to RAAC pmUSD/crvUSD pool.
4. Stake LP in StakeDAO.
5. Harvest CRV → crvUSD → compound.

## Strategy Interface (Vault-Controlled)

- `deposit(uint256)`, `withdraw(uint256)`, `withdrawAll()`
- `harvest()`, `balanceOf()`, `pendingRewards()`
- `emergencyWithdraw()`

Only the vault can call strategy admin methods.

## Operational Notes

- **Harvest** is permissionless at vault level via `harvestYield()`.
- **Strategy value** is reported in debt-asset terms, converted to collateral-equivalent for vault accounting.
- **Operator monitor** at `/monitor` — liquidity, health flags, idle/emergency controls.