Ballast

Ballast - leveraged, oracle-anchored liquidity on 1inch Aqua

Ballast

Created At

ETHGlobal New York 2026

Winner of

1inch

1inch - Build an Aqua App 4th place

Project Description

Ballast helps an LP make their liquidity work harder, without taking on the usual risk that comes with it.

The problem: in a normal AMM, an LP faces a trade-off. To offer tight prices (low slippage) on big trades, you need a lot of capital sitting in the pool. And when markets move fast, the pool's price can fall out of line with the real market price. When that happens, arbitrage traders buy from the pool at the stale, wrong price and the LP loses money.

Ballast fixes both sides of that trade-off with two pieces:

  1. Leverage - the pool quotes prices as if it held several times more capital than it actually does. This makes its prices much tighter (less slippage) without requiring the LP to lock up more money. I add a safety check so the pool can never promise more tokens than it really holds.
  2. An oracle anchor - before each trade, the pool checks the real market price from a Chainlink price feed. If the pool is about to sell at a price that's too generous (inviting the arbitrageurs to drain the LP), it caps the trade at the fair market price instead. The trade still happens - just at a price that protects the LP.

Leverage gives the pool depth while the Chainlink anchor keeps that deep, leveraged pool honest so the LP doesn't get picked off.

The price feed is read on-chain, inside the trade itself, and it directly sets how many tokens change hands - it's part of the TX.

Proof: I ran it on a FORKED ethereum mainnet using real WETH and USDC and the real Chainlink ETH/USD feed. On a pool deliberately knocked 2x off-market, a trader could grab ~11.9ETH for 10,000 DAI without the anchor. With the anchor on, the same trade is capped to the fair 5.94 WETH and the LP keeps the difference.

17 automated tests demonstrate that.

How it's Made

Stack: 1inch SwapVM and Aqua, Solidity, Foundry for tests and the demo, Chainlink Price Feeds for prices.

I wrote two custom opcodes:

  • Leverage — the pool quotes prices as if it held more capital than it does, so trades get tighter prices. It has a check that prevents quoting more tokens than the LP actually holds.
  • Oracle anchor — before each swap it reads the Chainlink price and caps the trade at fair value if the pool is about to give the trader too good a deal.

Both run on every swap, anchor first, then leverage.

Chainlink: the price feed is read on-chain inside the swap, and the price sets how many tokens change hands — it's not just displayed. The opcode handles different token decimals (e.g. WETH 18 vs USDC 6), trade direction, and stale-price rejection.

Two technical notes:

  • I pointed Foundry's remappings at the libraries already installed for the original template instead of reinstalling them. This required matching the template's exact compiler settings (viaIR, optimizer runs, EVM version) so the opcode lookups resolved correctly.
  • The Chainlink ETH/USD feed quotes price in the opposite orientation my code expects, so I wrote a small adapter to invert it. That let me use the real feed directly and run the demo on a fork of Ethereum mainnet with real WETH and DAI.
background image mobile

Join the mailing list

Get the latest news and updates

Ballast | ETHGlobal