yield-strategy-management
Manage allocation, rebalancing, and monitoring of vault yield strategies.
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
Quick Start (most common)
- Identify the target vault + underlying creator coin.
- Read current configuration (no writes):
- active strategies, weights, totalStrategyWeight
-
minimumTotalIdle,deploymentThreshold,defaultQueue,autoAllocate -
strategyDebtper strategy +totalDebt -
pricePerShare()andtotalAssets()
- Decide what action is needed:
- Configure: add/remove/update weights, set idle reserve, set queue
- Operate: deploy idle funds, tend, report, rebalance strategies
- Emergency: pause/shutdown, emergencyWithdrawFromStrategies, buyDebt
- Do not make onchain changes without explicit approval.
System Model (how strategy allocation works)
Core contract:
-
contracts/vault/CreatorOVault.sol
Key ideas:
- Vault holds idle creator coins (
coinBalance) and can deploy excess into strategies. - Strategies implement
IStrategy(single-asset: must haveasset() == CREATOR_COIN). - Allocation is weight-based:
-
deployable = coinBalance - max(minimumTotalIdle, deploymentThreshold) - each strategy gets
amount_i = deployable * weight_i / totalStrategyWeight
-
- Debt accounting:
- Vault tracks
strategyDebt[strategy]+totalDebtto reason about withdrawals and unrealised losses.
- Vault tracks
- Ops roles:
- management/owner: add/remove strategies, set weights, set idle reserve, configure queue, set keeper
-
keeper/management/owner:
deployToStrategies(),report(),tend()
Repo Map (where to look / common strategies)
- Vault:
contracts/vault/CreatorOVault.sol - Strategy interface:
contracts/interfaces/IStrategy.sol - Base strategy pattern:
contracts/vault/strategies/BaseCreatorStrategy.sol - Ajna strategy:
contracts/vault/strategies/AjnaStrategy.sol - Strategy deploy tooling:
-
contracts/helpers/batchers/StrategyDeploymentBatcher.sol -
docs/aa/AA_STRATEGY_DEPLOYMENT.md
-
- Allocation notes:
docs/lottery/MULTI_STRATEGY_ALLOCATION.md - Architecture:
docs/architecture/STRATEGY_ARCHITECTURE.md
Read-only Health Checks (preferred first)
Use templates (fill in $RPC_URL, $VAULT, $STRATEGY):
cast call --rpc-url $RPC_URL $VAULT "asset()(address)"
cast call --rpc-url $RPC_URL $VAULT "totalAssets()(uint256)"
cast call --rpc-url $RPC_URL $VAULT "pricePerShare()(uint256)"
cast call --rpc-url $RPC_URL $VAULT "minimumTotalIdle()(uint256)"
cast call --rpc-url $RPC_URL $VAULT "deploymentThreshold()(uint256)"
cast call --rpc-url $RPC_URL $VAULT "autoAllocate()(bool)"
cast call --rpc-url $RPC_URL $VAULT "totalStrategyWeight()(uint256)"
cast call --rpc-url $RPC_URL $VAULT "strategyDebt(address)(uint256)" $STRATEGY
cast call --rpc-url $RPC_URL $VAULT "strategyWeights(address)(uint256)" $STRATEGY
cast call --rpc-url $RPC_URL $STRATEGY "asset()(address)"
cast call --rpc-url $RPC_URL $STRATEGY "isActive()(bool)"
cast call --rpc-url $RPC_URL $STRATEGY "getTotalAssets()(uint256)"
Common Workflows
A) Set allocation targets (weights + idle reserve)
- Add strategies (management):
-
addStrategy(strategy, weightBps)(sum of weights must be ≤ 10_000)
-
- Set idle reserve:
-
setMinimumTotalIdle(minIdleAssets)to keep liquidity for withdrawals
-
- Optionally set default withdrawal order:
-
setDefaultQueue([strategy1, strategy2, ...])
-
B) Deploy idle funds to strategies (keeper op)
- Call
deployToStrategies()to move excess idle funds into strategies according to weights. - Verify:
-
coinBalancedecreased -
strategyDebt[strategy]increased
-
C) Maintenance cadence
-
tend()is a lightweight maintenance (deploy if above threshold). -
report()updates accounting, profit unlocking, and mints performance-fee shares (if configured).
D) Emergency actions
-
shutdownVault()+emergencyWithdrawFromStrategies()for urgent exits. - Use
buyDebt()only with explicit protocol direction (it changes debt accounting).
Troubleshooting (common pitfalls)
- Strategy add fails:
-
strategy.asset()mismatch (must equal vault’s creator coin) - strategy not active (
isActive() == false) - too many strategies (max 5)
- weights exceed 10_000 total
-
- Withdrawals revert due to unrealized losses:
- vault assesses unrealized losses during
_withdrawFromStrategies; investigate strategy health and consider de-risking.
- vault assesses unrealized losses during
Output Format (when using this skill)
Return a structured result:
- Summary: what change/operation is being requested
- Inputs: vault address, strategies, target weights, idle reserve
- Current state: key reads (totalAssets, PPS, debts, weights, queue)
- Proposed changes: exact onchain calls needed (read-only plan unless approved)
- Verification plan: post-state reads/events to confirm
- Risks: liquidity impact, withdrawal queue behavior, unrealized loss exposure
Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-20
- Mise à jour de l’index
- 2026-01-26
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!