Farms
Farms let you stake LP tokens to earn USDC rewards sourced directly from DEX trading fees. There are no token emissions and no inflation - all yield is revenue-backed.
How It Works
UnitFlow runs a MasterChef contract that receives a share of protocol trading fees via a RevenueVault. Every 7 days an epoch advances and the accumulated USDC is distributed proportionally to stakers based on their weighted share of each pool.
- Add liquidity to a supported pool to receive LP tokens.
- Stake those LP tokens in the corresponding farm.
- Optionally lock your position for a boost multiplier (up to 2x).
- Harvest USDC rewards at any time, or let them accumulate.
Epoch System
Rewards are distributed in weekly epochs. The epoch banner at the top of the Farms page shows three live values:
| Field | Description |
|---|---|
| Epoch number | Current epoch index, increments each week |
| Epoch budget | USDC available for distribution in the current epoch |
| Total revenue | Cumulative USDC received by the MasterChef since deployment |
When the epoch timer reaches zero, any user can call advanceEpoch() to trigger the next distribution. The Farms UI shows an Advance button when the epoch is ready.
Pool Types
The MasterChef supports two pool types, set per pool at creation:
| Type | Value | Accepted token |
|---|---|---|
| V2 LP Token | positionType = 0 | Standard ERC-20 LP token from a V2.5 pair |
| V3/V4 NFT Position | positionType = 1 | ERC-721 position NFT from a V3 or V4 pool |
Multipliers
Your effective share of the reward pool is scaled by a combined multiplier made up of two independent components. Both are snapshotted at deposit time.
Lock Multiplier
Choose a lock duration when staking. Longer locks give a higher multiplier. You cannot withdraw principal before the lock expires without incurring the early-exit penalty.
| Duration | Multiplier |
|---|---|
| No lock | 1.00x |
| 30 days | 1.25x |
| 90 days | 1.60x |
| 180 days | 2.00x |
NFT Multiplier
Holding UnitFlow NFTs in your wallet at deposit time grants an additional multiplier based on your total NFT balance:
| NFTs held | Multiplier |
|---|---|
| 0 | 1.0x |
| 10+ | 1.2x |
| 30+ | 1.3x |
| 50+ | 1.5x |
| 70+ | 1.6x |
| 100+ | 1.7x |
| 150+ | 1.8x |
| 180+ | 2.1x |
The maximum combined multiplier is 2.1x (180-day lock at 2.0x combined with 180+ NFTs at 2.1x, applied multiplicatively and capped by the contract).
Early Exit Penalty
Withdrawing a locked position before the lock expires forfeits 50% of your pending USDC rewards. The forfeited amount is redistributed to remaining stakers in the same pool. Principal (LP tokens) is always returned in full.
An Emergency Withdraw option is also available. It returns your LP tokens immediately with no rewards at all, bypassing the normal penalty calculation.
Farm Card
Each active pool appears as a collapsible card. The collapsed header shows:
- Token pair logo and name (e.g.
USDC/WUSDC) - Pending USDC earned
- Amount staked
- Your current combined multiplier (if staked)
- A Locked badge if your position is time-locked
Expanding the card reveals:
- Total deposited in the pool and allocation points
- A harvest button for claiming pending USDC
- Your LP token wallet balance
- Links to the LP contract and MasterChef on ArcScan
- A Stake LP / Manage Position button that opens the stake modal
Stake Modal
The stake modal has two tabs: Deposit and Withdraw.
On the Deposit tab:
- Enter an amount or click MAX to fill your full wallet balance.
- Select a lock duration (defaults to no lock).
- A multiplier preview shows your lock bonus and NFT bonus before confirming.
- If the MasterChef does not yet have an allowance for your LP token, an approval transaction is sent automatically before the deposit.
On the Withdraw tab:
- Enter the amount to unstake (up to your full staked balance).
- If your position is locked, a warning shows the 50% early-exit penalty.
Contract Addresses (Arc Testnet)
| Contract | Address | Role |
|---|---|---|
| MasterChef | 0x64Aa5D632De94FA2Fbf7F8B8A8293483C08f1FD5 | Staking, reward accounting, epoch management |
| RevenueVault | 0x2d456fd5CE018a351E102667B3cE7cdB11C48796 | Receives protocol trading fees and forwards them to MasterChef |
| USDC (reward token) | 0x3600000000000000000000000000000000000000 | Native USDC on Arc Testnet |
| NFT Contract | 0x9e05C6075f9E890fC515EF86091414C77036f8FA | unitflowNFT, queried for NFT multiplier calculation |
MasterChef Interface
Key read functions:
| Function | Returns |
|---|---|
currentEpoch() | Current epoch index |
epochTimeRemaining() | Seconds until the epoch can be advanced |
epochRewardBudget() | USDC allocated for the current epoch |
totalRevenueReceived() | Cumulative USDC received since deployment |
poolLength() | Number of registered pools |
poolInfo(pid) | Pool struct: lpToken, positionType, allocPoint, totalDeposited, active, ... |
userInfo(pid, user) | User struct: amount, weightedAmount, lockEnd, lockDuration, nftMultiplierBP, ... |
pendingReward(pid, user) | Claimable USDC for a user in a pool |
getUserMultiplier(pid, user) | Returns (totalBP, lockMultBP, nftMultBP) in basis points |
Key write functions:
| Function | Description |
|---|---|
deposit(pid, amount, lockDuration) | Stake LP tokens, optionally with a lock |
withdraw(pid, amount) | Unstake LP tokens (50% reward penalty if locked) |
harvest(pid) | Claim pending USDC rewards without changing stake |
emergencyWithdraw(pid) | Return LP tokens immediately, forfeit all rewards |
advanceEpoch() | Permissionless, callable by anyone when epoch timer is zero |