About the Automated Liquidity & Market Microstructure category

Nunchi Automated Bin Manager: Maximizing LP Yield via Cooperative Defensive Rebalancing

Maurice Herlihy

Department of Computer Science, Brown University

The Nunchi Team

INTRO The Dilemma: Arbitrage Loss vs. LP Yield

Designers of DeFi mechanisms face a fundamental dilemma: changes in market conditions often leave Liquidity Providers (LPs) vulnerable to arbitrage-related losses.

Consider this simple example: Imagine three constant-product AMMs. Market A trades Dollars for Euros, B trades Euros for Pounds, and C trades Pounds for Dollars. If an external price shift causes the exchange rates to become inconsistent, Alice, an arbitrageur, can extract a risk-free profit at the expense of the AMMs’ LPs.

Here is what can go wrong. Assume all three AMMs have the same trading function x y = 3, and all three are in state (1,3), Suppose Alice sells 1 USD to A for 3/2 EUR, which she sells to B for 9/5 GBP, which she sells to C for 27/14 USD. In the end, she collects an arbitrage profit of 13/14 USD, all at the expense of the AMMs’ LPs.

However, the LPs could work together to prevent this loss. Suppose they voluntarily redistributed their assets among themselves, in this case, moving 1 EUR from A to B, 1 GBP from B to C, and so on—they would re-align their prices with the market without trading against Alice. They would eliminate the arbitrage vulnerability and retain that value for their own LPs.

This simple example illustrates a broader principle, called Defensive Rebalancing. While defensive rebalancing has been explored theoretically for spot markets, Nunchi is applying it for the first time to the complex world of yield-bearing perpetuals.

The Payoff: Why This Maximizes APY

We are building this infrastructure for one reason: to fundamentally improve the risk-adjusted return for our LPs.

An LP’s annualized yield is the sum of cash-earning components divided by deployed capital, net of risk drag:

\text{APY} \approx \frac{\text{Fees} + \text{Funding} - \text{Inventory Drag (IL)} - \text{Ops Costs}}{\text{Deployed Capital}}

Nunchi’s Automated Bin Manager (ABM) is designed to attack this equation from both sides:

  1. Increasing Fee Capture: By using Oracle-Bound Bins rather than a standard curve, we concentrate liquidity in tight ranges near the fair price. This significantly increases the probability of capturing fees from organic flow.

  2. Crushing Inventory Drag: In perpetual markets, “Impermanent Loss” manifests as the opportunity cost of holding toxic inventory during price drifts. Our Cooperative Batch Clearing mechanism replaces costly external arbitrage with direct, internal netting. By shrinking inventory exposure before the market moves against us, we dramatically reduce the quadratic risk of being offside.

The Mechanics: Under the Hood of the ABM

For the quants and system designers, here is how the ABM executes this strategy in practice.

1. Oracle-Bound Bin Geometry

Unlike a typical AMM, Nunchi never lets the price drift blindly. Every posted price p cannot drift too far from the market price:

p \in (m_t - b_t, m_t + b_t)

Where m_t is the oracle mid-price and b_t is a confidence-aware band.

  • Volatility Scaling: The width of our bins (w_t) scales dynamically with short-horizon volatility (\hat{\sigma}_t).

  • Result: Quotes stay tight to capture fees in calm markets but widen automatically to protect capital during volatility spikes.

2. Inventory Controls

We employ strict, deterministic rules to prevent toxic exposure:

  • Self-Flattening Skew: Quote sizes are biased so that incoming flow naturally reduces net inventory.

  • Micro-Clips: If inventory breaches a “Soft Cap,” the ABM executes small, reduce-only clips to trim exposure.

  • Hard Stop-Out: If a “Hard Cap” is breached, the system pulls quotes and hedges to flat immediately.

DRAFT 3. The Core Innovation: Cooperative Batch Clearing

This is the implementation of Defensive Rebalancing. In periodic intervals, the ABM initiates an internal batch auction.

The Logic: If Maker A is long and Maker B is short, they are both paying “risk rent” to hold that inventory. Instead of waiting for an external taker to flatten them (and paying a spread to do so), they trade directly with each other at a fair, oracle-derived price.

The Math:

The system solves the following convex optimization problem to find the optimal net trade (x_j) for each participant j that minimizes aggregate inventory risk.

Given parameters:

  • I_j: Current inventory of Maker j.

  • \gamma_j: Inventory aversion parameter (risk tolerance).

  • c_j: Friction costs (slippage/fees).

Find:

  • x_j: The net trade (buy/sell) for maker j to execute.

Subject to:

\min_{x} \quad \sum_{j} \left( \frac{\gamma_j}{2} (I_j + x_j)^2 + c_j |x_j| \right) \quad \text{s.t.} \quad \sum_{j} x_j = 0

The Result:

The optimal solution (x^*_j) acts as a soft threshold. It ignores small “pebbles” (minor imbalances where trading cost > risk reduction) but sharply shrinks large inventory skews toward zero.

By netting these positions internally, the total system inventory (I_j + x^*_j) becomes smaller in the \ell_2 norm. This directly reduces the time-integrated quadratic penalty—our proxy for Impermanent Loss—resulting in a structurally higher APY for all participants.

Join the Discussion

Nunchi is building the liquidity primitive for the next generation of on-chain derivatives. We are looking for feedback from market makers, quants, and LPs.

  • Does this inventory-netting model align with your internal risk engines?

  • How would you parameterize the “friction cost” (c_j) in a high-fee environment?

About the Authors

  • Maurice Herlihy: Professor of Computer Science at Brown University. His research focuses on distributed computing and the theoretical foundations of DeFi, including the paper “Defensive Rebalancing for Automated Market Makers.”

* See M. Herlihy, Further Decentralizing Decentralized Finance (2024).

  • Nunchi: An institutional-grade onchain Yield Exchange (YEX) delivering perpetuals on U.S. Treasuries, staking yields, and funding curves, built by a team of quants and market-structure engineers.
1 Like