MOONEUM
Borrow against your crypto holdings

Borrow API

Draw liquidity against treasury holdings on Aave and Morpho without selling them — and monitor the loan's health programmatically.

Requires a key or token scoped to Borrow. Shares Earn's on-chain read infrastructure, but its own order, policy, compliance, and approvals surface.

Markets & borrowing

Browse markets

const { markets } = await client.listBorrowMarkets({
  chain: 'ethereum',
  protocol: 'aave',
});
// -> [{ id, protocol, protocolId, chain, borrowAsset, collateralAssets, borrowApy,
//       maxLtvBps, liquidationThresholdBps, availableLiquidity }, ...]

Supply collateral, then borrow

Every step here — supplying collateral, borrowing, repaying, withdrawing collateral — is an order (create → submit → approvals → signing), with Order.* events on the borrow domain.

const supply = await client.createBorrowOrder({
  walletId,
  chain: 'ethereum',
  protocol: 'aave',
  marketId: market.id, // BorrowMarket.id — not its (Morpho-only, optional) .marketId field
  action: 'SUPPLY_COLLATERAL',
  assetSymbol: 'ETH',
  amount: '10',
  amountRaw: '10000000000000000000',
});
await client.submitBorrowOrder(supply.id);

const draw = await client.createBorrowOrder({
  walletId,
  chain: 'ethereum',
  protocol: 'aave',
  marketId: market.id,
  action: 'BORROW',
  assetSymbol: 'USDC',
  amount: '15000',
  amountRaw: '15000000000',
});
await client.submitBorrowOrder(draw.id);

Monitor health

Read health factor and LTV whenever you need them.

const { positions } = await client.getBorrowPositions(walletAddress);
// -> [{ protocol, chain, collateral, debt, healthFactor, ltvBps, liquidationThresholdBps }, ...]

healthFactor is null when there's no outstanding debt. Below 1.0, the protocol can liquidate collateral.

Repay & withdraw

await client.createBorrowOrder({
  walletId,
  chain: 'ethereum',
  protocol: 'aave',
  marketId: market.id,
  action: 'REPAY',
  assetSymbol: 'USDC',
  amount: '15000',
  amountRaw: '15000000000',
});
// 'WITHDRAW_COLLATERAL' unwinds supplied collateral the same way, once debt allows it.

Recurring schedules

await client.createRecurringBorrowOrder({
  walletId,
  chain: 'ethereum',
  protocol: 'aave',
  marketId: market.id,
  action: 'REPAY',
  assetSymbol: 'USDC',
  amount: '2000',
  interval: 'MONTHLY',
});

The standard way to amortize a draw without a human remembering to do it. Manage schedules with listRecurringBorrowOrders, toggleRecurringBorrowOrder(id, enabled), and removeRecurringBorrowOrder(id).