Overview
The Strategy Sentinel Agent is an autonomous agent that monitors and manages vault strategies. It provides comprehensive tools for reading strategy state, managing risk, rebalancing allocations, and executing administrative operations.Agent Responsibilities
- Monitor strategy health and vault state
- Detect and mitigate liquidation risks
- Manage leverage strategy parameters
- Rebalance portfolio allocations
- Harvest yield from strategies
- Make price-based decisions using real market data
Agent Tools
Read & Monitoring Tools
get_vault_state
Reads the vault’s global state including total assets, supply, and managed balance.Total assets in vault (raw 18 decimals)
Total share supply (raw 18 decimals)
Total managed assets across all strategies (raw 18 decimals)
Human-readable total assets
Human-readable total supply
Human-readable total managed
get_strategy_states
Fetches strategy addresses, their balances, and target BPS allocations from the Strategy Router.Strategy contract address
Strategy balance (raw 18 decimals)
Target allocation in basis points (10000 = 100%)
Human-readable balance
Target allocation as percentage
get_leverage_strategy_state
Gets comprehensive state of the leverage strategy including deposited amount, borrowed WETH, LTV, and pause status.Total LINK deposited (raw 18 decimals)
Total WETH borrowed (raw 18 decimals)
Net exposure (raw 18 decimals)
Loan-to-value ratio (raw 18 decimals)
Whether strategy is paused
Maximum leverage loop iterations (1-6)
Borrow factor in basis points
Human-readable deposited amount
Human-readable borrowed WETH
Human-readable net exposure
LTV as decimal (e.g., 0.65 = 65%)
Pause status
Max depth as number
Borrow factor as percentage
get_token_prices
Fetches real-time LINK and WETH prices from CoinGecko API.LINK price in USD (scaled by 1e18)
WETH price in USD (scaled by 1e18)
How many LINK equal 1 WETH (scaled by 1e18)
Human-readable LINK price
Human-readable WETH price
Human-readable LINK/WETH ratio
24-hour LINK price change
24-hour WETH price change
Human-readable price ratio interpretation
Data source
get_user_balances
Fetches vault share balance and withdrawable amount for a specific user.User wallet address
User’s share balance (raw 18 decimals)
Withdrawable LINK amount (raw 18 decimals)
Human-readable shares
Human-readable withdrawable amount
get_vault_apy
Calculates the vault APY based on TVL growth over time.APY as decimal
Human-readable APY percentage
Current total value locked
TVL growth since last measurement
Time elapsed in seconds
Vault Management Tools
vault_deposit
Deposit LINK into vault (admin operation).Amount of LINK to deposit (human-readable)
Transaction hash
vault_withdraw
Withdraw shares from vault (admin operation).Number of shares to withdraw
Transaction hash
rebalance_vault
Triggers vault rebalance to reallocate funds according to target weights.Transaction hash
Rebalancing should be called after updating strategy target weights to execute the allocation changes.
harvest_strategy
Calls harvestAll() to collect yield from all strategies and return it to the vault.Transaction hash
Risk Management Tools
check_liquidation_risk
Checks leverage strategy liquidation risk based on current LTV.Current loan-to-value ratio
Whether LTV is safe (< 70%)
Whether LTV is in warning range (70-80%)
Whether LTV is critical (>= 80%)
auto_deleverage
Repay debt to reduce liquidation risk.Transaction hash
Strategy Configuration Tools
update_strategy_target_weights
Updates target allocation weights for strategies in basis points (10000 = 100%).Target weight for leverage strategy (0-10000)
Target weight for Aave strategy (0-10000)
Transaction hash
New weight configuration
The two weights must sum to exactly 10000 (100%). After updating weights, call
rebalance_vault to execute the reallocation.toggle_leverage_strategy_pause
Pauses or unpauses the leverage strategy.Transaction hash
New pause state
Status description (“paused” or “active”)
update_leverage_params
Updates leverage strategy parameters for fine-tuning risk exposure.Maximum leverage loop iterations (1-6)
Borrow factor in basis points (0-8000, e.g., 6000 = 60%)
Transaction hash
New parameter configuration
- maxDepth: Controls how many times the strategy loops to build leverage. Higher = more leverage, more gas.
- borrowFactor: Percentage of collateral to borrow in each loop. Higher = more aggressive leverage.
Risk Management Strategy
The Strategy Sentinel Agent follows a rule-based risk management approach:LTV Thresholds
- Safe: LTV < 70% - Normal operations
- Warning: LTV 70-80% - Monitor closely, consider reducing leverage
- Critical: LTV >= 80% - Immediate deleveraging required
Price-Based Decisions
The agent uses real-time price data from CoinGecko to make informed decisions:Evaluate risk
If price volatility > 10% or prices dropping rapidly:
- Pause leverage strategy (
toggle_leverage_strategy_pause) - Reduce leverage params (
update_leverage_params) - Adjust target weights (
update_strategy_target_weights)
Target Weight Management
Default allocation:- Leverage Strategy: 80% (8000 BPS)
- Aave Strategy: 20% (2000 BPS)
- Market volatility (reduce leverage allocation during high volatility)
- Price trends (shift to safer strategies when prices are declining)
- LTV levels (reduce leverage allocation if LTV is consistently high)
Example: Complete Risk Mitigation Flow
Best Practices
- Always check prices before decisions: Use
get_token_pricesto inform risk management - Monitor LTV regularly: Call
check_liquidation_riskfrequently - Gradual adjustments: Make incremental changes to leverage params rather than drastic shifts
- Rebalance after weight changes: Always call
rebalance_vaultafter updating target weights - Harvest regularly: Call
harvest_strategyperiodically to compound returns - Emergency pause: Use
toggle_leverage_strategy_pauseimmediately if LTV exceeds 80%