# Introduction

### Keystone Finance is the carry coordination layer for Solana.

**How it works:**

* Deposit USDC → mint `ksUSD` at the current share price
* Share price drifts up as carry accrues into the vault
* Carry comes from three sources — Drift SOL-PERP funding, jitoSOL staking yield, USDC lending
* Withdraw any time — instant up to the liquidity buffer, queued beyond

**Architecture:**

* One Anchor program
* One PDA-owned vault
* One share mint (`ksUSD`)
* Three internal modes — **normal basis · reverse basis · idle** — picked automatically by the funding-rate signal

***

## How it earns

Three yield sources that Solana's DeFi ecosystem continuously produces:

| Yield source               | Active when                       | Mechanism                                                         |
| -------------------------- | --------------------------------- | ----------------------------------------------------------------- |
| **Drift SOL-PERP funding** | Normal & reverse basis            | Vault sits on the receive side either way. Delta-neutral in both. |
| **jitoSOL staking yield**  | Normal basis (jitoSOL collateral) | \~5.8% APR embedded in the jitoSOL/SOL rate                       |
| **USDC lending carry**     | Always — buffer, reserve, idle    | Kamino USDC reserve (`lend_idle_usdc` / `lend_reserve`)           |

When funding sits in the dead zone → position closes, the entire NAV runs as USDC lending until the next active regime.

***

## How to use it

```
deposit                  USDC → mint ksUSD at current share price
withdraw_instant         burn ksUSD → USDC from the vault's liquidity buffer
request_withdrawal       burn ksUSD now (locks redemption price), queued for payout
process_withdrawal       permissionless crank — fulfill queued requests in FIFO order
claim_wind_down          (wind-down only) burn ksUSD → pro-rata USDC
```

* Share price (`ksUSD` → USDC) drifts up over time
* Performance fees apply **only above the high-water mark**, at the vault level
* [Fee structure →](/reference/fees.md)

***

## Why Solana

Three primitives must co-locate on one chain:

* **High-yield borrowable LST** — jitoSOL on Kamino (45% LTV at scale)
* **On-chain perp DEX with real bidirectional funding** — Drift Perps (not the borrow-fee LP model used on most EVM perp venues)
* **Sub-cent composability** — Solana's fee model lets the vault switch modes hourly without bleeding gas

Doesn't exist on Ethereum (stETH borrow is capped on Aave) or on EVM L2s (GMX V2 uses borrow-fee, not real funding). **ksUSD is mechanically Solana-only.**

***

## Doc map

**Users:** [Deposit](/keystone-finance/deposit.md) · [Withdraw](/keystone-finance/withdraw.md) · [Check position](/keystone-finance/check-position.md)

**Builders:** [Quick start](/for-developers/quick-start.md) · [Instructions](/for-developers/instructions.md) · [Accounts](/for-developers/accounts.md) · [Events](/for-developers/events.md) · [Errors](/for-developers/errors.md)

**Operators:** [Keeper bot](/for-operators/keeper-bot.md) · [Monitoring](/for-operators/monitoring.md) · [Admin ops](/for-operators/admin-ops.md)

**Reference:** [Whitepaper](/reference/whitepaper.md) · [Historical simulation](/reference/historical-simulation.md) · [Fees](/reference/fees.md) · [NAV & pricing](/reference/nav-calculation.md) · [Security](/reference/security.md) · [Protocols](/reference/protocols.md)

***

## Program

| Network | Program                          | Address                                        |
| ------- | -------------------------------- | ---------------------------------------------- |
| Devnet  | `keystone_finance` (ksUSD vault) | `HvsAc157bJ7Pd4uGr7xssHMifGs6RMbPu14ZMsiEABWT` |
| Mainnet | *new program ID at deploy time*  | Pending audit                                  |


---

# 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/readme.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.
