> 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/release-milestone.md). Agents can also search and read this documentation through its [MCP server](https://velora-1.gitbook.io/docs/~gitbook/mcp).

# release\_milestone

Unlocks a `Milestone` stream in full by setting its `milestone_released` flag. This does **not** move tokens — it flips the unlock gate so the recipient can then call [`withdraw`](https://velora-1.gitbook.io/docs/instruction-reference/withdraw.md) to claim the full amount.

```rust
pub fn release_milestone(ctx: Context<ReleaseMilestone>) -> Result<()>
```

## Accounts

| Account         | Signer | Mut | Notes                                                   |
| --------------- | ------ | :-: | ------------------------------------------------------- |
| `authority`     | ✅      |     | Must satisfy the stream's `authority_type` rules below. |
| `stream_config` |        |  ✅  | PDA; `milestone_released` is set to `true`.             |

No parameters.

## Authorization (`authority_type`)

| `authority_type` | Who may release                      |
| ---------------- | ------------------------------------ |
| `None`           | creator only                         |
| `SingleKey`      | creator **or** `release_authority`   |
| `MultiSig`       | creator only (simplified — see note) |

{% hint style="warning" %}
`MultiSig` is currently simplified to creator-only. A full multi-sig would require a separate approval account and is out of scope for the current release.
{% endhint %}

## Behavior

1. Require `status == Active`.
2. Require `schedule_type == Milestone` (else `UnsupportedSchedule`).
3. Require `now <= end_timestamp` (else `StreamExpired`).
4. Check the signer against `authority_type`.
5. Set `milestone_released = true`.

After this succeeds, `compute_unlocked` returns `total_amount`, so the recipient can withdraw everything.

## Errors

| Code                  | Cause                                  |
| --------------------- | -------------------------------------- |
| `StreamNotActive`     | Stream is `Cancelled` or `Completed`   |
| `UnsupportedSchedule` | Stream is not a `Milestone` schedule   |
| `StreamExpired`       | `now > end_timestamp`                  |
| `Unauthorized`        | Signer not allowed by `authority_type` |

## Example (TypeScript / Anchor)

```ts
await program.methods
  .releaseMilestone()
  .accounts({
    authority: creator.publicKey, // or the release_authority for SingleKey
    streamConfig,
  })
  .signers([creator])
  .rpc();
```


---

# 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/release-milestone.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.
