LENDING OPTIMIZER

What is this tool: Demo of a USDC lending optimizer

This is a public demo of a lending allocation optimizer, in this case for a book of USDC. It pulls live data from lending venues (Morpho markets and vaults, Euler lend markets, Aave V3) on Ethereum mainnet and answers one question: given a pot of capital and a set of exposure limits, where to allocate to?

Every change is stored locally in the browser, so users can add markets and rewrite every limit without affecting anyone else's view. Share in the top right copies a link with the whole configuration encoded in it.

What this tool does

Step 1

Gets market data via APIs

Including total supply, total borrow, available liquidity, utilization, instant / 3D / 7D / 30D APY and LLTV.

Step 2

Ranks every market based on yield

Markets are sorted by APY.

Step 3

Fills allocations until risk limits hit

Working down the APY ranking, each market takes as much as the tightest of four caps (see below) allows. The optimizer reports which cap bound it.

CapWhat it limitsSet on
Max market allocationShare of the portfolio the vault is willing to allocate to a single market.Markets — Max Allo %
Max market shareShare of a market’s total supply the vault is willing to take on. Lower values mean the vault prioritizes liquidity (together with max utilization)Parameters
Group budgetCombined allocation cap across markets sharing a tag, for example BTC exposure across similar collateral (e.g. WBTC and cbBTC) can be capped together rather than only one position at a time.Parameters — Group Limits
Risk budgetCombined cap for each risk group (with risk scored from A to D)Parameters — Risk Rating Limits

How to use the tool

Use the three tabs, in the order presented here.

1

Select Markets

Open Markets

Default allocation venues are provided. + Add Market takes any other one: a Morpho market needs its unique key, a Morpho vault or Euler market needs the vault address, an Aave reserve needs both the pool address and the underlying token.

Per row, users can set an optional Group (a free-text tag — markets sharing it are capped together), a Risk rating A–D, and a Max Allo %. The Active checkbox parks a market without deleting it. Click an address to copy it, or ↗ to open the market on its own protocol's app.

2

Set Risk Parameters

Open Parameters

Portfolio value is the capital being allocated. Max utilization and max market share apply to every market at once. Optimize for chooses which APY the ranking uses (instant, or the 3-day, 7-day or 30-day average).

Group and risk limits can be adjusted and each have an on/off toggle.

3

The result: allocations per market and blended vault APY.

The exposure bars show how full each group and each rating is against its own cap. Lock In records the current proposal as the live book, so later runs show a vs Current column — the actual trades implied, rather than the target alone. Export CSV does what it says.