> 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;
