Peglo

Litepaper · v1 · November 2026

Peglo: liquidity
that never leaves

A stablecoin market where one wallet balance prices FX across eight coins every day and stands behind every coin when one breaks, without the coins ever leaving the wallet.

Abstract

Peglo is a market for stablecoins built on two strategy types over the same wallet balance. An FX range prices up to eight stablecoins on one concentrated sphere curve, with dollar coins at $1 and non-dollar coins such as EURC and BRZ at live FX rates. A peg backstop stays dormant until an oracle halts a broken coin, then buys it at a discount that grows with size and is independent of how a seller splits their trade. Liquidity providers never deposit: on Solana a strategy approves the Peglo program as an SPL token delegate, and on Base it is a 1inch Aqua allowance. This paper gives the pricing math, the safety checks every swap passes, the depeg policy and the implementation that is live on Solana mainnet.

1. Introduction

Stablecoins in wallets and treasuries mostly earn nothing. Earning swap fees means locking them in a pool, and pools fail their LPs in the one moment that matters: when a coin depegs, arbitrageurs sell the broken coin into the pool and withdraw the healthy ones. LPs end the day holding the broken coin, and the market loses its liquidity when holders need it most.

Peglo separates two jobs that pools merge into one:

  • Everyday FX. Tight, cheap swaps between any two of eight stablecoins, across currencies.
  • Crisis liquidity. A standing buyer for a broken coin, at a price the LP chose in advance, that only trades after an independent oracle says the coin is broken.

Because neither job requires a deposit, the same dollars can do both. A backstop costs nothing to keep on calm days, because its coins earn FX fees in a range until they are needed.

2. Liquidity that stays in the wallet

Let a maker hold balances of coins in their own wallet. A strategy is a record of which coins it may use and its parameters. It never holds coins.

SolanaBase
PermissionSPL Approve to a per-maker program address1inch Aqua allowance (ship)
Strategy recordProgram account, 408 bytesSwapVM program, up to 219 bytes
On a fillTaker coin into maker account, payout from it as delegateAqua pulls input, pushes output
Ending itClose refunds rent, delegate revoked when unusedDock removes the allowance

Every swap reads the maker's live balance at the moment of the trade. Two strategies may cover the same coins; the first fill uses them and the other sees the smaller balance on its next quote. This is what lets one balance back a range and a backstop at the same time.

3. FX ranges: the sphere curve

3.1 Virtual balances

Each coin has an oracle price in USD and decimals. The range adds a virtual floor under every coin:

Pricing in USD value rather than raw units is what puts EURC and BRZ on the same curve as the dollar coins: a euro coin simply has .

3.2 The invariant

Following Paradigm's work on AMMs for many stablecoins, reserves live on a sphere of radius r:

Expanding with and gives a quadratic in r, and the radius follows in closed form:

The larger root is the right one: at the peg every , so , and the formula returns , the point where the sphere touches the equal-price line.

3.3 Concentration

If a maker opens with dollars of each coin, at the peg . Depth near the peg scales with , not with , so the capital efficiency of a range is:

PresetFloor mEfficiencyFee, dollar pairsFee, FX pairs
Tight300 D301x1 bp5 bps
Balanced60 D61x4 bps10 bps
Wide10 D11x10 bps30 bps

3.4 Exact-in swap

A taker sells of coin for coin . The fee is taken from the input and stays with the maker. The input coin's virtual balance rises, every other coin except j is unchanged, and the output coin falls back onto the sphere:

Two square roots and no iteration: one for the radius, one for the output. The final unit is rounded down in the maker's favour.

3.5 Marginal price

Differentiating the invariant along the sphere gives the price of i in units of j:

At the peg the first factor is 1 and coins trade at their oracle ratio. As a coin piles up, shrinks and the range pays less for more of it.

3.6 Checks every swap passes

  • LP never loses value. The radius is recomputed from the balances after the swap and the swap fails unless . Fees and rounding make grow.
  • Range edge. If and the input coin is now the heaviest, the swap fails. A range stops buying a falling coin instead of absorbing all of it.
  • Exposure cap. No coin may exceed a share of the range, , with by default.
  • Real balance. The output can never exceed what the maker's wallet actually holds and has delegated.
  • Oracle state. A halted coin is refused as input, and an FX coin whose price is older than the oracle's maximum age pauses.

3.7 Worked example

A Tight range with $1,000,000 of each of 8 dollar coins, computed directly from the formulas above, compared with a constant-product pool holding the same $1,000,000 on each side:

