> For the complete documentation index, see [llms.txt](https://gitbook.mor.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.mor.org/smart-contracts/documentation/builders-protocol/v2-protocol/get-started/create-the-builder-pool.md).

# Create the builder pool

## Pool creation

In the protocol, any user can create a builder pool by calling the `createBuilderPool` function. During creation, the user must specify a unique project name that will be used to generate the pool’s identifier using `keccak256`. Additionally, the creator must provide the builder’s address (the admin of the pool), who will be responsible for managing it. The builder must also define key parameters: the start time of the pool (`poolStart`), the withdrawal lock period after deposit (`withdrawLockPeriodAfterDeposit`), the reward claim unlock time (`claimLockEnd`), and the minimum allowed deposit amount (`minimalDeposit`). All of these parameters are validated by the contract before being accepted.

## Pool params

Each field in the `BuilderPool` struct plays a crucial role in defining the behavior of the pool. The `name` is the project label, used both for user identification and as the input for generating the unique pool ID.&#x20;

The `admin` field is the builder’s address, responsible for performing reward claims and pool management.&#x20;

The `poolStart` defines the timestamp from which users can begin depositing; any deposits made before this time will be rejected.&#x20;

`withdrawLockPeriodAfterDeposit` specifies the minimum time (in seconds) that must elapse after a user deposits before they are allowed to withdraw their tokens. This helps maintain deposit stability.

The `claimLockEnd` field defines when the `admin` can start claiming rewards and apply lock multiplier for all stakes until this timestamp.

&#x20;The `minimalDeposit` parameter ensures that any deposit (or remaining balance after a partial withdrawal) must meet or exceed a minimum threshold unless the user is fully withdrawing.

## Pool edit

Editing an existing pool is allowed only until the pool’s start time (`poolStart`). Only the builder (admin) who created the pool can perform edits. The `editBuilderPool` function accepts the same struct as the creation call, allowing modification of lock periods and start time. However, the new `poolStart` must not be earlier than the previously set one — this prevents time-based manipulation or rollback of the pool’s launch.

## Pool ID

The pool receives a unique `builderPoolId` derived from the project name using the following Solidity expression:

```solidity
bytes32 builderPoolId = keccak256(abi.encodePacked(builderPool.name));
```

This ID is then used in all pool-related operations including deposits, withdrawals, reward claiming, and internal data storage for builder configuration, user stakes, and reward accounting.


---

# 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://gitbook.mor.org/smart-contracts/documentation/builders-protocol/v2-protocol/get-started/create-the-builder-pool.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.
