Operate a Pool

This guide covers how to operate a stacking pool: accepting delegated STX from stackers, committing them to reward cycles, and managing the pool's stacked position.

circle-info

This guide assumes you are familiar with stacking at a conceptual level. If not, read the Stackingarrow-up-right concept guide first.

If you want to delegate your STX to a pool instead, see the Stack with a Pool guide.


Prerequisites

  1. A running signer or a signer you are collaborating with. See the Run a Signer guide.

  2. A pool operator wallet: a separate STX address used to manage delegations and make stacking transactions. This is different from your signer key. See Key and Address Rotation for why this separation matters.

  3. Funding: your pool operator wallet needs enough STX to cover transaction fees.

circle-info

As a pool operator, you should have two separate accounts:

  • Pool operator account: used for all stacking operations (delegate-stack-stx, stack-aggregation-commit-indexed, etc.).

  • Signer account: the key used to configure your signer. The signer public key is what you pass into the aggregation commit function.

This separation is recommended because you can rotate a signer key without disrupting delegations, but you cannot rotate a pool operator key without delegators needing to un-stack and re-delegate. See Key and Address Rotation for more details.

Set up your pool operator wallet using any Stacks wallet such as Leatherarrow-up-right or Xversearrow-up-right. Share this wallet's STX address with parties that will delegate to you.

For improved UX, you might use the helper contract pox4-poolsarrow-up-right and add your pool to earn.leather.ioarrow-up-right.

circle-info

There are several ways to make stacking transactions. This guide covers using Leather Earnarrow-up-right, which is the simplest option. You can also call the functions directly from the deployed contractarrow-up-right, or use the @stacks/stackingarrow-up-right NPM package.


Accept Delegations

After a delegator calls delegate-stx (see Stack with a Pool), you as the pool operator call delegate-stack-stx to commit each delegator's STX. This must be called for every individual stacker.

chevron-rightFunction source codehashtag

The arguments are:

  • Stacker: the STX address of the delegator

  • Amount: denoted in uSTX (1 STX = 1,000,000 uSTX)

  • Pox Address: the BTC address where you will receive rewards. If the delegator specified a BTC address in their delegate-stx call, you must use that same address.

  • Start burn height: the current BTC block height (add 1 or 2 to the current height when initiating the transaction). The delegation will not actively be stacked at this height, but at whatever reward cycle is committed in the aggregation commit step.

  • Lock period: number of cycles to lock for (maximum 12). If the delegator specified an expiration burn height, the lock period cannot extend past that.

This step also lets you choose which stackers to accept. For closed pools, only call this function for approved stackers.

You can repeat this for multiple stackers before proceeding to the commit step.


Commit Delegated STX

Once the total delegated STX exceeds the minimum stacking threshold, call stack-aggregation-commit-indexed to commit the pool's aggregate balance to a reward cycle. This is when you provide your signer key and signature.

circle-info

The minimum stacking threshold can be found at https://api.hiro.so/v2/poxarrow-up-right under min_threshold_ustx (1 STX = 1,000,000 uSTX).

circle-info

Use stack-aggregation-commit-indexed instead of the legacy stack-aggregation-commit. The indexed version returns the reward index, which is required if you later need to call stack-aggregation-increase.

chevron-rightFunction source codehashtag

Note that stack-aggregation-commit-indexed wraps inner-stack-aggregation-commit. The inner function is shown here.

The arguments are:

  • Pox Address: the BTC address to receive rewards

  • Reward-cycle: the future reward cycle to commit for

  • Signer public key: the public key of your signer (this is how you associate your pool operator address with your signer)

  • Signer signature: a signature proving control of your signing key (see Generate a Signer Signature)

  • Max Amount: used to validate the signer signature

  • Auth Id: used to validate the signer signature

circle-info

The delegate-stack-stx function sets the stacker's first reward cycle to the next reward cycle. When generating your signature and calling stack-aggregation-commit-indexed, make sure the reward cycles match.

For example, if you are in cycle 557 when calling delegate-stack-stx, pass cycle 558 or higher in both your signature and your stack-aggregation-commit-indexed transaction.

For solo stacking methods, you use the current reward cycle in the signature. For stack-aggregation-commit-indexed, you use the target reward cycle because you can commit for future cycles, not just N+1.

Once this succeeds, your pool is eligible for reward slots in that cycle. All steps up to this point must be completed before the prepare phase begins.

Using Leather Earn

Pool operators can log in to Leather Earn and visit https://earn.leather.io/pool-adminarrow-up-right to manage pool operations:

  • delegate-stack-stx: After a user delegates, call this for each individual stacker.

  • stack-aggregation-commit: Enter the reward cycle, BTC address, signer public key, signer key signature, Auth ID, and Max amount. This must be done for every individual reward cycle where the pool will be acting as a signer.


Increase Committed Amount

Even after committing, you can increase the total committed STX when new delegations are received.

1

Update the delegator's locked amount

Call delegate-stack-increase for each delegator whose locked amount needs to increase.

chevron-rightFunction source codehashtag

Arguments:

  • Stacker: the STX address of the delegator

  • Pox Address: the BTC address for rewards. Must match the delegator's specified address if one was set.

  • Increase by: the amount of uSTX to add to the delegator's locked amount

2

Commit or increase the stacked amount

After updating locked amounts, you must commit the change:

  • If you have not yet committed for the given cycle: call stack-aggregation-commit-indexed (see above).

  • If you have already committed: call stack-aggregation-increase with the index returned from the first commit and a new signature.

chevron-rightstack-aggregation-increase source codehashtag

Arguments for stack-aggregation-increase:

  • Pox Address: the BTC address to receive rewards

  • Reward Cycle: a reward cycle in the future

  • Reward Cycle Index: the index returned by stack-aggregation-commit-indexed

circle-exclamation

How Signer Registration Works for Pools

The delegated stacking workflow requires multiple transactions to register a signer:

1

Stackers delegate their STX

Stackers call delegate-stx to give the pool operator permission.

2

Pool operator accepts delegations

The pool operator calls delegate-stack-stx for each individual stacker.

3

Pool operator commits

The pool operator calls stack-aggregation-commit-indexed to commit all delegated STX. This is where the signer key is associated with the pool.

All steps must be completed before the prepare phase of the target reward cycle. During the prepare phase, DKG occurs and the signer is automatically registered. No manual action is needed beyond monitoring.

Last updated

Was this helpful?