TradeTight range, outputTight range, costx · y = k, cost
$10,0009,998.391.6 bpsabout 99 bps
$100,00099,929.307.1 bpsabout 910 bps
$1,000,000993,863.2661 bpsabout 5,000 bps

Measured live on Base Sepolia with deeper test liquidity, $10,000 USDC to DAI cost 1.12 bps and $10,000 USDC to EURC cost 5.12 bps, of which 5 bps is the FX fee.

4. Peg backstops

A backstop pledges healthy coins, a cap per coin it will buy, and a discount schedule from to . Until the oracle halts a coin, every quote fails with .

4.1 Price

With already absorbed and a seller offering (both in face value), the discount and payout are:

The trade fails if . It pays only in coins that are not halted, and the means a backstop never pays above face value even if a market feed says otherwise.

4.2 Splitting does not help

The discount is the average of a linear schedule over the interval . For two sales then , with :

The total discount is the same as one sale of . Sellers cannot game the schedule by slicing, the first dollar sold gets the best price, and no single trade can drain a backstop past its cap.

PresetDiscount d0 to d1Average if fully used
Light1% to 5%3%
Standard2% to 10%6%
Deep5% to 25%15%

While a coin is halted, every FX range refuses it as input. Healthy pairs keep trading. The only buyers of the broken coin are backstops, at prices their makers chose before the crisis.

5. Prices and the depeg policy

The oracle stores, per coin, a price, the time it was observed and a halted flag. FX prices and depeg prices are used only while fresh, , with = 15 minutes on Solana mainnet. Dollar coins price at $1 and need no update.

A reporter (Chainlink CRE on Base, the Peglo sentinel on Solana) reads several independent sources and applies one policy. Let be the smallest deviation from peg across the offchain APIs (so every API must agree) and the deviation of the market feed:

The gap between 300 bps to halt and 25 bps to resume prevents flapping, and requiring every source for a resume means one lagging API cannot lift a halt. FX rates are pushed on a 2 bp move or every 10 minutes. Sources on Solana: Pyth price accounts, ECB rates through Frankfurter, open.er-api, CoinGecko and DefiLlama.

6. Implementation

Solana

  • Native program in Rust with Pinocchio, 52 KB, no Anchor and no allocator, so deploying cost about 0.275 SOL.
  • All math in u128 with prices scaled by 10^9. Square roots are floor Newton iterations, and every rounding step favours the maker.
  • The amount received is measured after the transfer in, so a Token-2022 transfer fee is never counted as income. PYUSD and USDG are Token-2022 coins.
  • A swap pays from a maker only through that maker’s delegate address and only up to the delegated amount.
  • 600 generated cases (up to 8 coins, 4, 6 and 9 decimals, ranges and backstops) give the same output or the same error in Rust and in the TypeScript SDK.

Base

  • Two new 1inch SwapVM instructions: PegloTick (opcode 34) for ranges and PegloBackstop (opcode 35).
  • Both also run on 1inch’s official AquaSwapVMRouter through its Extruction opcode, with no 1inch contract modified.
  • An 8-coin range config packs into 219 bytes, under SwapVM’s 255-byte argument limit.
  • A Chainlink CRE workflow in Go reports rates and halts with consensus across nodes.

Routing

The SDK splits a trade into 64 slices and gives each slice to the strategy with the best marginal price across every maker, halving slices near a range edge. The result is one transaction, and the quoted amount equals the received amount exactly.

7. Economics

An LP earns from two sources over the same balance:

  • Range fees. 1 to 10 bps per dollar-pair trade and 5 to 30 bps per FX trade, compounding into the radius.
  • Backstop discount. Paid only in a depeg. Example: a Standard backstop with a $100,000 cap buys a coin halted at $0.93. Fully used, it pays about per coin. If the coin recovers to $1, the backstop gains about 14%; if it never recovers, the LP holds the broken coin, capped at $100,000 of face value.

Today the protocol takes no fee. The planned model, after an audit, is a protocol share of LP fees and backstop discounts sent to a treasury, shown in every quote, so traders pay the same price and LPs keep the majority.

8. Risks and limits

  • The Solana program and the Base contracts have not been audited.
  • The oracle reporter and upgrade authority are single keys today; moving them to a multisig is planned.
  • If the reporter stops, FX prices expire and FX pairs pause. Dollar pairs keep trading at $1.
  • A backstop takes real depeg risk by design: if a halted coin never recovers, the LP keeps what it bought, up to its cap.
  • Pricing dollar coins at $1 relies on the halt policy catching a depeg; between a depeg and a halt, ranges still trade at $1 within their edge and exposure cap.

References