# Glossary

Quick definitions for terms used across the ksUSD docs.

***

## Product

| Term                  | Definition                                                                                                                                                    |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **ksUSD**             | The bidirectional-carry dollar share token. Share price drifts up as carry accrues.                                                                           |
| **Vault**             | The single Anchor program + PDA that holds NAV, mints ksUSD, and runs strategy.                                                                               |
| **Coordinates carry** | Public-facing framing: ksUSD captures Drift funding, jitoSOL staking, and lending carry under one share token — three regimes addressed by one vault.         |
| **Effective NAV**     | `cached_nav_usdc − queue_pending_usdc − reserve_fund_usdc`. The share-price denominator basis.                                                                |
| **Share price**       | `effective_nav_usdc × 1e6 / total_shares` (scaled 1e9). What 1 ksUSD redeems for in USDC.                                                                     |
| **HWM**               | High-water-mark share price. Performance fees apply only above this mark; it ratchets monotonically.                                                          |
| **Reserve fund**      | USDC pool funded by the 5% perf-fee skim. Productively lent on Kamino; absorbs first-loss events. Tracked as `reserve_fund_usdc` (includes the lent portion). |

## Modes (`PositionMode`)

| Term              | Definition                                                                                                                                             |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Idle**          | No active perp position; capital in vault USDC (possibly lent on Kamino via `lend_idle_usdc`).                                                         |
| **Normal basis**  | Long jitoSOL on Drift as cross-margin + short SOL-PERP at 1× notional. Active when funding sustainedly positive.                                       |
| **Reverse basis** | USDC on Kamino → borrow jitoSOL → sell to USDC → long SOL-PERP on Drift. Active when funding sustainedly deeply negative.                              |
| **WindDown**      | Terminal mode (`init_wind_down`). New deposits / positions blocked; users redeem pro-rata via `claim_wind_down`.                                       |
| **Dwell**         | Minimum time the vault must stay in a mode before switching again (default 12 h).                                                                      |
| **Funding EMA**   | On-chain smoothed funding rate (`funding_apr_smoothed_bps`); updated on every `settle`. Compared against `funding_threshold_*_bps` for mode decisions. |

## Withdrawal

| Term                   | Definition                                                                                                                                       |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Liquidity buffer**   | Idle USDC the vault holds for instant withdrawals (default 10% of NAV).                                                                          |
| **Instant withdrawal** | `withdraw_instant` — one-transaction redemption out of the buffer.                                                                               |
| **Queued withdrawal**  | `request_withdrawal` (burns shares, locks price) followed by `process_withdrawal` (permissionless crank, pays out USDC, closes the request PDA). |
| **Queue cursor**       | `queue_next_id` / `queue_processed_through` on the vault — track outstanding requests.                                                           |

## On-chain accounts

| Term                       | Definition                                                                                                                                  |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **Vault PDA**              | Seeds `[b"vault"]`. Signs all token operations. Authority of the ksUSD mint and every vault-owned ATA.                                      |
| **WithdrawalRequest**      | Per-request PDA at `[b"withdrawal_request", vault, request_id]`. Closed on `process_withdrawal`. Strict FIFO via `queue_processed_through`. |
| **Reserve ATA**            | Vault-PDA-owned USDC ATA dedicated to the reserve fund (`vault.reserve_ata`). Pinned at `initialize`.                                       |
| **Drift User / UserStats** | Drift sub-account PDAs owned by the vault. Created by `enable_drift`.                                                                       |
| **Kamino obligation**      | Vault's Kamino obligation account. Created by `enable_reverse`.                                                                             |
| **Kamino lending cTokens** | `vault_lend_collateral_ata` (idle-USDC leg) and `reserve_lend_collateral_ata` (reserve leg). Both pinned by `enable_lending`.               |

## External protocols

| Term                    | Definition                                                                                                                          |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **Drift Perps v2**      | On-chain perp DEX with real bidirectional funding. SOL-PERP market index = 0.                                                       |
| **Kamino KLend**        | Lending protocol: source of the jitoSOL borrow leg in reverse basis, AND the USDC lending venue (`lend_idle_usdc`, `lend_reserve`). |
| **Marginfi**            | Reserved as a v1.1 second USDC lending venue. Vault fields pinned; not yet CPI-wired.                                               |
| **Jupiter V6**          | Token swap aggregator. All USDC ↔ jitoSOL routing goes through it.                                                                  |
| **Pyth (pull oracles)** | Oracle source for SOL/USD + jitoSOL/USD. Staleness (5 min) + confidence (2%) checks gate every read. Pinned via `set_oracles`.      |
| **Jito (jitoSOL)**      | Liquid-staking token. Yield = base inflation + MEV tips embedded in the jitoSOL/SOL rate.                                           |

## Off-chain

| Term        | Definition                                                                                                                                    |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Keeper**  | Off-chain process that cranks the permissionless strategy instructions on a schedule.                                                         |
| **Cranker** | Generic term for any signer paying for a permissionless instruction. Anyone can crank `settle`, `process_withdrawal`, `emergency_close`, etc. |
| **Admin**   | Holder of the admin keypair. Privileged for `set_pause`, `update_params`, `transfer_admin`, `collect_fees`. End-state is a multisig.          |

## Backtest

| Term                              | Definition                                                                                                                                                                                                   |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Target APY**                    | **\~11% net** after fees, jitoSOL's \~80% Drift collateral weight, and rebalance slippage not in the model. Methodology and full breakdown: [historical-simulation.md](/reference/historical-simulation.md). |
| **Daily backtest**                | Daily resolution on real Drift SOL-PERP funding (Nov 2022 – Jan 2025) + Binance × empirical-ratio fallback elsewhere. 4.25-year hybrid window Feb 2022 – Apr 2026.                                           |
| **Empirical Drift/Binance ratio** | Calibrated from 22 overlap months: positive funding 2.37×, negative funding 0.10×. Drift's book is structurally more positive than Binance.                                                                  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keystonefi.xyz/glossary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
