◆ yellow paper · v2· ~ 9 min read· last updated 2026-05-10

Liquidity that does work.

lo0p is a PancakeSwap Infinity hook that turns the LP underneath an AMM into borrowable depth. Same constant-product curve, same swap UX, but every band of liquidity can lend BNB against LOOP collateral and self-heal when prices move. This page explains it from scratch, with the math.

01the problem

PancakeSwap is the largest source of automated market-maker liquidity on BNB Chain. Across V2, V3, and the new Infinity hook architecture, the protocol routinely holds billions of dollars in liquidity provider deposits.

value locked in PancakeSwap≈ $2.22Bcombined TVL, per DeFiLlama (May 2026)

That capital earns swap fees. But it is locked for everything else. A liquidity provider's $1M position cannot be borrowed against without first being withdrawn — and withdrawing kills the fee stream.

You can earn swap fees, OR use the tokens as collateral. Not both.

The same pattern repeats across DeFi: tokens locked into LP, into staking, into vaults are dead weight for any purpose other than their primary one. For a fair-launched community token, this means the deepest pool of capital — the LP itself — can never finance its own users.

02the idea

What if the AMM itself could lend? Every block, the Infinity pool knows precisely how much BNB it holds and at what price. That is a perfect oracle and a perfect treasury, owned by the protocol — not a third party.

lo0p is an Infinity hook that does exactly this. When a user wants to borrow BNB, the hook reaches into one of the LP positions backing the LOOP/BNB pool, pulls the requested BNB out, and hands it over. The LP shrinks slightly — but the spot price does not move, because we draw from a band that sits below the current spot.

band 0–N
BNB-only LP
(crossed bands)
↑ borrow draws from here
active band
spot price
sits here
swaps cross through

The key insight: Infinity's concentrated liquidity is divided into discrete tick ranges. Each range can hold BNB-only, LOOP-only, or a mix, depending on where the current spot is. We treat each range as a separate "band" of capital and lend from bands that have BNB to spare.

03the math

3.1 the curve

Like a vanilla constant-product AMM, lo0p maintains:

realTokens × (V + realBNB) = K

where V = 20 BNB is a fixed virtual reserve so the curve is well-defined even with zero real BNB, and K = 20,000,000 is the product constant set at deployment to fix the launch supply at 1,000,000 LOOP.

Spot price is (V + realBNB) / realTokens BNB per LOOP. As BNB flows in, realTokens drops and price rises. Standard stuff.

3.2 30-BNB bands

The pool is sliced into 100 discrete bands, each covering 30 BNB of cumulative inflow. Band i holds the LOOP that the constant-product curve would have sold across the BNB range [30i, 30(i+1)):

LOOP_i = K / (V + 30i) − K / (V + 30(i+1))

Mapped to Infinity ticks, this gives 100 single-sided LOOP positions at deploy, covering pool-BNB inflow up to 3,000 BNB. As buyers push BNB into the pool, bands cross one by one — each band's LOOP is converted to BNB at exactly the prices it was priced at.

bandBNB rangeLOOP allocation% of supply
00–30600,00060.00 %
130–60150,00015.00 %
260–9068,1816.82 %
390–12038,9613.90 %
tail bands shrink rapidly
29870–9007320.07 %
long tail to 3,000 BNB
992970–3000670.007 %

The 100-band design covers a price range of ~7,000× from launch to band 99 saturation — well beyond any realistic short/medium-term protocol life.

3.3 borrowing — bound band selection

When a user locks C LOOP as collateral, we lend BNB at a 40 % loan-to-value:

debt = collateralValue × 0.40

Liquidation triggers when collateral value falls to 1.5 × debt — i.e. spot price drops to 60 % of the borrow price. Solving for that price level on the curve gives the predicted liquidation pool BNB:

bnbLiq = √0.6 × (V + bnbBorrow) − V

The "bound band" is then floor(bnbLiq / 30). The hook draws the borrow's BNB from this specific band's LP. Since the band sits below current spot, removing BNB from it does not move the price — borrows are slippage-free.

3.4 dead zones & the shift

Sometimes the predicted bound band is the same band the spot price currently sits in (a "straddle"). Infinity's concentrated liquidity requires single-sided positions for BNB-only extraction, so a straddling band cannot supply pure BNB.

The hook resolves this with two mechanisms:

