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

# The Flywheel and Treasury Engine

> Hook tax extraction, the rebalancing matrix, and Lighter Protocol yield amplification

## The Perpetual Loop

Every swap feeds the treasury. The treasury feeds the pack. The pack feeds demand.

```mermaid theme={null}
flowchart LR
    A["DEX Swaps<br/>(Uniswap v4)"] -->|5% Hook Tax| B["USDG<br/>Treasury"]
    B -->|Buy-the-Underweight| C["Tokenized Equities<br/>NVDA, AAPL, SPY, QQQ"]
    C -->|Deployed as Liquidity| D["Lighter Protocol<br/>Order Books"]
    D -->|Fees + Funding + Rewards| E["Staker Yields<br/>($esWOLF)"]
    E -->|Demand Loop| A
```

## The 5 Percent Hook Tax Extraction

Every buy and sell transaction on Uniswap v4 triggers the `WolfHook.sol` contract post-execution.

```text theme={null}
Tax Extracted = Swap Volume x 0.05
```

1. The 5% fee is swapped instantly into native stablecoin collateral (USDG) within the pool.
2. USDG is pushed to `StockTreasury.sol`.
3. The treasury updates its rebalancing matrix to evaluate portfolio deficits.

## Rebalancing Matrix and Chainlink Execution

The treasury maintains target asset matrices across two dedicated territories:

| Territory              | Profile          | Target Matrix                         |
| ---------------------- | ---------------- | ------------------------------------- |
| The Apex Territory     | High-Beta Growth | 40% NVDA, 30% AAPL, 20% TSLA, 10% AMD |
| The Vanguard Territory | Index Anchor     | 50% SPY, 50% QQQ                      |

### The Buy-the-Underweight Algorithm

Instead of liquidating winning assets, the protocol only directs new capital toward whatever is trailing its target weight:

```mermaid theme={null}
flowchart TD
    A["Trigger: every 24h<br/>or USDG pool over 5,000"] --> B["executeHunt()"]
    B --> C["Query Chainlink Price Feeds"]
    C --> D["Measure live USD value<br/>of treasury holdings"]
    D --> E{"Which assets are below<br/>their target weight?"}
    E --> F["Route 100% of incoming USDG<br/>to underweight assets"]
    F --> G["Blue-chips accumulated<br/>at relative discounts"]
```

The protocol never sells winners to rebalance. It only buys the laggards.

## Yield Amplification via Lighter Protocol

Purchased stock tokens are not left idle in the contract. `StockTreasury.sol` routes equity inventory directly into Lighter Protocol order book engines, where it:

* Captures automated trading fees and maker rebates
* Captures perpetual funding rates
* Generates a continuous share of ecosystem incentive rewards
