Skip to content

Repository files navigation

Percolator Locker

A Solana smart contract (Anchor program) that lets holders of the $PERCOLATOR token lock their tokens for 30 days to earn trading fee discounts on the Percolator protocol.

Why

The Percolator token has a fixed supply of ~989,290,880 — no minting, no inflation. Instead of emissions-based staking, token holders earn utility by locking: lock your tokens, qualify for a fee discount tier, and pay less when trading on the protocol.

Fee Discount Tiers

Tier Min Lock Amount Trading Fee Discount
None < 500,000 0%
Bronze 500,000 10% off
Silver 1,000,000 20% off
Gold 5,000,000 30% off

Lock the minimum amount and complete a 30-day lock cycle to start earning discount time. Lock more to reach a higher tier.

Tier thresholds and the 30-day lock duration are vault parameters the admin can adjust over time within strict limits — see Governance & Parameter Updates. Any lock you already opened keeps the tier and cycle length it was created with, regardless of later adjustments.

How It Works

Every 30-day lock earns you 30 days of trading fee discount. The discount is always one cycle behind — you lock first, then receive the benefit.

  1. Connect your wallet on the Percolator site
  2. Choose how many tokens to lock
  3. Tokens are transferred to the program's vault and locked for 30 days
  4. After 30 days, your discount activates and your tokens stay in the vault — refresh before your earned discount runs out to extend it another cycle (no tokens move on refresh)
  5. If you don't refresh in time, your earned discount still runs for 30 more days, then lapses — once it lapses, refresh is no longer available; unlocking is the only way to retrieve your tokens, and doing so retires the position (see step 7)
  6. Withdraw your tokens by unlocking once the 30-day cycle has elapsed — tokens don't return automatically
  7. One lock per wallet per vault — after unlocking, that wallet's position for this vault is retired.

Governance & Parameter Updates

The vault has an admin key that can adjust the three tier thresholds and the lock duration over time. The program constrains what the admin can do so the economy can't be reshaped out from under existing lockers:

  • Existing locks are immune. When you lock, your tier and your cycle length are recorded on your position at that moment. Later changes to the vault's tier thresholds or lock duration do not retroactively re-classify your tier, extend your lock, or change when your earned discount ends. Admin changes only apply to locks opened after the change lands.
  • Changes are rate-limited. The admin must wait at least 7 days between successful config updates on the vault.
  • Each change is bounded. In any single update, no parameter (any of the three tier thresholds or the lock duration) can move by more than 50% of its current value. Reaching a very different value takes multiple updates spaced across multiple cooldown windows, giving users and integrators time to observe and react.
  • Ordering is preserved. Bronze must remain below Silver, which must remain below Gold, and the lock duration stays within the program's allowed range (1 day to 1 year).

The vault's custody fields (token mint, vault token account, admin pubkey, locker count, total locked) are never touched by a configuration update.

For Integrators

initialize_vault is permissionless: any signer can derive their own LockVault PDA at seeds [b"lock_vault", admin], pointing at any classic SPL Token mint (Token-2022 mints are not supported) with any tier thresholds. Multiple vaults therefore coexist under this program ID, and their Locked, Refreshed, and Unlocked events are structurally identical to the canonical Percolator vault's. Only one vault is canonical; the rest are inert from the protocol's perspective.

Fund safety is unaffected — each vault custodies its own vault_token_account, and a spoof vault cannot touch the canonical vault's tokens. The concern is off-chain: indexers, fee-discount matchers, dashboards, and UIs must filter by the canonical LockVault pubkey. Filtering by program ID alone will ingest spoof-vault events as real volume and may credit spoof tiers to users.

Program ID: 91JU1rmiLAPNcmC9Kew8cCXTRGFW1Pe67ZreijUia5S8 (current declare_id!; subject to change until mainnet deployment is finalized).

The canonical vault pubkey will be published in this README alongside the mainnet deployment. Do not hardcode any other address.

Build & Test

Requires Anchor 0.31.1 and Solana CLI. anchor-lang and anchor-spl are pinned to exact 0.31.1 in programs/percolator-locker/Cargo.toml.

Node must be reachable from Anchor's subprocess. On WSL, install a native Linux Node via nvm — a Windows node.exe surfaced through PATH interop will not work.

anchor build
anchor test

anchor test spins up a local validator and runs the full Mocha suite under tests/, which mixes validator-backed integration tests with in-process LiteSVM tests.

Rust unit tests (e.g. Tier::discount_bps in state.rs) are separate:

cargo test --manifest-path programs/percolator-locker/Cargo.toml

Ecosystem

License

MIT

About

Percolator token locker — lock $Percolator for protocol trading fee discounts

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages