Skip to content
YieldSeeker Docs

Borrow Agent API integration

The user signs deposits, while the Borrow Agent uses permitted adapters to manage the lending position. OWNER-SIGNED DEPOSITPERMITTED ADAPTER CALLSYour walletBorrow AgentLending market

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.

GET /v1/chains/8453/borrow-pairs

listBorrowPairs 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.

  1. Create an agent with type: borrow, assetAddress set to the collateral token, and assetAddressByRole: { "borrow": "<debt-token-address>" }. Choose a pair from listBorrowPairs; creation requires a usable market for the selected wallet type.
  2. Read the deterministic Agent Wallet address from the wallet endpoint.
  3. Use prepareDeposit to 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.
  4. After the deposit confirms, call notifyAgentDeposit. For a standard user, deploy after the Agent Wallet holds at least $100 of collateral.
  5. 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.

GET /v1/users/{userId}/agents/{agentId}/borrow-limits
GET /v1/users/{userId}/agents/{agentId}/memories/effective-rules
GET /v1/users/{userId}/agents/{agentId}/balance-sheet
GET /v1/users/{userId}/agents/{agentId}/snapshot
GET /v1/users/{userId}/agents/{agentId}/actions

getAgentBorrowLimits 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.

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.