
Stakr Protocol
- 3 installs
- 1.2k repo stars
- Updated August 1, 2026
- bankrbot/openclaw-skills
stakr-protocol is a Claude Code skill for interacting with Stakr's ERC-4626 multi-reward staking vaults on Base, letting an agent create vaults and add, modify, or stream reward tokens via the Bankr wallet.
About
stakr-protocol is a Claude skill for interacting with the Stakr protocol, which offers ERC-4626 tokenized vaults with multi-reward staking for any ERC-20 token. It focuses on agent-owned vaults where the agent can call addRewardToken and modifyRewardToken to fund and adjust reward programs, including streaming rewards over time. Transactions are submitted through the Bankr wallet API. A developer uses it to build tooling that creates vaults and manages incentive programs on Base.
- Interacts with Stakr ERC-4626 vaults with multi-reward staking on Base
- Lets an agent create a vault and add, modify, or stream reward tokens
- Executes vault calls through the Bankr wallet API
Stakr Protocol by the numbers
- 3 all-time installs (skills.sh)
- Ranked #390 of 479 Web3 & Blockchain skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
stakr-protocol capabilities & compatibility
- Capabilities
- hydrex
- Runs
- Runs locally
- Pricing
- Bring your own API key
What stakr-protocol says it does
This skill gives agents the context to interact with the **Stakr** protocol: ERC-4626 tokenized vaults with **multi-reward staking** for any ERC-20 token.
npx skills add https://github.com/bankrbot/openclaw-skills --skill stakr-protocolAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 3 |
|---|---|
| repo stars | ★ 1.2k |
| Last updated | August 1, 2026 |
| Repository | bankrbot/openclaw-skills ↗ |
What it does
Create and operate Stakr ERC-4626 vaults on Base, adding, modifying, or streaming multi-reward staking programs via Bankr.
Who is it for?
Agents that create and fund their own Stakr staking vaults and reward programs on Base
Skip if: Non-Stakr staking or off-chain reward systems
When should I use this skill?
An agent needs to create a Stakr vault, add or modify reward tokens, fund incentive programs, or stream rewards
By the numbers
- up to 25 reward tokens per vault
- 2 core functions emphasized (addRewardToken, modifyRewardToken)
- distribution is linear over the reward window
Files
Stakr Protocol — Agent Overview
This skill gives agents the context to interact with the Stakr protocol: ERC-4626 tokenized vaults with multi-reward staking for any ERC-20 token. Use it when building integrations, scripts, or tooling that create vaults, add rewards, modify reward schedules, or let an agent operate its "own" vault.
---
Protocol at a Glance
- StakrVault: Single-asset ERC-4626 vault. Users deposit underlying, get shares; they can lock shares to earn multiple reward tokens over configurable windows.
- StakrVaultFactory: Deploys vaults and holds protocol fee configuration. One factory per chain.
- Rewards: Up to 25 reward tokens per vault. Each reward has
startTime,endTime, and totalamount. Distribution is linear over the window; logic is Masterchef-style (accumulated rewards per share). - Ownership: A vault can have an
owner(address that can add/modify rewards) oraddress(0)for permissionless reward addition.
When an agent is said to have its "own vault", it means: the agent (or a controlled EOA/contract) is the vault owner, so it can call addRewardToken and modifyRewardToken to fund and adjust rewards without third-party permission.
---
Emphasis: Adding and Modifying Rewards (Agent-Owned Vaults)
Agents that operate their own vault will use these two functions most:
1. addRewardToken(token, amount, settings)
Purpose: Start a new reward program for a given ERC-20 token.
- Caller: Vault owner (or anyone if
owner() == address(0)). - Parameters:
token: ERC-20 reward token address. Cannot be the vault’s share tokenaddress(vault).amount: Total amount oftokento distribute. Tokens are pulled frommsg.sender; protocol may take a fee (see factoryfeeOnAddReward).settings:Settings{ startTime, endTime }. Distribution is linear fromstartTimetoendTime; both must be in the future andstartTime < endTime.- Effects: Registers the reward, pulls tokens (minus fee) into the vault, and emits
AddReward. Rewards cannot be withdrawn once added; they can only be modified (extended or topped up) viamodifyRewardToken. - Limits: No duplicate reward token; vault cannot have more than 25 active rewards.
Use this when the agent wants to create a new reward (e.g. launch an incentive program on its vault).
2. modifyRewardToken(token, amount, settings)
Purpose: Add more amount and/or extend (or reschedule) an existing reward.
- Caller: Same as
addRewardToken(vault owner or permissionless if owner is zero). - Parameters:
token: Address of an already active reward token.amount: Additional amount oftokento add. Pulled frommsg.sender; fee may apply. Cannot reduce existing amount.settings:Settings{ startTime, endTime }. Rules:- If the reward has not yet ended (
currentTime <= reward.settings.endTime): you can only extendendTime(and add more amount).startTimecannot be changed. - If the reward has ended (
currentTime > reward.settings.endTime): you can set a new window (startTime,endTime) and add amount;accRewardsPerShareis reset. - Effects: Increases
remainingAmount(and total amount) byamount, updatesendTime(and possiblystartTimeif reward had ended), pulls tokens frommsg.sender, and emitsModifyReward.
Use this when the agent wants to top up an existing reward or extend the distribution period (or reschedule after it has ended).
Summary for agents:
- New reward →
addRewardToken(token, amount, settings). - More reward or longer duration (or new window after end) →
modifyRewardToken(token, amount, settings). - Ensure the vault has been created via the factory and the agent (or its controlled address) is the vault owner to call these.
Executing Transactions via Bankr
To submit any Stakr call (vault creation, addRewardToken, modifyRewardToken), first encode calldata, then submit the transaction via the Bankr wallet API.
Use a natural-language Bankr agent prompt:
bankr agent prompt "Call addRewardToken on vault 0x... with token 0x... amount 1000 USDC starting tomorrow for 7 days"Or submit raw encoded calldata directly:
bankr wallet submit --to <vault-address> --data <encoded-calldata> --chain baseFor calldata encoding help, see the vault API reference.
3. Streaming rewards (continuous incentives)
Agents can stream rewards over time instead of funding one large window up front:
- Pattern: Call
addRewardTokenonce to start a reward (short amount if desired). Then call `modifyRewardToken` repeatedly to add more amount and extend `endTime`. Each call tops up the reward and pushes the end of the distribution window forward. - Why: This avoids locking a huge amount for a long period. The agent (or a script/cron) can fund the vault in chunks and extend the window as needed, effectively creating a continuous reward stream.
- Rules: While the reward is active (
currentTime <= reward.settings.endTime),modifyRewardTokenonly allows extendingendTimeand addingamount;startTimecannot be changed. After the reward has ended, the agent can set a brand‑new window withmodifyRewardToken(newstartTimeandendTime) and keep streaming.
Use streaming when the agent wants to fund incentives on an ongoing basis (e.g. weekly top‑ups, or extending the program as budget allows) rather than committing to a single long window.
---
Creating an Agent-Owned Vault
1. Get the StakrVaultFactory address for the chain.
- On Base mainnet, the factory is deployed at
0x7Ef55108fa37472296DA59D2287FdA92cd21A0d0(view on BaseScan). - For an example Stakr vault implementation on Base, see
0x93125009209e23fBAFf2B78712029F7A7CdD23cD(example vault on BaseScan).
2. Call `createStakrVault(underlying, name, symbol, description, owner)`:
underlying: ERC-20 underlying asset.name,symbol: Vault share token name/symbol.description: Short metadata (e.g. "Agent incentive vault").owner: Set to the agent’s address (or the EOA/contract the agent controls). Useaddress(0)for permissionless reward add/modify by anyone.
3. Use the returned vault address for all subsequent calls (addRewardToken, modifyRewardToken, etc.).
---
Core User Flows (for completeness)
- Deposit only:
deposit(assets, receiver)(ERC-4626). - Deposit and lock:
depositAndLock(assets, user). - Lock existing shares:
lock(shares, user)(vault must be approved for the shares). - Harvest:
harvest(user)to send pending rewards touser. - Unlock:
unlock(shares, user); then optionallyunlockAndRedeem(shares, receiver)to redeem shares for underlying.
---
Settings and Types
- Settings:
struct Settings { uint256 startTime; uint256 endTime; } - Validation:
block.timestamp <= startTimeandstartTime < endTimefor new or rescheduled rewards. - Token: Any ERC-20 except the vault’s share token. The underlying can be used as a reward.
---
For exact function signatures, revert reasons, and events, read the vault API in this skill when implementing calls or debugging.
Stakr Vault API Reference
Use this file when implementing calls, writing tests, or debugging. It summarizes the main Stakr contract interfaces and behavior.
---
StakrVaultFactory
| Function | Signature | Notes |
|---|---|---|
createStakrVault | createStakrVault(address underlying, string _name, string _symbol, string _description, address _owner) returns (address vault) | Deploys a new vault. _owner can be address(0) for permissionless add/modify rewards. |
availableStakrVaults | availableStakrVaults(address _underlying) view returns (uint256) | Number of vaults for that underlying. |
stakrVaultByIndex | stakrVaultByIndex(address _underlying, uint256 _index) view returns (address) | Vault address at index. |
setProtocolFee | setProtocolFee(uint256 _feeOnAddReward, uint256 _feeOnLock, address _feeCollector) | Requires FEE_MANAGER_ROLE. |
---
StakrVault — Reward API
Structs
struct Settings {
uint256 startTime; // Start of distribution
uint256 endTime; // End of distribution
}addRewardToken
function addRewardToken(address token, uint256 amount, Settings calldata _settings) external- Modifiers:
nonReentrant,checkOwnable(owner or anyone if owner isaddress(0)). - Reverts:
StakrVaultInvalidReward()iftoken == address(this), reward already active fortoken, or_rewardsCount >= MAX_REWARDS_COUNT(25).StakrVaultInvalidSettings()ifblock.timestamp > startTimeorstartTime >= endTime. - Side effects: Pulls
tokenfrommsg.sender(after optional fee to factoryfeeCollector). Cannot withdraw rewards later; usemodifyRewardTokento add amount or extend.
modifyRewardToken
function modifyRewardToken(address token, uint256 amount, Settings calldata _settings) external- Modifiers:
nonReentrant,checkOwnable. - Reverts:
StakrVaultInvalidReward()if reward fortokenis not active.StakrVaultInvalidSettings()ifblock.timestamp > _endTimeor_startTime >= _endTime, or (when reward has ended) ifblock.timestamp > _startTime. - Behavior:
- If reward not ended: only
endTimecan be updated (and extraamountadded).startTimeunchanged. - If reward ended: new
startTime/endTimeallowed;accRewardsPerSharereset. - Side effects: Pulls
amountoftokenfrommsg.sender(fee may apply). UpdatesremainingAmount,amount, andsettings.endTime(and optionallystartTime).
Streaming rewards (for agents)
Agents can stream rewards by using modifyRewardToken repeatedly instead of funding one long window with addRewardToken:
- Start with `addRewardToken(token, amount, settings)` (e.g. a short initial window).
- Then call `modifyRewardToken(token, amount, settings)` on a schedule (e.g. weekly): pass additional
amountand a new `endTime` that extends the distribution window. The reward stays active and linear; stakers see a continuous stream. - While the reward is active: only
endTimecan be updated (and extra amount added). After the reward has ended: a new full window (startTime,endTime) can be set and more amount added, then the cycle can repeat.
This pattern lets agents fund incentives in chunks and extend the program over time without locking a large lump sum upfront.
Execution via Bankr wallet
Use this file to build and validate function calldata (createStakrVault, addRewardToken, modifyRewardToken, etc.), then submit the transaction with Bankr wallet:
bankr wallet submit --to <vault-address-or-factory> --data <encoded-calldata> --chain baseFor a natural-language execution flow, see the skill guide section in ../SKILL.md.
Other reward-related
| Function | Signature | Notes |
|---|---|---|
rewardsCount | rewardsCount() view returns (uint256) | Number of active rewards (max 25). |
updateStakrVault | updateStakrVault() external | Updates internal accRewardsPerShare state; anyone can call. |
rewards | rewards(address) view returns (RewardToken) | Reward config per token. |
rewardDebt | rewardDebt(bytes32) view returns (uint256) | Per-user reward debt; ID = keccak256(abi.encodePacked(user, token)). |
---
StakrVault — Lock / Harvest / ERC-4626
| Function | Signature | Notes |
|---|---|---|
lock | lock(uint256 _shares, address _user) | Locks shares on behalf of _user; caller must transfer shares to vault first (or use depositAndLock). |
unlock | unlock(uint256 _shares, address _user) | Unlocks and sends shares back to msg.sender. |
depositAndLock | depositAndLock(uint256 assets, address _user) | Deposit underlying and lock resulting shares for _user. |
unlockAndRedeem | unlockAndRedeem(uint256 shares, address receiver) | Unlock and redeem shares for underlying to receiver. |
harvest | harvest(address _user) | Sends all pending rewards to _user. |
lockedShares | lockedShares(address) view returns (uint256) | Locked share balance per user. |
owner | owner() view returns (address) | Address allowed to add/modify rewards; address(0) = permissionless. |
transferOwnership | transferOwnership(address _newOwner) | Owner only. |
Standard ERC-4626: deposit, redeem, mint, withdraw, asset, totalAssets, etc.
---
Events
AddReward(address indexed token, uint256 amount, uint256 startDate, uint256 endDate)ModifyReward(address indexed token, uint256 amount, uint256 startDate, uint256 endDate)DeleteReward(address indexed token)— when a reward is fully harvested.Lock(address indexed user, uint256 amount, uint256 lastLockedTime)Unlock(address indexed user, uint256 amount, uint256 lastLockedTime)Harvest(address indexed user, address token, uint256 amount)
---
Errors
StakrVaultInvalidReward()— Invalid or duplicate reward token, or max rewards reached.StakrVaultInvalidSettings()— Invalid start/end times.StakrVaultInsufficientBalance()— Unlock amount exceeds locked balance.StakrVaultNotAllowed()— Caller is not owner (when owner is set).StakrVaultMathError()— Internal math revert (e.g. trySub failure).
Related skills
FAQ
How many reward tokens can a vault have?
Up to 25 reward tokens per vault, each with its own start time, end time, and total amount distributed linearly.
How are transactions executed?
By encoding calldata and submitting through the Bankr wallet API, either as a natural-language prompt or raw encoded calldata.