# FILE: core-concepts/agent-primitives.md --- title: Agent Primitives sidebar_position: 2 --- # Agent Primitives STAKR exposes primitives that agents can compose into token operations. ## Deployment Primitive - `StakrVaultFactory.createStakrVault(...)` Use this to deploy a new vault for an ERC-20 and define ownership behavior. ## Incentive Primitives - `addRewardToken(token, amount, settings)` for new reward streams. - `modifyRewardToken(token, amount, settings)` for top-ups and schedule extension. These two calls are the core of ongoing incentive management. ## User Operation Primitives - `deposit`, `depositAndLock` - `lock`, `unlock`, `unlockAndRedeem` - `harvest` These are what your frontend agent or automation should expose to participants. ## Composition Pattern 1. Deploy vault. 2. Initialize first reward. 3. Schedule recurring modify calls. 4. Expose lock/harvest/unlock lifecycle to users. ## Next Step - Review [Security and Trust Model](./security-trust-model) before production rollout. --- # FILE: core-concepts/security-trust-model.md --- title: Security and Trust Model sidebar_position: 3 --- # Security and Trust Model STAKR uses explicit ownership and schedule constraints to make vault operations predictable. ## Ownership Modes - **Managed vault**: `owner != address(0)` Only owner can add/modify rewards. - **Permissionless vault**: `owner == address(0)` Any actor can add/modify rewards. Use managed mode for most agent-owned production deployments. ## Reward Guardrails - Max 25 reward tokens per vault. - No duplicate active reward tokens. - Time windows must satisfy `startTime < endTime` and future-validity checks. - Reward funds are not withdrawn; they are extended or topped up via modify flows. ## Operational Safety Recommendations - Separate deployment authority from treasury funding authority. - Monitor reward window expiry to avoid unexpected reward interruptions. - Validate all addresses and settings before submission. - Log emitted reward events for observability. ## Next Step - Continue with [StakrVaults Reference](../products/stakr-vaults/reference). --- # FILE: core-concepts/token-flywheel.md --- title: Token Flywheel sidebar_position: 1 --- # Token Flywheel STAKR helps communities convert short-term token activity into long-term aligned participation. ## Flywheel Model 1. Agents launch staking infrastructure quickly. 2. Stakers lock for rewards and conviction. 3. Liquidity depth and participation improve. 4. Economic value recirculates to aligned token holders. This loop lets agents focus on shipping product and utility while STAKR supplies reusable tokenomics rails. ## Why It Matters for Agent Builders - Less custom tokenomics contract work. - Faster iteration on incentive design. - Better alignment between users, agents, and treasury strategy. ## Product Mapping - **StakrVaults**: operational staking primitive (live). - **StakrPayments**: utility and value transfer expansion (in development). - **StakrCDP**: lending market connectivity for Bankr tokens (planned). ## Next Step - Go to [Quickstart](../get-started/quickstart) to implement the loop. --- # FILE: get-started/base-mainnet.md --- title: Base Mainnet Setup sidebar_position: 2 --- # Base Mainnet Setup STAKR is deployed on Base mainnet. Use these references as your source of truth. ## Network - Chain: Base Mainnet - Explorer: [basescan.com](https://basescan.com/) ## Canonical Contracts - StakrVaultFactory: [0xc7c16776b2eaf541621b11c38df401fc9d4e812b](https://basescan.com/address/0xc7c16776b2eaf541621b11c38df401fc9d4e812b) - STAKR token: [0xd1a7387d3ded8cb611a202fc1a9c9c74c23f2ba3](https://basescan.com/address/0xd1a7387d3ded8cb611a202fc1a9c9c74c23f2ba3) ## Core External Resources - Protocol site: [stakrbot.xyz](https://stakrbot.xyz/) - Agent skill: [stakrbot.xyz/SKILL.md](https://stakrbot.xyz/SKILL.md) - Bankr: [bankr.bot](https://bankr.bot/) ## Operational Checklist - Verify contract addresses directly in BaseScan before deployment scripts run. - Pin your integration to explicit addresses per environment. - Track protocol fee behavior when adding/modifying rewards. ## Next Step - Continue to [Agent Primitives](../core-concepts/agent-primitives). --- # FILE: get-started/quickstart.md --- title: Quickstart sidebar_position: 1 --- # Quickstart This guide gets an agent from zero to a running STAKR vault flow on Base mainnet. ## What You Build - A StakrVault tied to an underlying ERC-20. - A first reward program with `addRewardToken`. - A maintainable incentive schedule with `modifyRewardToken`. ## 1) Confirm Base Mainnet Context Use the Base deployment references from [Base Mainnet Setup](./base-mainnet). ## 2) Create a Vault Call factory (default or plugin-enabled): - `createStakrVault(address underlying, string _name, string _symbol, string _description, address _owner)` - `createStakrVault(address underlying, string _name, string _symbol, string _description, address _owner, address plugin)` Recommended owner model: - Set `_owner` to an agent-controlled address for managed rewards. - Use `address(0)` only when you explicitly want permissionless reward management. - Set `plugin = address(0)` unless you need strict policy hooks. ## 3) Start Incentives Create initial reward stream: `addRewardToken(address token, uint256 amount, Settings settings)` Settings: - `startTime` must be now or future. - `endTime` must be greater than `startTime`. ## 4) Keep Incentives Continuous Top up and extend with: `modifyRewardToken(address token, uint256 amount, Settings settings)` Pattern: - Start with a short initial window. - Extend in fixed intervals (for example weekly). - Add amount gradually to avoid over-allocating emissions upfront. ## 5) Expose User Flows Core actions to surface for users or downstream agents: - `depositAndLock` - `harvest` - `unlock` - `unlockAndRedeem` ## Next Step - Read [StakrVaults Workflows](../products/stakr-vaults/workflows) for implementation detail. - If you need policy controls, read [StakrVaults Plugin System](../products/stakr-vaults/plugins). --- # FILE: integrations/agent-automation-patterns.md --- title: Agent Automation Patterns sidebar_position: 2 --- # Agent Automation Patterns These patterns help agents run STAKR incentives reliably over time. ## Continuous Reward Streaming Recommended baseline: 1. Initialize a reward with `addRewardToken`. 2. Schedule recurring `modifyRewardToken` calls. 3. Extend `endTime` and top up `amount` each interval. This avoids one-time oversized reward allocations and keeps emissions adaptive. ## Practical Scheduling - Fixed interval cadence (daily/weekly). - Buffer top-ups before current window expiry. - Alerting on failed transactions and near-expiry windows. ## Safety Checks Before Each Run - Validate ownership permissions. - Verify reward token is active and eligible for modify. - Confirm settings time window is valid. - Validate treasury balance for transfer. ## Next Step - Use [StakrVaults Reference](../products/stakr-vaults/reference) for exact interfaces. --- # FILE: integrations/bankr.md --- title: Bankr Integration sidebar_position: 1 --- # Bankr Integration Bankr is a key ecosystem adjacency in STAKR's agentic token flow. ## Why It Matters - STAKR incentives and vault operations can align with Bankr token communities. - Integration narratives become clearer for agent operators and token holders. - Future product lines (Payments, CDP) are designed with ecosystem composability in mind. ## Integration Surface Today - Use StakrVaults for live staking and incentive loops. - Use STAKR canonical links and contract addresses for trustable references. - Track StakrPayments x402 alignment for machine-native payment flows. - Plan wrapping of BankrTokens into EIP-3009-compatible forms for authorization-based payments. - Expect STAKR facilitator services to support Bankr payment verification and settlement. - Track StakrCDP design direction for creator fee-bag collateral borrowing. - Expect Bankr token registry alignment as a lender trust signal for CDP eligibility. Bankr endpoint: [bankr.bot](https://bankr.bot/) ## Next Step - Implement recurring incentives from [Agent Automation Patterns](./agent-automation-patterns). --- # FILE: intro.md --- slug: / sidebar_position: 1 --- # STAKR Docs STAKR is an agentic token rails protocol for Base mainnet. It gives agents battle-tested primitives to launch and operate token flywheels, so teams can focus on building product value while STAKR handles reusable tokenomics infrastructure. ## Why STAKR - Turn token float into long-horizon conviction through staking rails. - Route value back to aligned participants instead of transient noise. - Start permissionlessly and iterate with low operational overhead. ## Product Suite ### StakrVaults (Live) Deploy and operate ERC-4626 vaults with multi-reward staking and lock mechanics. - Launch vaults for any ERC-20 on Base. - Configure incentives with `addRewardToken` and `modifyRewardToken`. - Run continuous reward streams with automation-friendly top-ups. Read next: [StakrVaults Overview](./products/stakr-vaults/overview) ### StakrPayments (In Development) Payment rails designed for agentic token ecosystems. - Expand utility beyond staking. - Support programmable value routing across agent workflows. Read next: [StakrPayments Overview](./products/stakr-payments/overview) ### StakrCDP (Planned) Collateral Debt Positions that help Bankr tokens plug into lending markets. - Unlock new capital pathways for token communities. - Add debt primitives to agent-driven token economies. Read next: [StakrCDP Overview](./products/stakr-cdp/overview) ## Start Here 1. [Quickstart](./get-started/quickstart) 2. [Base Mainnet Setup](./get-started/base-mainnet) 3. [Token Flywheel Model](./core-concepts/token-flywheel) ## Canonical Links - Website: [stakrbot.xyz](https://stakrbot.xyz/) - Skill: [stakrbot.xyz/SKILL.md](https://stakrbot.xyz/SKILL.md) - Vault Factory (Base): [0xc7c...812b](https://basescan.com/address/0xc7c16776b2eaf541621b11c38df401fc9d4e812b) - STAKR Token (Base): [0xd1a...2ba3](https://basescan.com/address/0xd1a7387d3ded8cb611a202fc1a9c9c74c23f2ba3) --- # FILE: products/stakr-cdp/overview.md --- title: StakrCDP Overview sidebar_position: 1 --- # StakrCDP Overview Status: **Planned** StakrCDP (Collateral Debt Positions) is designed to let Bankr tokens participate in lending-market style flows for their communities. ## Product Intent - Unlock borrow/lend pathways around agentic tokens. - Expand token utility and capital efficiency. - Connect token communities to stronger financial primitives. ## Creator CDP: Borrowing Against Your Fee Bag When a creator launches on Bankr, post-migration fee flow can accumulate into a real treasury position in their own token. Selling that inventory adds market pressure, so the core CDP model is to borrow against it instead of selling it. The proposed structure is a time-boxed bilateral agreement: - Creator deposits fee-bag tokens as collateral. - Lender provides ETH principal. - Creator repays principal plus a fixed rate before expiry. - If repayment fails by term expiry, lender claims the collateral. This model intentionally avoids continuous liquidation mechanics and ongoing oracle dependence. ## Borrow Cap Model Borrow capacity uses a hybrid cap where the lower value wins: - 50% LTV on collateral valuation. - Fee velocity cap: observed monthly fee accrual rate multiplied by term length. This favors observable economic throughput over thin spot-price prints in low-liquidity conditions. ## Price Feed at Origination - Origination uses a Uniswap V4 TWAP. - Observation window target: 1-2 hours. - Minimum pool age requirement: 7 days before feed trust. Because the agreement is fixed-term with no liquidation loop, oracle accuracy is required at origination rather than continuously. ## Natural Lender Profile The expected lender is often an existing token holder: - They are already directionally long on the creator token. - Lending ETH against the fee bag can add ETH-denominated yield. - Both sides avoid order-book sell pressure from treasury monetization. ## Strategic Role StakrCDP is a future extension of the same STAKR mission: reusable rails that let agent builders focus on product value while protocol primitives handle tokenomics complexity. ## Current Availability No production CDP interface is published yet. This section documents the intended direction and future integration model. ## Next Step - Continue to [StakrCDP Roadmap](./roadmap). --- # FILE: products/stakr-cdp/roadmap.md --- title: StakrCDP Roadmap sidebar_position: 2 --- # StakrCDP Roadmap Status: **Planned** This roadmap captures expected direction before API and contract finalization. ## Planned Outcomes 1. Enable creator borrowing against Bankr fee-bag collateral without forced market selling. 2. Establish a fixed-term bilateral lending path (ETH principal, fixed-rate repayment). 3. Keep risk controls and transparency as first-class design constraints. ## Design Priorities - Clear collateral eligibility and debt parameter controls. - Borrow cap = `min(50% LTV, fee_velocity * term_length)`. - Origination pricing via Uniswap V4 TWAP (1-2 hour window). - Minimum pool-age gating (7 days) before TWAP is trusted. - Compatibility with STAKR vault and payment rails over time. ## Eligibility and Distribution - Contract path is intended to be standalone and permissionless. - Borrow-asset eligibility is expected to be gated to Bankr-launched tokens. - Bankr token registry is the proposed allowlist signal for lenders. ## Counterparty and Flywheel Thesis - Natural lender profile: existing token holders looking for ETH-denominated yield. - Creator avoids open-market treasury selling. - Lender increases effective exposure without direct spot buying. - More launches -> more fee bags -> more CDP demand -> more lender yield. ## What to Monitor - Product status updates in [Release Notes](../../status/release-notes) - Ecosystem updates from [stakrbot.xyz](https://stakrbot.xyz/) ## Next Step - Review [Security and Trust Model](../../core-concepts/security-trust-model). --- # FILE: products/stakr-payments/overview.md --- title: StakrPayments Overview sidebar_position: 1 --- # StakrPayments Overview Status: **In Development** StakrPayments extends STAKR from staking incentives into programmable value transfer rails for agentic token ecosystems. ## Product Intent - Increase token utility across agent workflows. - Enable payment primitives that integrate naturally with vault incentives. - Let teams ship utility while reusing STAKR infrastructure patterns. ## x402 Core Concepts in StakrPayments StakrPayments is designed around the x402 payment flow for machine-to-machine commerce: 1. Client requests a protected resource. 2. Service responds with `402 Payment Required` and payment instructions. 3. Client submits a payment payload. 4. Service (or facilitator) verifies and settles payment. 5. Service returns the requested resource. This model is a strong fit for agentic systems because payment is embedded in HTTP request/response behavior and does not require account/session-heavy flows. ## BankrToken Compatibility Strategy A core direction is wrapping BankrTokens into EIP-3009-compatible payment tokens so agents can use authorization-based transfer flows for programmatic payments. Target outcomes: - Bankr ecosystems get payment-ready token rails. - Agents can pay for APIs/content directly in tokenized workflows. - Integrators get cleaner UX than manual approve/transfer sequences for each call. ## STAKR as Facilitator for Bankr Payments StakrPayments is designed so the STAKR ecosystem can operate facilitator services for Bankr token payments. Facilitator responsibilities include: - Validate payment payloads and policy constraints. - Provide verification and settlement endpoints for services. - Standardize operational guarantees for agent buyers and service sellers. This allows Bankr-focused builders to adopt x402-style payment behavior without each app rebuilding full payment verification infrastructure. ## Expected Outcome StakrPayments will complement StakrVaults by adding transaction-level utility pathways that reinforce the broader token flywheel. ## What to Use Today - Use StakrVaults for live incentive and staking flows. - Follow this section for interface and rollout updates as development progresses. ## Next Step - Read [StakrPayments Roadmap](./roadmap). --- # FILE: products/stakr-payments/roadmap.md --- title: StakrPayments Roadmap sidebar_position: 2 --- # StakrPayments Roadmap Status: **In Development** This roadmap outlines expected integration direction. Details may evolve before mainnet release. ## Phase Focus 1. Define x402-aligned payment primitives for agent applications. 2. Wrap BankrTokens into EIP-3009-compatible payment assets. 3. Establish STAKR facilitator services for Bankr token payment verification/settlement. 4. Provide clear SDK and API integration paths. ## Integration Expectations - Stable contract and/or service interfaces before production recommendation. - Clear upgrade and migration guidance from early versions. - Compatibility guidance with StakrVaults and Bankr ecosystem workflows. ## x402 Alignment Targets - Support canonical `402 Payment Required` response patterns and payment instructions. - Preserve buyer/seller separation with facilitator-assisted verification and settlement paths. - Keep integrations machine-friendly for agent clients and usage-based service monetization. ## Bankr Token Payment Rails - Define wrapping standards for BankrTokens into EIP-3009-compatible forms. - Publish recommended signing and authorization lifecycles for agents. - Ensure payment wrappers compose with future CDP and vault workflows. ## Facilitator Rollout Direction - Operate STAKR-side facilitator services for Bankr payment traffic. - Standardize verification and settlement behavior for service providers. - Document security and observability baselines for facilitator operators. ## Tracking Changes Use [Release Notes](../../status/release-notes) for milestone updates and shipping status. ## Next Step - Explore [Bankr Integration](../../integrations/bankr) to understand ecosystem adjacency. --- # FILE: products/stakr-vaults/overview.md --- title: StakrVaults Overview sidebar_position: 1 --- # StakrVaults Overview Status: **Live** StakrVaults are ERC-4626 vaults with lock-based multi-reward incentives on Base mainnet. ## What StakrVaults Solve - Launch staking rails quickly for any ERC-20. - Align token holders with sustained rewards. - Give agents programmable control over incentives. - Add policy controls using optional plugin hooks. ## Building Blocks - `StakrVaultFactory`: creates vaults and configures protocol fees. - `StakrVault`: handles deposits, share locking, reward accounting, and reward lifecycle. - `IStakrVaultPlugin`: optional strict hook system to extend vault behavior. ## Plugin System at a Glance A vault can be deployed with `plugin = address(0)` (no hooks) or with a plugin contract that implements `IStakrVaultPlugin`. - Hooks run around deposit, lock, unlock, redeem, add/modify/remove reward, and harvest. - Hook reverts are strict: if the plugin reverts, the vault action reverts. - This lets teams enforce policy like whitelist deposits, lock-up windows, or custom compliance checks without changing core vault logic. ## Typical Agent Lifecycle 1. Deploy a vault from factory (with or without plugin). 2. Fund first incentive with `addRewardToken`. 3. Keep program active with `modifyRewardToken`. 4. Let users lock, harvest, and unlock through app/agent UX. 5. Enforce policy using plugin before/after hooks when needed. ## Next Step - Implement from [StakrVaults Workflows](./workflows). --- # FILE: products/stakr-vaults/plugins.md --- title: StakrVaults Plugin System sidebar_position: 3 --- # StakrVaults Plugin System StakrVaults support optional plugins through `IStakrVaultPlugin`. This system is designed for teams that want custom policy or side effects without forking core vault logic. ## How Plugins Are Attached Vault creation supports two factory signatures: - `createStakrVault(underlying, name, symbol, description, owner)` - `createStakrVault(underlying, name, symbol, description, owner, plugin)` If `plugin` is `address(0)`, no hooks run. If `plugin` is non-zero, the vault calls plugin hooks around key actions. ## Strict Hook Semantics - Hooks are called only when `vault.plugin() != address(0)`. - Every hook receives `sender` as the first parameter. - Revert in a hook reverts the vault action. - There is no soft-fail path; this is strict-mode policy enforcement. ## Hook Surface ### Deposit - `beforeDeposit(sender, assets, receiver)` - `afterDeposit(sender, assets, receiver, shares)` ### Lock / Unlock - `beforeLock(sender, user, shares)` - `afterLock(sender, user, shares)` - `beforeUnlock(sender, user, shares)` - `afterUnlock(sender, user, shares)` ### Redeem - `beforeRedeem(sender, shares, receiver, owner)` - `afterRedeem(sender, shares, receiver, owner, assets)` ### Rewards - `beforeAddReward(sender, token, amount, startTime, endTime)` - `afterAddReward(sender, token, amount, startTime, endTime)` - `beforeModifyReward(sender, token, amount, startTime, endTime)` - `afterModifyReward(sender, token, amount, startTime, endTime)` - `beforeRemoveReward(sender, token)` - `afterRemoveReward(sender, token)` ### Harvest - `beforeHarvest(sender, user)` - `afterHarvest(sender, user)` ## Human-Focused Design Patterns - Whitelist deposits in `beforeDeposit`. - Enforce lock-up windows with `afterLock` + `beforeUnlock`. - Add reward governance checks in `beforeAddReward` and `beforeModifyReward`. - Emit plugin-level analytics events in after-hooks. ## Agent-Focused Implementation Notes - Keep plugin code deterministic and cheap in gas; hooks run inline on user actions. - Keep revert reasons explicit for automation retries and alerting. - Treat plugin rollout as policy deployment: test hooks against all vault paths (`deposit`, `depositAndLock`, `unlockAndRedeem`, `harvest`, reward add/modify/remove). - Monitor hook revert metrics in production. ## Canonical References - Protocol skill: [stakrbot.xyz/SKILL.md](https://stakrbot.xyz/SKILL.md) - Vault API skill: [stakrbot.xyz/vault-api/SKILL.md](https://stakrbot.xyz/vault-api/SKILL.md) - Plugin API skill: [stakrbot.xyz/plugin-api/SKILL.md](https://stakrbot.xyz/plugin-api/SKILL.md) ## Next Step - Continue to [StakrVaults Reference](./reference) for signatures, events, and error classes. --- # FILE: products/stakr-vaults/reference.md --- title: StakrVaults Reference sidebar_position: 4 --- # StakrVaults Reference Status: **Live** Primary source documents: - [stakrbot.xyz/SKILL.md](https://stakrbot.xyz/SKILL.md) - [stakrbot.xyz/vault-api/SKILL.md](https://stakrbot.xyz/vault-api/SKILL.md) - [stakrbot.xyz/plugin-api/SKILL.md](https://stakrbot.xyz/plugin-api/SKILL.md) ## Factory API - `createStakrVault(address underlying, string _name, string _symbol, string _description, address _owner) returns (address vault)` - `createStakrVault(address underlying, string _name, string _symbol, string _description, address _owner, address plugin) returns (address vault)` - `availableStakrVaults(address _underlying) view returns (uint256)` - `stakrVaultByIndex(address _underlying, uint256 _index) view returns (address)` ## Reward API - `addRewardToken(address token, uint256 amount, Settings calldata _settings)` - `modifyRewardToken(address token, uint256 amount, Settings calldata _settings)` - `rewardsCount() view returns (uint256)` - `rewards(address token) view returns (...)` - `updateStakrVault()` ## User/Position API - `deposit(uint256 assets, address receiver)` - `depositAndLock(uint256 assets, address _user)` - `lock(uint256 _shares, address _user)` - `unlock(uint256 _shares, address _user)` - `unlockAndRedeem(uint256 shares, address receiver)` - `harvest(address _user)` - `lockedShares(address) view returns (uint256)` ## Plugin Hook Coverage When `plugin() != address(0)`, vault calls plugin hooks around: - Deposit: `beforeDeposit` / `afterDeposit` - Lock: `beforeLock` / `afterLock` - Unlock: `beforeUnlock` / `afterUnlock` - Redeem: `beforeRedeem` / `afterRedeem` - Rewards: `beforeAddReward` / `afterAddReward`, `beforeModifyReward` / `afterModifyReward`, `beforeRemoveReward` / `afterRemoveReward` - Harvest: `beforeHarvest` / `afterHarvest` All hooks are strict-mode: revert in hook means revert in vault action. ## Core 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)` - `Harvest(address indexed user, address token, uint256 amount)` - `Lock(address indexed user, uint256 amount, uint256 lastLockedTime)` - `Unlock(address indexed user, uint256 amount, uint256 lastLockedTime)` ## Common Errors - `StakrVaultInvalidReward()` - `StakrVaultInvalidSettings()` - `StakrVaultNotAllowed()` - `StakrVaultInsufficientBalance()` - `StakrVaultMathError()` ## Base Mainnet Contracts - Factory: [0xc7c16776b2eaf541621b11c38df401fc9d4e812b](https://basescan.com/address/0xc7c16776b2eaf541621b11c38df401fc9d4e812b) - STAKR: [0xd1a7387d3ded8cb611a202fc1a9c9c74c23f2ba3](https://basescan.com/address/0xd1a7387d3ded8cb611a202fc1a9c9c74c23f2ba3) ## Next Step - Implement operations using [Agent Automation Patterns](../../integrations/agent-automation-patterns). --- # FILE: products/stakr-vaults/workflows.md --- title: StakrVaults Workflows sidebar_position: 2 --- # StakrVaults Workflows This page describes the operational path most agent teams use in production. ## 1) Create an Agent-Owned Vault Call one of: - `createStakrVault(underlying, name, symbol, description, owner)` - `createStakrVault(underlying, name, symbol, description, owner, plugin)` Recommendations: - Set `owner` to an agent-controlled address for managed rewards. - Use `plugin = address(0)` for default behavior. - Use a plugin address only when you need policy hooks. ## 2) Add First Reward Program Call: `addRewardToken(token, amount, Settings{startTime, endTime})` Use this when starting a new reward token for the vault. ## 3) Stream Rewards Over Time Call repeatedly: `modifyRewardToken(token, amount, Settings{startTime, endTime})` Behavior: - If reward is active, extend `endTime` and add amount. - If reward ended, define a new valid window and add amount. This enables continuous incentives without locking the full budget at once. ## 4) Expose Participant Flows - `depositAndLock(assets, user)` for one-step entry. - `harvest(user)` to claim pending rewards. - `unlock(shares, user)` and `unlockAndRedeem(shares, receiver)` to exit. ## 5) Add Plugin Policy (Optional) Common patterns: - Deposit whitelist in `beforeDeposit`. - Lock-up period enforcement with `afterLock` + `beforeUnlock`. - Reward policy checks in `beforeAddReward` and `beforeModifyReward`. Operational notes: - Hooks are called only when `plugin() != address(0)`. - Hook failure reverts the related vault action. ## 6) Observe and Maintain - Track reward and lock lifecycle event emissions. - Monitor reward windows before expiry. - Automate top-ups with recurring agent jobs. - Monitor plugin revert rates to catch policy misconfiguration early. ## Next Step - Read [StakrVaults Plugin System](./plugins) for hook-level details. --- # FILE: reference/contracts.md --- title: Contracts and Addresses sidebar_position: 1 --- # Contracts and Addresses Base mainnet canonical STAKR addresses: ## Core - StakrVaultFactory: [0xc7c16776b2eaf541621b11c38df401fc9d4e812b](https://basescan.com/address/0xc7c16776b2eaf541621b11c38df401fc9d4e812b) - STAKR token: [0xd1a7387d3ded8cb611a202fc1a9c9c74c23f2ba3](https://basescan.com/address/0xd1a7387d3ded8cb611a202fc1a9c9c74c23f2ba3) ## Canonical Documentation - Protocol website: [stakrbot.xyz](https://stakrbot.xyz/) - Agent skill: [stakrbot.xyz/SKILL.md](https://stakrbot.xyz/SKILL.md) - Vault API skill: [stakrbot.xyz/vault-api/SKILL.md](https://stakrbot.xyz/vault-api/SKILL.md) - Plugin API skill: [stakrbot.xyz/plugin-api/SKILL.md](https://stakrbot.xyz/plugin-api/SKILL.md) ## Next Step - Continue to [Skill Spec](./skill-spec). --- # FILE: reference/glossary.md --- title: Glossary sidebar_position: 3 --- # Glossary ## Agentic Token Rails Reusable primitives that agents can plug into to run token economics without custom rebuilding each cycle. ## Vault Owner Address with authority to add/modify rewards when owner is set. ## Permissionless Vault Vault with `owner == address(0)` where anyone can add/modify rewards. ## Reward Window Time interval `[startTime, endTime]` where a reward token is distributed linearly. ## Continuous Streaming Pattern of repeatedly topping up and extending reward windows over time using `modifyRewardToken`. ## CDP Collateral Debt Position. Planned STAKR primitive for collateralized borrowing use cases. ## Next Step - Return to [Quickstart](../get-started/quickstart). --- # FILE: reference/skill-spec.md --- title: Skill Spec Summary sidebar_position: 2 --- # Skill Spec Summary This page normalizes the essentials from STAKR skill documents for quick implementation. ## Source Skills - [stakrbot.xyz/SKILL.md](https://stakrbot.xyz/SKILL.md) - [stakrbot.xyz/vault-api/SKILL.md](https://stakrbot.xyz/vault-api/SKILL.md) - [stakrbot.xyz/plugin-api/SKILL.md](https://stakrbot.xyz/plugin-api/SKILL.md) ## Key Behavior Rules - Rewards are linear over `startTime -> endTime`. - Max active reward tokens per vault: 25. - `modifyRewardToken` can extend active rewards; once ended, it can reschedule with a new window. - `owner == address(0)` enables permissionless add/modify behavior. - Plugins are strict-mode: hook revert means vault action revert. ## Core Agent Calls - Deploy (no plugin): `createStakrVault(underlying, name, symbol, description, owner)` - Deploy (with plugin): `createStakrVault(underlying, name, symbol, description, owner, plugin)` - Start reward: `addRewardToken(...)` - Stream/extend: `modifyRewardToken(...)` - Participant flows: `depositAndLock`, `harvest`, `unlock`, `unlockAndRedeem` ## Plugin Hook Families - Deposit hooks: `beforeDeposit`, `afterDeposit` - Lock/unlock hooks: `beforeLock`, `afterLock`, `beforeUnlock`, `afterUnlock` - Redeem hooks: `beforeRedeem`, `afterRedeem` - Reward hooks: `beforeAddReward`, `afterAddReward`, `beforeModifyReward`, `afterModifyReward`, `beforeRemoveReward`, `afterRemoveReward` - Harvest hooks: `beforeHarvest`, `afterHarvest` ## Revert Classes to Handle - Invalid reward state. - Invalid time settings. - Not allowed caller. - Insufficient locked balance. ## Next Step - Check definitions in [Glossary](./glossary). --- # FILE: status/release-notes.md --- title: Release Notes sidebar_position: 1 --- # Release Notes ## Product Maturity - **StakrVaults**: Live on Base mainnet. - **StakrPayments**: In Development. - **StakrCDP**: Planned. ## Documentation Changelog ### 2026-03-14 - Replaced default template docs with STAKR product architecture. - Added mission-first onboarding and Base mainnet setup pages. - Added structured docs for Vaults, Payments, and CDP. - Added integration and reference sections from skill sources. - Added StakrVault plugin system docs for both human operators and agents. - Expanded StakrCDP documentation with Creator CDP model and lender/borrow-cap design. - Updated Base mainnet StakrVaultFactory address references. ## Next Step - Revisit [StakrVaults Overview](../products/stakr-vaults/overview) for live features.