Recycling
MeshPoolV3 mirror mode keeps liquidity in Mesh. What a pool receives opens its reverse pool, which trades it back, with no withdrawal and no new deposit.
Most order books pay a filled order out to the maker's wallet, and that liquidity is gone until the maker comes back. Recycling keeps it working: a filled pool's proceeds become a new pool on the other side of the market, automatically, inside the same fill transaction.
Mirror mode
A MeshPoolV3 pool in mode 2 (mirror) sends what it receives to its mirror pool. The mirror pool:
- holds what was received;
- accepts what this pool holds;
- quotes the reverse price you chose (
rNum / rDen); - has the same owner and fee, also in mirror mode.
The covenant rebuilds the mirror's address from its own script. A fill can't send proceeds anywhere else, and no address is stored, so there is no hash cycle to break. The mirror of the mirror is the original pool, so capital flips back and forth:
BCH pool (buys pUSD at 3,217.5) ──trader sells pUSD──▶ pUSD lands in the mirror
▲ │
└──────trader buys pUSD (pays 3,282.5) ── BCH lands back ┘
Each round trip earns the gap between the two prices, plus the fee on both legs. The Recycling pair page walks through one with numbers (≈ +2.2% per round trip at ±1%).
Where it is used
| Template | Recycles |
|---|---|
| Recycling pair | yes: one pool and its mirror |
| Grid | yes: every rung is a recycling pair |
Custom pools (POST /api/v1/pools) |
any pool with mode: 2 and reverse prices, including token↔token |
| Fixed, spread, multi-pair, stable pair, ladders | no: proceeds go to your wallet (mode 0) |
Tracking
The server records both sides of every flip, so the history stays readable:
- the filled pool's
FILLevent carriesrecycledTo(the mirror's address); - the mirror's
DEPOSITevent carriesfrom.
Strategy totals include the mirror pools, so value, fees and P&L cover the whole loop.
Things to know
- Profit stays inside the pools until you withdraw (
dock). Strategy pages show it as pool value. - If the price leaves your range for good, the loop stops with all capital on one side. Rebalance re-centres it in one transaction.
- One base unit always stays in a token pool.
Keep proceeds in Mesh from the start
Spread and fixed strategies have a Proceeds choice:
- Spread with recycle (the app's default) puts both pools in mirror mode. The bid's mirror is the ask pool, and vice versa, so each side refills the other.
- Fixed with recycle takes a trade-back price: above your bid, or below your ask.
Recycle idle liquidity
Liquidity can still go idle after the fact:
- proceeds sitting in your wallet from wallet-mode pools;
- pools priced far from the market that never fill;
- ranges stuck on one side;
- dust.
My pools shows an idle banner with the reason for each item. Recycle reopens what you choose as recycling pairs around today's price, in one signature. The rules and the API are on the Recycle API page.