> For the complete documentation index, see [llms.txt](https://docs.ybx.script3.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ybx.script3.io/technical-docs/protocol/escrow-contract.md).

# Escrow Contract

### Escrows

Users will lock and unlock escrows through this contract. Escrowing periods are 3 month periods, 6 month periods, or 12 month periods. Users who escrow YBX will receive veYBX, which accrues escrowing fees and has voting power.

**Request**

```
{
    userPublicKey: string,
    timestamp: number,
    fee: string
    type: ProtocolEventTypes,
    unlocks?: {escrowId: string, amount: string}[],
    earlyUnlocks?: {escrowId: string, amount: string}[],
    lockAmount?: string,
    period?: number,
}
```

**Fields:**

* unlocks (OPTIONAL): Array of claimable balance ids tied to unlocked escrows and the amount from each of these escrows that the user would like to unlock.
  * Note: Users cannot unlock an amount that would bring your health factor below 1.1 or leave them with more votes than they have voting power.
* earlyUnlocks (OPTIONAL): Array of claimable balance ids tied to locked escrows and the amount from each of these escrows that the user would like to unlock.
  * Note: You cannot unlock an amount that would bring your health factor below 1.1.
* Lock Amount (OPTIONAL): Amount of YBX being locked
* Period (OPTIONAL): 3, 6 or 9 month period to lock YBX
* Unlock Early Amount (OPTIONAL): amount of YBX being unlocked prior to the defined unlock period
  * Note: You cannot unlock an amount that would bring your health factor below 1.1

### High-Level Contract Process Flow

The escrow contract changed after these docs were written. A revised contract process flow is coming soon!


---

# 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.ybx.script3.io/technical-docs/protocol/escrow-contract.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.
