LLAMMA
- Name: LLAMMA
- URL: https://docs.curve.finance/developer/crvusd/llamma-explainer
- Category: liquidation-range AMM / soft-liquidation lending engine / oracle-guided collateral-rebalancing primitive
- Tags: ethereum-ecosystem
- Summary: LLAMMA is Curve’s soft-liquidation engine. Instead of one hard threshold, it spreads liquidation across bands and lets arbitrageurs do the rebalancing until the position is bad enough for full liquidation.
- What it does:
- Distributes each loan’s collateral across a user-chosen number of price bands, creating a liquidation range instead of a single liquidation trigger
- Soft-liquidates collateral into the borrowed asset as prices fall within the range, and de-liquidates back into collateral if prices recover
- Uses a per-market AMM holding the collateral token and borrowed token, with separate LLAMMA instances for each market
- Relies on arbitrageurs to trade against price differences between the AMM’s internal price and the external oracle price, rather than having the contract directly dump collateral on every price move
- Keeps hard liquidation as a separate path that activates only when loan health falls below zero
- Shares the same AMM blueprint across current crvUSD mint markets and Llamalend markets, making it a reusable lower-layer liquidation engine rather than a one-off stablecoin mechanism
- Key claims:
- Curve’s docs explicitly define LLAMMA as the market-making contract that rebalances loan collateral and is responsible for liquidating and de-liquidating collateral based on market conditions through arbitrage traders, which is the clearest reason to catalog it as a distinct lower-layer primitive.
- The strongest design difference versus most lending protocols is the liquidation range. Official docs say LLAMMA continuously rebalances collateral inside that range instead of waiting for one threshold crossing and then hard-liquidating the position.
- The band architecture matters because liquidation is not tracked per user in isolation. Multiple users can share bands, and liquidation happens on a band basis, which changes scalability and socializes some microstructure across borrowers in the same market.
- The docs make the arbitrage dependency explicit: soft- and de-liquidation happen because the AMM’s
get_pdiverges fromprice_oracle, creating profitable trades that move the band balances toward the new price regime. - The raw AMM contract shows that oracle dependence is deeply built in rather than merely advisory. Variables like
p_oracle,active_band,bands_x,bands_y, and dynamic-fee logic are first-class state, and the contract constructor requires an external price oracle. - Controller-mediated deposit and withdrawal also matter. The AMM is not a free-floating pool where arbitrary LPs choose ranges; the Controller calculates the band range for a loan and is the admin that moves collateral in and out, which means loan policy and liquidation execution remain tightly coupled.
- Curve’s current overview also shows LLAMMA now sits beneath both crvUSD mint markets and Llamalend, so it should be treated as a reusable liquidation engine rather than only as a crvUSD implementation detail.
- The main reusable insight is that LLAMMA turns liquidation from a discrete keeper event into an oracle-guided continuous inventory-rebalancing process, with hard liquidation retained only as the final safety valve once health is exhausted.
Internal linkages
-
Best comparison points: curve, aave, and b-protocol.
-
Whitepaper: No standalone LLAMMA whitepaper surfaced in this pass. The strongest primary materials were Curve’s crvUSD overview, LLAMMA explainer, LLAMMA contract docs, and the canonical AMM implementation; see
../whitepapers/llamma-primary-sources-2026-05-14.md. -
Sources:
-
Last reviewed: 2026-05-31 UTC