# Stacking the STX Tokens

The actual strategy to stack the STX tokens and maximize the yield we receive on the rewards address is somewhat complex.

To understand the logic, we need to understand the inner workings of the Proof-of-Transfer (PoX)  contract in Clarity. We have `stack-stx`, `stack-extend` and `stack-increase` methods at our disposal. Furthermore, we know that each PoX cycle is 2100 Bitcoin blocks long (approximately 2 weeks), so we will have to model our inflows and outflows based on that.

As a default strategy, 5 stacker contracts will be used, which divide all the STX tokens between them based on a distribution that maximises the yield. In other words, each stacker gets a certain weight (between 0 and 100%) assigned that indicates the percentage of the amount of STX it should stack. The default weights are:

* Stacker 1: 50%
* Stacker 2: 25%
* Stacker 3: 15%
* Stacker 4: 5%
* Stacker 5: 5%

Each PoX cycle, all stackers can be extended with 1 cycle, using \`stack-extend\` (in case of net inflows). In the case that we have net outflows, we will have to unstack some STX. If the outflows are 5% or smaller, we only have to \*\*not\*\* extend 1 stacker, Stacker 5 in this case. If the net outflows are between 5 and 10%, we have to stop stacking with two stackers (Stacker 4 and Stacker 5) etc.

The calculations can be handled off-chain or on-chain. Practically we haven't seen a big advantage handling this on-chain, since all or a subset of STX have to be stacked anyway for the protocol to function.


---

# Agent Instructions: 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:

```
GET https://liquid-stacking.gitbook.io/liquid-stacking-docs/technical-solutions/stacking-the-stx-tokens.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
