Skip to Content
ConceptsFarms & Liquidity Mining

Farms & Liquidity Mining

Panoptis DEX includes a fully on-chain farming infrastructure that distributes PSW token rewards to users who stake LP tokens and participate in long-term governance. The system is a substantial evolution of the MasterChef pattern, adding boost mechanics, capped emissions, and automated buyback-and-burn.

Core Concepts

Staking LP Tokens

When users provide liquidity to a Panoptis pool they receive LP tokens representing their share of that pool. These LP tokens can be staked in a farm contract to earn PSW rewards on top of trading fees. Rewards accrue continuously and can be claimed at any time.

Allocation Points

Each farming pool has an allocation point weight (allocPoint). The fraction of total global emissions that a pool receives is:

Pool Share=pool.allocPointtotalAllocPoint\text{Pool Share} = \frac{\text{pool.allocPoint}}{\text{totalAllocPoint}}

Governance controls pool allocations, directing incentives toward strategically important liquidity.

Reward Accounting — accRewardPerShare

Rewards are tracked efficiently using a global accumulator per pool:

poolReward=Δt×rewardPerSecond×pool.allocPointtotalAllocPoint\text{poolReward} = \Delta t \times \text{rewardPerSecond} \times \frac{\text{pool.allocPoint}}{\text{totalAllocPoint}}

accRewardPerShare+=poolReward×1012totalStaked\text{accRewardPerShare} \mathrel{+}= \frac{\text{poolReward} \times 10^{12}}{\text{totalStaked}}

Each user’s claimable rewards are:

pending=user.amount×accRewardPerShare1012user.rewardDebt\text{pending} = \frac{\text{user.amount} \times \text{accRewardPerShare}}{10^{12}} - \text{user.rewardDebt}

rewardDebt is reset on every deposit, withdrawal, or harvest to ensure users are only paid for the period they were staked.

Boosted Farming

The PanoptisFarmV2Boosted contract extends base farming with a multiplier system powered by vePSW voting escrow balance. Users who lock PSW for extended periods receive higher reward weights.

How Boosts Work

  1. A user stakes LP tokens in a boosted pool.
  2. The farm calls BoostController.getBoostBps(user, pid, amount).
  3. The controller computes a boost in basis points (10,000 = 1×, 25,000 = 2.5×).
  4. The user’s boosted amount replaces their raw staked amount in reward calculations:

boostedAmount=stakedAmount×boostBps10,000\text{boostedAmount} = \text{stakedAmount} \times \frac{\text{boostBps}}{10{,}000}

  1. Pool reward share is computed against totalBoostedStaked rather than total raw stake.

This means a user with a 2.5× boost earns 2.5 times the rewards per LP token compared to an unboosted participant, subject to their vePSW balance.

Boost Controller Formula

The BoostController determines boost levels using a saturation curve:

requiredVe=lpAmount×vePerLp1018\text{requiredVe} = \frac{\text{lpAmount} \times \text{vePerLp}}{10^{18}}

veSaturation=min ⁣(1,  userVeBalancerequiredVe)\text{veSaturation} = \min\!\left(1,\; \frac{\text{userVeBalance}}{\text{requiredVe}}\right)

boostBps=baseBps+(maxBpsbaseBps)×veSaturation\text{boostBps} = \text{baseBps} + (\text{maxBps} - \text{baseBps}) \times \text{veSaturation}

Each pool can have its own vePerLp requirement and max boost cap. The controller returns baseBps (minimum 1×) on any failure, so stakers always receive at least base rewards.

Voting Escrow — vePSW

vePSW is a non-transferable, time-decaying voting weight obtained by locking PSW tokens. It is the core input to the boost calculation.

Lock Mechanics

  • Users create a single lock position with a chosen amount and unlock time.
  • Minimum lock: 7 days. Maximum lock: 4 years.
  • Unlock times are normalized to weekly boundaries.
  • A user can increase the amount or extend the duration of an existing lock, but cannot shorten it.
  • All PSW is returned at expiry (no burning).

Voting Power Decay

vePSW(t)=lockedAmount×tunlocktnowMAX_LOCK_TIME\text{vePSW}(t) = \text{lockedAmount} \times \frac{t_{\text{unlock}} - t_{\text{now}}}{\text{MAX\_LOCK\_TIME}}

Voting power decays linearly from full weight on the day of locking to zero at the unlock date. This means boost levels gradually decrease unless the lock is extended, creating sustained incentives for long-term commitment.

Emission Management

The EmissionManager contract governs the rate at which the treasury funds farm reward reservoirs, preventing sudden inflation spikes:

  • Governance sets an epoch cap — the maximum PSW that can be sent to farms within one epoch window.
  • Funding calls are rejected if they would exceed the epoch cap.
  • At the start of each new epoch the cap resets, allowing another round of funding.

This system decouples treasury policy from farm accounting and ensures a smooth, predictable emission schedule regardless of governance decisions.

Buyback and Burn

Excess protocol revenue can be routed through the BuybackBurnManager:

  1. The manager holds non-PSW tokens accumulated from fees.
  2. Authorized operators trigger a buyback: the manager swaps these tokens for PSW on a UniswapV2-compatible AMM.
  3. All purchased PSW is sent to the burn address (0x000...dEaD), permanently removing it from supply.

Slippage is controlled via maxAllowedSlippageBps, and all token movements are executed with SafeERC20. This creates deflationary pressure tied directly to protocol activity.

PSW Token

PSW is the Panoptis DEX native token:

PropertyValue
StandardERC-20 + ERC-2612 (permit)
SymbolPSW
Decimals18
Fixed Supply50,000,000
MintingNone after deployment

The fixed supply combined with emission caps and buyback-burn creates a bounded, deflationary token economy.

Security Design

ConcernMitigation
ReentrancyReentrancyGuard on all deposit/withdraw/harvest paths
Token transfersSafeERC20 wrapper throughout
Fee-on-transfer tokensNet-amount accounting after transfer
Emergency exitemergencyWithdraw() allows unstaking without reward claim
Boost controller failureFallback returns 1× boost so users always receive base rewards
Emission spikesEpoch cap enforced by EmissionManager

Contract Summary

ContractRole
PanoptisFarmClassic MasterChef — multi-pool staking and rewards
PanoptisFarmV2BoostedEnhanced farm with vePSW boost multipliers
BoostControllerComputes per-user boost basis points from vePSW balance
VePSWVoting escrow — lock PSW to earn boost and governance power
EmissionManagerEpoch-capped treasury funding for farm rewards
BuybackBurnManagerAutomated PSW buyback and permanent burn
PSWTokenNative ERC-20 protocol token (fixed supply, permit support)
Last updated on