Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add ccashwell/evm-cortex --skill staking-reward-patternsgit clone --depth 1 https://github.com/ccashwell/evm-cortexWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ccashwell/evm-cortex/staking-reward-patterns)<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/staking-reward-patterns"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/staking-reward-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/staking-reward-patterns"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/staking-reward-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00042 | $0.01578 |
| Opus 5.5 | $0.00017 | $0.00631 |
| Sonnet 5.5 | $0.00008 | $0.00316 |
| Haiku 4.5 | $0.00004 | $0.00158 |
Grade A, and why
staking-reward-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 198 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Staking & Reward Distribution Patterns
Synthetix Reward Model
The industry-standard approach for distributing rewards proportionally to stakers without iterating over all stakers. Gas cost is O(1) per user action.
Core formula:
rewardPerToken = rewardPerToken + (elapsed * rewardRate / totalStaked)
earned(user) = balance(user) * (rewardPerToken - userRewardPerTokenPaid(user)) + rewards(user)
Synthetix-Style Reward Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
contract StakingRewards is ReentrancyGuard {
using SafeERC20 for IERC20;
IERC20 public immutable stakingToken;
IERC20 public immutable rewardToken;
address public rewardDistributor;
uint256 public rewardRate; // rewards per second
uint256 public periodFinish; // when current reward period ends
uint256 public lastUpdateTime;
uint256 public rewardPerTokenStored;
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => uint256) public userRewardPerTokenPaid;
mapping(address => uint256) public rewards;
uint256 public constant DURATION = 7 days;
constructor(address _stakingToken, address _rewardToken, address _distributor) {
stakingToken = IERC20(_stakingToken);
rewardToken = IERC20(_rewardToken);
rewardDistributor = _distributor;
}
modifier updateReward(address account) {
rewardPerTokenStored = rewardPerToken();
lastUpdateTime = lastTimeRewardApplicable();
if (account != address(0)) {
rewards[account] = earned(account);
userRewardPerTokenPaid[account] = rewardPerTokenStored;
}
_;
}
function lastTimeRewardApplicable() public view returns (uint256) {
return block.timestamp < periodFinish ? block.timestamp : periodFinish;
}
function rewardPerToken() public view returns (uint256) {
if (totalSupply == 0) return rewardPerTokenStored;
return rewardPerTokenStored + (
(lastTimeRewardApplicable() - lastUpdateTime) * rewardRate * 1e18 / totalSupply
);
}
function earned(address account) public view returns (uint256) {
return (
balanceOf[account] * (rewardPerToken() - userRewardPerTokenPaid[account]) / 1e18
) + rewards[account];
}
function stake(uint256 amount) external nonReentrant updateReward(msg.sender) {
require(amount > 0, "Cannot stake 0");
totalSupply += amount;
balanceOf[msg.sender] += amount;
stakingToken.safeTransferFrom(msg.sender, address(this), amount);
emit Staked(msg.sender, amount);
}
function withdraw(uint256 amount) external nonReentrant updateReward(msg.sender) {
require(amount > 0, "Cannot withdraw 0");
totalSupply -= amount;
balanceOf[msg.sender] -= amount;
stakingToken.safeTransfer(msg.sender, amount);
emit Withdrawn(msg.sender, amount);
}
function claim() external nonReentrant updateReward(msg.sender) {
uint256 reward = rewards[msg.sender];
if (reward > 0) {
rewards[msg.sender] = 0;
rewardToken.safeTransfer(msg.sender, reward);
emit RewardPaid(msg.sender, reward);
}
}
function exit() external {
withdraw(balanceOf[msg.sender]);
claim();
}
function notifyRewardAmount(uint256 reward)
external
updateReward(address(0))
{
require(msg.sender == rewardDistributor, "unauthorized");
if (block.timestamp >= periodFinish) {
rewardRate = reward / DURATION;
} else {
uint256 remaining = periodFinish - block.timestamp;
uint256 leftover = remaining * rewardRate;
rewardRate = (reward + leftover) / DURATION;
}
require(rewardRate > 0, "reward rate = 0");
require(
rewardRate * DURATION <= rewardToken.balanceOf(address(this)),
"reward amount > balance"
);
lastUpdateTime = block.timestamp;
periodFinish = block.timestamp + DURATION;
emit RewardAdded(reward);
}
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event RewardAdded(uint256 reward);
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 198 lines · 42 tokens per session scan A 4a9b61d7e2c4
staking-reward-patterns is a skill published in the GitHub repository ccashwell/evm-cortex (131 stars, last pushed 17d ago), licensed MIT. It adds 42 tokens to every session and 1,578 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
mpp-agent
Pay HTTP 402 APIs via Machine Payments Protocol (MPP).
bridge
Cross-chain token transfers using Wormhole and CCTP.
hyperliquid
Hyperliquid L1 perps DEX (69% market share).
marginfi
MarginFi — Solana lending and borrowing.
token-pick
One token recommendation and one prediction market pick - scored, quantified, with a skip branch when signals are weak.
crypto-market-rank
Crypto market rankings and leaderboards. Query trending tokens, top searched tokens, Binance Alpha tokens, tokenized stocks, social hype sentiment ranks, smart money inflow token rankings, top meme token rankings from Pulse launchpad, and top trader PnL leaderboards. Use this skill when users ask about token rankings…