Skip to main content

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.
The Strategy Sentinel Agent has ADMIN privileges and can execute privileged operations. Access should be restricted to authorized administrators only.

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.
raw.totalAssets
string
Total assets in vault (raw 18 decimals)
raw.totalSupply
string
Total share supply (raw 18 decimals)
raw.totalManaged
string
Total managed assets across all strategies (raw 18 decimals)
human.totalAssets
string
Human-readable total assets
human.totalSupply
string
Human-readable total supply
human.totalManaged
string
Human-readable total managed
{
  "raw": {
    "totalAssets": "500000000000000000000",
    "totalSupply": "475000000000000000000",
    "totalManaged": "1000000000000000000000"
  },
  "human": {
    "totalAssets": "500.00",
    "totalSupply": "475.00",
    "totalManaged": "1000.00"
  }
}

get_strategy_states

Fetches strategy addresses, their balances, and target BPS allocations from the Strategy Router.
strategy
string
Strategy contract address
raw.balance
string
Strategy balance (raw 18 decimals)
raw.targetBps
string
Target allocation in basis points (10000 = 100%)
human.balance
string
Human-readable balance
human.targetPercent
string
Target allocation as percentage
[
  {
    "strategy": "0xSTRATEGY_LEVERAGE_ADDRESS",
    "raw": {
      "balance": "800000000000000000000",
      "targetBps": "8000"
    },
    "human": {
      "balance": "800.00",
      "targetPercent": "80.00%"
    }
  },
  {
    "strategy": "0xSTRATEGY_AAVE_ADDRESS",
    "raw": {
      "balance": "200000000000000000000",
      "targetBps": "2000"
    },
    "human": {
      "balance": "200.00",
      "targetPercent": "20.00%"
    }
  }
]

get_leverage_strategy_state

Gets comprehensive state of the leverage strategy including deposited amount, borrowed WETH, LTV, and pause status.
raw.deposited
string
Total LINK deposited (raw 18 decimals)
raw.borrowedWETH
string
Total WETH borrowed (raw 18 decimals)
raw.netExposure
string
Net exposure (raw 18 decimals)
raw.ltv
string
Loan-to-value ratio (raw 18 decimals)
raw.paused
boolean
Whether strategy is paused
raw.maxDepth
string
Maximum leverage loop iterations (1-6)
raw.borrowFactor
string
Borrow factor in basis points
human.deposited
string
Human-readable deposited amount
human.borrowedWETH
string
Human-readable borrowed WETH
human.netExposure
string
Human-readable net exposure
human.ltv
number
LTV as decimal (e.g., 0.65 = 65%)
human.paused
boolean
Pause status
human.maxDepth
number
Max depth as number
human.borrowFactor
number
Borrow factor as percentage
{
  "raw": {
    "deposited": "800000000000000000000",
    "borrowedWETH": "150000000000000000",
    "netExposure": "650000000000000000000",
    "ltv": "650000000000000000",
    "paused": false,
    "maxDepth": "4",
    "borrowFactor": "6000"
  },
  "human": {
    "deposited": "800.00",
    "borrowedWETH": "0.15",
    "netExposure": "650.00",
    "ltv": 0.65,
    "paused": false,
    "maxDepth": 4,
    "borrowFactor": 60
  }
}

get_token_prices

Fetches real-time LINK and WETH prices from CoinGecko API.
LINK price in USD (scaled by 1e18)
raw.wethPriceUSD
string
WETH price in USD (scaled by 1e18)
How many LINK equal 1 WETH (scaled by 1e18)
Human-readable LINK price
human.wethPriceUSD
string
Human-readable WETH price
Human-readable LINK/WETH ratio
human.link24hChange
string
24-hour LINK price change
human.weth24hChange
string
24-hour WETH price change
human.interpretation
string
Human-readable price ratio interpretation
source
string
Data source
{
  "raw": {
    "linkPriceUSD": "15000000000000000000",
    "wethPriceUSD": "3000000000000000000000",
    "linkPricePerWETH": "200000000000000000000"
  },
  "human": {
    "linkPriceUSD": "15.00",
    "wethPriceUSD": "3000.00",
    "linkPricePerWETH": "200.000000",
    "link24hChange": "2.50%",
    "weth24hChange": "1.20%",
    "interpretation": "1 WETH = 200.00 LINK"
  },
  "source": "CoinGecko API (real market prices)"
}

get_user_balances

Fetches vault share balance and withdrawable amount for a specific user.
user
string
required
User wallet address
raw.shares
string
User’s share balance (raw 18 decimals)
raw.withdrawable
string
Withdrawable LINK amount (raw 18 decimals)
human.shares
string
Human-readable shares
human.withdrawable
string
Human-readable withdrawable amount
{
  "raw": {
    "shares": "95230000000000000000",
    "withdrawable": "100500000000000000000"
  },
  "human": {
    "shares": "95.23",
    "withdrawable": "100.50"
  }
}

