Skip to main content

Overview

Blend’s Agentic Framework is the off-chain system responsible for executing the quantitative strategies defined by Blend Intelligence. It’s a robust, decentralized system of services that monitor market conditions, identify when action is needed, and securely submit transactions to the on-chain contracts. The framework is designed for reliability and security, using a message-queue architecture to decouple its components and ensure fault tolerance.

Components

The Agentic Framework consists of several key off-chain services that work in concert:

Scheduler

This service is the pacemaker of the system. It periodically triggers checks to evaluate if any user portfolios need rebalancing based on the current strategy and market data.

Worker API

The Worker API is a fleet of services that listen for “rebalance requests” published by the Scheduler. It contains the core logic for determining the exact transaction needed to rebalance a position.

The Rebalancing Process

Rebalancing is the primary task of the Agentic Framework. It ensures that user portfolios remain aligned with the target allocations of their chosen strategy.
  • Threshold-based: Rebalancing is not continuous. It’s triggered only when a portfolio’s allocation deviates from its target by a predefined threshold, typically ~1-3%. Small deviations are batched to optimize gas costs.
  • Gas-aware: The framework is designed to be gas-aware. It will only execute a rebalance if the expected benefit of the trade outweighs the transaction costs.
  • Constraint-aware: All rebalancing actions respect the constraints of the underlying DeFi protocols, including liquidity, slippage, and LTV limits.
Derisking: If a strategy’s risk thresholds are breached, the framework will automatically derisk the position by moving 100% of the capital back to the base vault asset.

Rebalancing Logic

This diagram illustrates the decision-making process, including the derisking path.

Rebalancing Flow

1
Request InitiatedThe Scheduler identifies a need for rebalancing and publishes a RebalanceRequest to a message queue.
2
Job ConsumedA Worker consumes the request from the queue.
3
Transaction CalculatedThe Worker calculates the optimal transaction to align the portfolio with its target strategy.
4
On-Chain ExecutionThe Worker calls executeVaultAction on the StrategyManager contract, which instructs the user’s Safe to execute the transaction.

Manual Rebalancing

While the framework is fully automated, users always retain control. You can request a manual rebalance at any time via the SDK or API.
This will inject a rebalanceRequest into the message queue, which will be picked up by a worker just like an automated request. You can either get the raw transaction data to execute yourself, or create a full rebalance plan using the SDK.
import { BlendClientWithActions } from "@blend-money/sdk-actions";

const client = new BlendClientWithActions({ /* config */ }, {});

// Get the transaction data for a manual rebalance
const { target, data } = await client.actions.getManualRebalanceCall(
  userAddress,
  chainId,
  vaultId,
  amount
);

// You can then send this transaction using your preferred wallet.