> For the complete documentation index, see [llms.txt](https://hyperpnl.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hyperpnl.gitbook.io/docs/architecture/smart-contracts/payout-treasury.md).

# Payout Treasury

The Payout Treasury is the on-chain contract responsible for managing the capital allocated for trader payouts and protocol operations.

Funds allocated to the treasury come from challenge purchases routed through the Payment Router. These funds are governed entirely by smart contract logic.

#### <mark style="color:$warning;">**Treasury Usage**</mark>

Capital held in the Payout Treasury serves three purposes.

1. **Trader Payouts**\
   The primary purpose of the treasury is to execute payouts for funded traders.\
   Payouts are released only after outcomes are finalized and verified on-chain.
2. **Shadow Engine Funding**\
   A portion of the treasury is used to fund the Shadow Engine, which mirrors trader activity as part of the protocol’s risk and execution model.\
   This ensures that funded trading is backed by real capital under the same market conditions.
3. **Protocol Yield Generation**\
   Any excess capital above **PSF = 4** may be deployed into external lending protocols. This allows the system to earn yield while keeping funds available for future payouts if needed.\
   \
   $$\text{Lending Allocation} = \max\left( \text{Payout Reserve Volume} - 4 \times \text{Predicted Payout}, ; 0 \right)$$

#### <mark style="color:$warning;">**Payout Authorization**</mark>

Payouts can only be executed after a challenge outcome is finalized and authorized on-chain.\
If an outcome is not authorized, funds cannot be released.
