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

# Program overview

Vault runs on two Anchor programs deployed to Solana.

| Program        | Responsibility                                                                    |
| -------------- | --------------------------------------------------------------------------------- |
| `vault-core`   | Global configuration, shared types, and the campaign state machine definition.    |
| `vault-escrow` | Campaign creation, contributions, tips, settlement, refunds, and treasury sweeps. |

Splitting configuration from execution keeps the escrow program's surface narrow. Global parameters live in one account that the escrow program reads but does not own.

## Design constraints

**Financial math uses `u128` intermediates.** Fee and refund calculations are performed in wider precision before narrowing, so lamport arithmetic cannot silently overflow.

**No oracle at execution time.** Values that would otherwise need a live price feed — the refund fee cap and the tip threshold — are converted to lamports once, at campaign creation, and stored on the campaign account. Settlement and refunds never consult an external price source.

**A narrow state machine.** There is no milestone system, no voting, no partial execution, and no discretionary withdrawal path. A campaign moves through a fixed set of states and terminates.

**Permissionless progression.** The instructions that advance a campaign and process refunds do not require Vault's signature. Anyone can submit them.

## What the programs do not do

The programs hold and move SOL according to campaign rules. They do not perform off-chain fulfillment, custody assets other than SOL, or bridge value to another chain.

Fulfillment happens off-chain after settlement. That boundary is described in [Trust boundary](/smart-contracts/trust-boundary.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.vault.ky/smart-contracts/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
