Skip to main content

Overview

This agent skill manages which earn vaults a user’s collateral sits in, automatically rebalancing to maximize yield while keeping the credit line active and healthy.
  • Compares vault yields across supported strategies
  • Rebalances from lower-yield to higher-yield vaults
  • Protects the position by only rebalancing when health factor is safe

API Endpoints Used

How It Works

1

Check Current Position

The agent checks the user’s credit position to ensure it’s healthy enough to rebalance:
The agent only proceeds if healthFactor > 1.5 — rebalancing temporarily changes the collateral composition, so a larger buffer is needed.
2

Discover Available Strategies

The agent fetches the protocol config to get available earn strategies and their IDs:
This returns the credit configuration including a strategies field with available earn vaults. The agent compares the user’s current vault yield against alternatives.
3

Rebalance

If a higher-yield vault is available, the agent unlocks collateral from the current vault and re-locks into the new one using the earn param:
Returns { calls: ContractCall[] } — execute to unlock and unwrap from the current vault.
The unlock and lock must be executed sequentially — the collateral must be fully unlocked before it can be re-locked into a new vault.

Implementation

Configuration

Poll Interval

Default: every 1 hour. Vault yields change slowly, so frequent polling isn’t necessary. Hourly checks balance responsiveness with API usage.
Default: 1.5. Higher than the health monitor threshold (1.3) because rebalancing temporarily changes collateral composition. The extra buffer prevents accidental liquidation during the unwrap/wrap window.
Default: 0.5% APY. The agent only rebalances if the improvement exceeds this threshold. This prevents excessive on-chain transactions for marginal gains — each rebalance costs gas.

Supported Vaults

The agent can rebalance between any earn strategies returned by the protocol config:
The strategies field in the response contains available earn vaults with their IDs — use these as the earn param when calling /lock. See Risk Management for the full collateral tier table and LTV details per vault type.

Credit Engine

How collateral value and LTVs affect your credit line.

Health Monitor

Pair with the health monitor to protect positions during rebalancing.

Credit API Reference

Earn vault wrap/unwrap endpoints with interactive playground.