Borrow Agent API integration
The Borrow Agent API supports collateral-backed borrowing on Base. Borrow Agent access is limited to Team experiment members and Pro users. Use the generated API reference for exact request and response schemas.
Check supported pairs
Section titled “Check supported pairs”GET /v1/chains/8453/borrow-pairslistBorrowPairs returns collateral and borrowed-asset pairs with a usable market. The configured collateral assets are USDC, WETH, cbBTC, and Coinbase tokenized stocks; configured borrow assets are USDC, WETH, and cbBTC. Supported providers are Aave V3 (Aave in the API), Aave V4, and Morpho Blue. A pair may be unavailable when no market passes its current checks.
Create and fund an agent
Section titled “Create and fund an agent”- Create an agent with
type: borrow,assetAddressset to the collateral token, andassetAddressByRole: { "borrow": "<debt-token-address>" }. Choose a pair fromlistBorrowPairs; creation requires a usable market for the selected wallet type. - Read the deterministic Agent Wallet address from the wallet endpoint.
- Use
prepareDepositto get unsigned transaction data for moving the agent’s collateral token from the user’s wallet into its Agent Wallet. The user must sign and submit the transaction. - After the deposit confirms, call
notifyAgentDeposit. For a standard user, deploy after the Agent Wallet holds at least $100 of collateral. - Set a nonzero borrow amount and enable a risk-alert channel. A Borrow Agent does not borrow unless both conditions are met.
The conservative and explorative presets supply starting rules; the borrow amount defaults to zero. Use createAgentMemory with managedRuleType: borrow_amount or risk_response to set the corresponding managed memory. Changing rules makes the agent eligible for an Autoseek run straight away.
Read limits and position data
Section titled “Read limits and position data”GET /v1/users/{userId}/agents/{agentId}/borrow-limitsGET /v1/users/{userId}/agents/{agentId}/memories/effective-rulesGET /v1/users/{userId}/agents/{agentId}/balance-sheetGET /v1/users/{userId}/agents/{agentId}/snapshotGET /v1/users/{userId}/agents/{agentId}/actionsgetAgentBorrowLimits reports current debt, the configured borrow amount, the maximum debt at the target health factor, free collateral that can be closed without repaying, the risk response, and a reason the agent cannot borrow more when applicable. The balance sheet and snapshot report the current position; action history records previous Autoseek decisions.
Adjust, repay, or close
Section titled “Adjust, repay, or close”Lowering the borrow amount tells Autoseek to repay toward the new total using idle borrowed tokens in the Agent Wallet. It does not sell collateral just to meet a lower borrow target.
Use withdrawFromPosition to close all or part of a borrow position. For a Borrow Agent, its vaultAddress field is the borrow market ID, not a lending protocol address. The operation returns collateral to the Agent Wallet. Collateral free above the warning health factor can be withdrawn without repaying; closing more repays the matching share of debt, using idle borrowed tokens first and selling collateral for any shortfall.
Use prepareWithdrawal to build unsigned transaction data for moving idle collateral or borrowed tokens from the Agent Wallet to the user’s connected wallet. The user signs and submits the transaction. Position collateral must be closed first; this endpoint does not close a loan or send funds from a lending market directly to the user.
Repaying an Aave V4 loan directly on Aave is unsupported. Repay through YieldSeeker using the Agent Wallet.
Close all positions and withdraw the remaining wallet balances before deactivation; an open borrow position blocks deactivation. See Borrow Agent preferences, Funding, monitoring, and exiting, and the API authentication guide.