get_vault_apy

Calculates the vault APY based on TVL growth over time.
apy
number
APY as decimal
readable
string
Human-readable APY percentage
tvl
number
Current total value locked
growth
number
TVL growth since last measurement
dt
number
Time elapsed in seconds
{
  "apy": 0.1245,
  "readable": "12.45%",
  "tvl": 1000000000000000000000,
  "growth": 0.05,
  "dt": 86400
}

Vault Management Tools

vault_deposit

Deposit LINK into vault (admin operation).
amount
string
required
Amount of LINK to deposit (human-readable)
hash
string
Transaction hash
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"

vault_withdraw

Withdraw shares from vault (admin operation).
shares
string
required
Number of shares to withdraw
hash
string
Transaction hash
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"

rebalance_vault

Triggers vault rebalance to reallocate funds according to target weights.
hash
string
Transaction hash
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
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.
hash
string
Transaction hash
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"

Risk Management Tools

check_liquidation_risk

Checks leverage strategy liquidation risk based on current LTV.
ltv
number
Current loan-to-value ratio
safe
boolean
Whether LTV is safe (< 70%)
warning
boolean
Whether LTV is in warning range (70-80%)
critical
boolean
Whether LTV is critical (>= 80%)
{
  "ltv": 0.65,
  "safe": true,
  "warning": false,
  "critical": false
}

auto_deleverage

Repay debt to reduce liquidation risk.
hash
string
Transaction hash
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
This operation will reduce leverage by repaying borrowed WETH. Use when LTV is too high or prices are volatile.

Strategy Configuration Tools

update_strategy_target_weights

Updates target allocation weights for strategies in basis points (10000 = 100%).
leverageStrategyBps
number
required
Target weight for leverage strategy (0-10000)
aaveStrategyBps
number
required
Target weight for Aave strategy (0-10000)
tx
string
Transaction hash
newWeights
object
New weight configuration
{
  "tx": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "newWeights": {
    "leverage": 7000,
    "aave": 3000
  }
}
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.
tx
string
Transaction hash
paused
boolean
New pause state
status
string
Status description (“paused” or “active”)
{
  "tx": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "paused": true,
  "status": "paused"
}
When paused, the leverage strategy cannot invest or deleverage. Use this during high market volatility or when risk is elevated.

update_leverage_params

Updates leverage strategy parameters for fine-tuning risk exposure.
maxDepth
number
required
Maximum leverage loop iterations (1-6)
borrowFactor
number
required
Borrow factor in basis points (0-8000, e.g., 6000 = 60%)
tx
string
Transaction hash
newParams
object
New parameter configuration
{
  "tx": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "newParams": {
    "maxDepth": 3,
    "borrowFactor": "50%"
  }
}
  • 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.
Reduce these values during volatile market conditions to decrease risk.

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:
1

Fetch prices

Call get_token_prices to get current LINK/WETH prices
2

Assess volatility

Check 24h price changes to determine market volatility
3

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)
4

Execute changes

Call rebalance_vault to apply allocation changes

Target Weight Management

Default allocation:
  • Leverage Strategy: 80% (8000 BPS)
  • Aave Strategy: 20% (2000 BPS)
Adjust weights based on:
  • 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

// 1. Check current state
const prices = await get_token_prices();
const leverageState = await get_leverage_strategy_state();
const risk = await check_liquidation_risk();

// 2. Assess risk
if (risk.warning || prices.human.link24hChange < -5) {
  // High volatility or price drop detected
  
  // 3. Reduce leverage parameters
  await update_leverage_params({
    maxDepth: 2,  // Reduce from 4 to 2
    borrowFactor: 4000  // Reduce from 6000 to 4000 (60% to 40%)
  });
  
  // 4. Adjust target weights
  await update_strategy_target_weights({
    leverageStrategyBps: 6000,  // Reduce from 80% to 60%
    aaveStrategyBps: 4000  // Increase from 20% to 40%
  });
  
  // 5. Execute rebalance
  await rebalance_vault();
  
  // 6. If still critical, pause leverage strategy
  if (risk.critical) {
    await toggle_leverage_strategy_pause();
  }
}

Best Practices

  1. Always check prices before decisions: Use get_token_prices to inform risk management
  2. Monitor LTV regularly: Call check_liquidation_risk frequently
  3. Gradual adjustments: Make incremental changes to leverage params rather than drastic shifts
  4. Rebalance after weight changes: Always call rebalance_vault after updating target weights
  5. Harvest regularly: Call harvest_strategy periodically to compound returns
  6. Emergency pause: Use toggle_leverage_strategy_pause immediately if LTV exceeds 80%

Build docs developers (and LLMs) love