> For the complete documentation index, see [llms.txt](https://docs.mcr369.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mcr369.io/dapp-documents/stakehouse/stakehouse-technical-information.md).

# STAKEHOUSE Technical Information

### 🛠 How STAKEHOUSE Smart Contract Works

#### 1️⃣ Create a Pool

A user initiates a HEX staking pool by setting the following parameters:

* **Stake Duration:** 1 to 5,555 days
* **Enrollment Period:** 1 to 369 hours
* **Creator Fee:** 0% to 1% (paid in HEX at maturity from principal + yield)
* **Minting:** A unique pool token (e.g., `SH<PoolID>`) is created.
* **Fee:** Pool creation costs **3,690 gwei**.

This pool becomes visible for others to join during the enrollment window.

***

#### 2️⃣ Enter a Pool

* Participants deposit HEX into the pool.
* In return, they receive a 1:1 ratio of pool tokens (e.g., 1 HEX = 1 SH\<PoolID> token).
* Deposits and withdrawals are permitted **anytime during the enrollment period**.
* Each action costs **3,690 gwei**.
* Users can withdraw HEX if they change their mind before the stake begins.

***

#### 3️⃣ Start the Stake

* After enrollment ends, **any user** can initiate the HEX stake.
* Starting the stake:
  * Sends collected pool creation fees to **Buffet**.
  * Distributes the **Creator Fee** to the pool creator (if set).
  * Locks all HEX into a single stake for the configured duration.
  * Automatically claims **Hedron** to the pool.
* This function is **open to all**, even if Creator Fee = 0.

***

#### 4️⃣ End the Stake

* Once the HEX stake matures, **anyone** can trigger the end-stake function.
* The caller pays the full **gas fee** and is reimbursed as other users claim their rewards.
* Ending the stake:
  * Claims HEX from the official HEX contract.
  * Collects earned **Hedron** into the pool.

***

#### 5️⃣ Withdraw from Pool

When a participant withdraws their HEX after the stake ends:

* They pay:
  * Their proportional share of the end-stake gas fee.
  * 1/20 of the total gas fee to **Buffet**.
* They receive:
  * **HEX** minus any Creator Fee.
  * **80% of the Hedron** earned.
  * **Creator Fee** is distributed if applicable.
  * **20% of Hedron** goes to **Buffet**.

***

#### 6️⃣ Bleed Functions (Post-Maturity Penalties)

To encourage timely action, the protocol includes **Bleed mechanics** starting 7 days after maturity:

**💧 Hedron Bleed:**

* Can be called by **anyone**.
* 50% of bled Hedron goes to the caller (Ender).
* 50% goes to **Buffet** for MCR369 stakers.

#### 💧 HEX Bleed

* Can be called by **anyone**, starting **7 days after the stake matures**.
* HEX bleeds at **1% per day**.
* The **"Bleed" button** becomes active once per day, in sync with the HEX contract’s daily cycle.
* **Creator Fee** is paid out from the bled HEX if applicable.
* Remaining bled HEX is transferred to **Buffet** for MCR369 stakers.
* **Bleed accumulates if not called daily**—missed days result in lost yield for the Creator and Buffet.
* If a user claims before the bleed is called, **the Creator and Buffet forfeit their share** for that user’s claim.

***

#### 🔁 Pool Flexibility

Users can **enter or exit** a pool freely during the enrollment period:

* Easily switch to a pool with **better terms** (e.g., lower Creator Fee or higher BPB bonus).
* No need to wait or lock into a suboptimal configuration.

\ <br>

\
\
&#x20;   &#x20;


---

# 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.mcr369.io/dapp-documents/stakehouse/stakehouse-technical-information.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.