Bound-band shift. If the predicted band fully straddles or sits below current spot, the hook steps to the next band above spot (lower bandId, higher Infinity ticks) which is guaranteed BNB-only.
Straddle-borrow. If no band sits fully above spot (cold-start case where currentTick is inside band 0), the hook removes liquidity from the straddling band's position directly. Infinity returns both BNB (used for the loan) and a small amount of LOOP (kept by the hook as protocol surplus).

Together these guarantee every borrow can be served regardless of where the spot price is — no warmup period, no dead zones.

3.5 self-healing liquidation

When a position becomes underwater (collateral value < 1.5 × debt), anyone can call liquidate() for a small bounty. The hook:

Sells the collateral via a normal Infinity swap, receiving BNB proceeds.
Pays the liquidator a bounty of min(1 % × debt, 0.01 BNB) — the hard cap prevents disproportionate payouts on large positions.
Refills the remainder back into the bound band as fresh BNB-only LP — the band we originally lent from becomes deeper than before. No LOOP burn.
The pool gets stronger every time a position liquidates. That's self-healing.

If the spot has moved so far during the liquidation swap that the original band is no longer above spot, the refill falls back to the closest other band that is above. If even that fails, the surplus goes to the FeeCollector as protocol revenue. BNB never sits unaccounted in the hook.

04a complete cycle

Concretely, here is what happens when a user borrows then later gets liquidated:

1
borrowAlice locks 30,000 LOOP. Pool BNB is 80, spot is ~0.0011 BNB/LOOP. Collateral value: 33 BNB. Debt issued: 13.2 BNB (40 % LTV). Origination fee: 0.13 BNB → FeeCollector. Net to Alice: 13.07 BNB.
2
bound bandPredicted bnbLiq = √0.6 × 100 − 20 = 57.5. Bound band = floor(57.5 / 30) = 1. The hook removes BNB-only LP equivalent to 13.2 BNB from band 1's Infinity position. Spot price does not move.
3
price dropsOther users sell LOOP. Pool BNB falls 80 → 55. New spot ~0.00064 BNB/LOOP. Alice's collateral now worth 19.2 BNB. Coverage = 19.2 / 13.2 = 1.45× — UNDERWATER (need ≥ 1.5×).
4
liquidateBot calls liquidate(alice, 1). Hook sells Alice's 30,000 LOOP via Infinity swap, receiving ~17 BNB. Pays bot 0.01 BNB bounty (capped). Refill: 16.99 BNB → back into band 1 as BNB-only LP.
5
outcomeAlice's debt is cleared. Alice loses her 30k LOOP collateral. Bot earns 0.01 BNB. Band 1 holds MORE BNB-side LP than before Alice's borrow. Protocol depth strengthens.

05honest limits

Things to know:

Each band caps at 30 BNB borrow. A single position cannot borrow more than that from one band. Larger loans split across bands.
Same-block lockoutblocks borrow / liquidate in the same block as a swap, defeating one-block oracle manipulation. Multi-block manipulation is bounded by the LDF cap structure but not impossible — pump-and-borrow simulations show negative attacker P&L (origination fee + slippage cost the attacker more than they extract). A TWAP oracle would harden this further.
No cascade liquidation. Because borrows draw from a band below spot and don't move spot, no one position's liquidation can drag others underwater.
Fixed parameters, no governance. LTV (40 %), liq threshold (150 %), bounty (1 % capped at 0.01 BNB), LDF band count (30) are all set at deploy. No proxy, no upgrade.

06parameters

parametervaluerationale
LOOP supply1,000,000fixed at deploy, no mint/burn
Virtual BNB (V)20 BNBphantom reserve to seed the curve
LDF bands30 × 30 BNBcovers 0–900 BNB cumulative inflow
LTV40 %debt = 0.40 × collateralValue
Origination fee1 % of debt→ FeeCollector at borrow time
Liq threshold150 %underwater when collateralValue < 1.5 × debt
Liq bounty1 % × debt, max 0.01 BNBper-call cap, prevents whale subsidies
Repay cooldown2 blockspost-borrow lockout
Min collateral0.1 BNB valuefloor to prevent dust

07references

PancakeSwap Infinity core — concentrated-liquidity AMM with hook callbacks.
DeFiLlama · PancakeSwap — live TVL across V2 / V3 / Infinity.
PancakeSwap Infinity whitepaper — hook architecture and singleton design.
lo0p dashboard — live curve, depth chart, execute panel.
next

Open the dashboard to see live curve depth, place trades, and manage open positions.

← open dashboard