staking-reward-patterns

Distribute staking rewards per second with a rewardPerToken mechanism.

120|12|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ccashwell/evm-cortex --skill staking-reward-patterns
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: staking-reward-patterns
Source: https://github.com/ccashwell/evm-cortex/tree/main/skills/staking-reward-patterns
Command: npx skills add https://github.com/ccashwell/evm-cortex --skill staking-reward-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Facilitates robust design and implementation of staking reward mechanisms, enabling fair, gas-efficient distribution of rewards to many users.

Core Features & Use Cases

  • Per-second reward accrual model that scales with stake without iterating over all stakers.
  • Supports cooldown windows and boosted rewards through lock-style mechanics.
  • Provides a blueprint for common DeFi patterns like staking, yield farming, and liquidity mining with safety guards.

Quick Start

Deploy a minimal staking rewards contract that distributes rewards per second proportional to stake.

Frequently Asked Questions about staking-reward-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I distribute staking rewards efficiently without iterating over all stakers?▼

A per-second accrual model distributes staking rewards efficiently by using a rewardPerToken mechanism, which scales with each user's stake without iterating over all stakers.

What is the best way to implement DeFi liquidity mining with cooldown and boost patterns?▼

Implementing a per-second reward accrual model enables DeFi liquidity mining with boost and cooldown patterns, utilizing lock-style mechanics to adjust reward distributions over time.

How does the rewardPerToken mechanism handle zero total supply in staking contracts?▼

The rewardPerToken mechanism handles zero total supply by pausing reward accumulation, ensuring no rewards are lost or inaccurately distributed when the total staked supply drops to zero.

Can I use ReentrancyGuard for time-based reward distribution across multiple users?▼

Yes, you can use ReentrancyGuard as a safety feature for time-based reward distribution across multiple users, preventing malicious reentrancy attacks during reward claiming operations.

Why does per-second reward accrual prevent gas spikes in yield farming protocols?▼

Per-second reward accrual prevents gas spikes in yield farming by calculating rewards mathematically based on elapsed time and stake size, eliminating the need for gas-intensive loops over user accounts.