How staking actually works.
Staking $PIER into PierStaking is a single ERC-20 deposit. There's no lockup, no minimum, no cooldown on our side. You can unstake any time. Yield is paid in $gitlawb, claimable on demand. This page walks through what happens under the hood.
The mechanic, end-to-end
Every $PIER trade pays a 2% tax — configured on the Clanker token at launch. Because pier2pier's treasury is registered as the tax recipient, that 2% accrues to us in the on-chain Clanker FeeLocker. Our gas-only keeper then runs four on-chain steps in sequence:
- harvestClankerFees() — pulls the accumulated WETH out of the FeeLocker into the treasury.
- swapToGitlawb(amount, minOut) — swaps that WETH for $gitlawb on Uniswap V3. The slippage floor (
minOut) is enforced inside the contract; the keeper just executes. - routeYield() — takes 10% to the protocol fee sink, deposits the remaining 90% into PierStaking. After this call the treasury holds zero $gitlawb.
- You see your share. PierStaking uses masterchef-style accounting: accumulated reward per share is bumped by
(amount * 1e18) / totalStaked. Your pending rewards = your stake × current accumulator − your reward debt.
The two engines
Today, the pipeline above is the only revenue stream. The dashboard's “Pre-PoS” chip is the bright social line: no mainnet node-operator yield is being distributed today, because gitlawb's mainnet Proof-of-Stake contract hasn't deployed yet. When it does, we layer a second engine on top — automatically. Same staking position; same routeYield call drains both into the same pool.
Here's how the gitlawb protocol describes its node-operator reward track:
Every Sunday, the FeeDistributor distributes accumulated fees. 75% of the weekly pot is split across all active nodes (pro-rata by stake).
gitlawb/contracts · docs/RUN-A-NODE.md
And the core staking parameters — these are constants in the gitlawb staking contract, not knobs we control:
uint256 public constant MIN_STAKE = 10_000 * 1e18; // 10k $gitlawb uint256 public constant HEARTBEAT_WINDOW = 1 days; // expected cadence uint256 public constant INACTIVE_THRESHOLD = 3 days; // no rewards beyond this uint256 public constant UNSTAKE_COOLDOWN = 7 days;
gitlawb/contracts · src/GitlawbNodeStaking.sol#L33-L38
What you actually do, step-by-step
- Hold $PIER in the wallet you connect. (We don't custody anything. We never touch your $PIER except when you sign the
stake()tx.) - On the staking page, approve $PIER for PierStaking (one-time per allowance amount).
- Enter the amount you want to stake. The MAX button reads your live balance. Sign the
stake(amount)transaction in your wallet. - That's it. Your pending rewards in $gitlawb will start to accrue on the next
routeYieldcall. Refresh the page to see them tick up. - When you want to claim, hit the Claim button. When you want to exit, hit Unstake. Both are a single transaction; no waiting period.
The math behind your share
PierStaking uses the classic masterchef accumulator. Concretely:
- A global
accRewardPerShareincreases each time the treasury callsdepositYield(amount):acc += (amount * 1e18) / totalStaked. - Each user stores
(staked, rewardDebt, pendingClaim). - On any interaction, the contract harvests: it credits
(staked * acc / 1e18) − rewardDebtto yourpendingClaim, then setsrewardDebt = staked * acc / 1e18.
Net effect: if you stake the same amount as everyone else, you earn the same. If you stake twice as much, you earn twice as much. Standard pro-rata.
The stranded-rewards edge case
There's one quirk to know about. If the treasury routes yield while nobody is staked, that yield would normally be lost (divide-by-zero on the accumulator). We detect this: when totalStaked == 0 at the time of depositYield, the amount goes to a pendingPot bucket. The first staker after a stranding period receives the full pot, credited directly to their pending claim — no rounding loss. Try to be the first one in after a long pause.
What happens when gitlawb PoS launches
Until that day, PierTreasury's pier-lifecycle methods (registerPier, heartbeat, claimNodeRewards, etc.) revert with NodeStakingNotConfigured — by design. The treasury still runs the trade-tax engine end-to-end. The moment gitlawb publishes their mainnet NodeStaking address, we redeploy a fresh PierTreasury wired to it (the address is immutable by design — no upgrade path), migrate the Clanker fee recipient with a single transaction, and register the initial fleet of gitlawb nodes through the factory. The dashboard flips to “PoS live” and the second engine starts paying you.
You don't need to do anything. Your $PIER stays staked. Your $gitlawb starts compounding from two sources instead of one.