> For the complete documentation index, see [llms.txt](https://velora-1.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://velora-1.gitbook.io/docs/instruction-reference/instructions.md). Agents can also search and read this documentation through its [MCP server](https://velora-1.gitbook.io/docs/~gitbook/mcp).

# Overview

The `backend` program exposes four instructions. Every instruction validates its inputs on-chain and returns a typed [error code](https://velora-1.gitbook.io/docs/reference/errors.md) on failure.

| Instruction                                                                                        | Signer            | What it does                                                                        |
| -------------------------------------------------------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------- |
| [`create_stream`](https://velora-1.gitbook.io/docs/instruction-reference/create-stream.md)         | creator           | Creates a `StreamConfig`, funds the vault with `total_amount`                       |
| [`withdraw`](https://velora-1.gitbook.io/docs/instruction-reference/withdraw.md)                   | recipient         | Transfers all currently-unlocked, unclaimed tokens to the recipient                 |
| [`release_milestone`](https://velora-1.gitbook.io/docs/instruction-reference/release-milestone.md) | release authority | Flips a `Milestone` stream to fully unlocked                                        |
| [`cancel`](https://velora-1.gitbook.io/docs/instruction-reference/cancel.md)                       | cancel authority  | Settles vested tokens to the recipient, refunds the locked remainder to the creator |

## Conventions

* **Timestamps** are Unix seconds (`i64`), compared against the on-chain `Clock`. Pass them as `anchor.BN` from a TypeScript client.
* **Amounts** are raw token base units (`u64`) — i.e. already scaled by the mint's decimals.
* **Enums** are passed from TS as single-key objects, e.g. `{ linear: {} }`, `{ cliffLinear: {} }`, `{ creatorOnly: {} }`. See [Schedule Types](https://velora-1.gitbook.io/docs/reference/schedule-types.md).
* All PDAs are derived deterministically; see [Architecture](https://velora-1.gitbook.io/docs/architecture.md) for the seed layout.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://velora-1.gitbook.io/docs/instruction-reference/instructions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
