Automated DLMM Liquidity
Management on Sui
LeafSheep (CDPM) automatically manages your Cetus DLMM positions on Sui mainnet. Liquidity rebalances as price moves. Idle capital earns yield in Scallop and Kai SAV. 7 strategy families. Bring your own agent for zero protocol fees.
How It Works
LeafSheep wraps a Cetus DLMM position inside an on-chain Position Manager (PM) object on Sui mainnet and delegates management to a strategy worker. The worker polls each pool's active price bin every 3 seconds and, when the bin moves, builds a Sui Programmable Transaction Block (PTB) that:
- Removes liquidity from out-of-range bins
- Redeploys it around the new active bin according to the strategy shape
- Supplies any excess idle coins to Scallop or Kai SAV for lending yield
- Redeems from lending when capital is needed for a rebalance
All four steps happen atomically in one Sui transaction — there is no separate lending transaction. Your wallet never needs to be online; the worker signs with a dedicated protocol keypair, and your wallet retains full ownership (withdraw rights) at all times.
Key Features
Auto-Rebalancing
Liquidity reshapes continuously as the active Cetus DLMM bin moves — no manual intervention needed.
Idle Capital Earns Yield
Out-of-range coins are automatically supplied to Scallop or Kai SAV lending protocols. Redeemed on demand.
7 Strategy Families
BID-ASK, ONLY-BID, ONLY-ASK, ONE-SIDE-BID, ONE-SIDE-ASK, CURVE, SPOT — each maps a market thesis to a bin shape.
Zero Protocol Fees
Bring your own agent (any Sui address) and the 20% managed-service fee is waived entirely at the contract level.
Open Agent Model
Any Sui address can be authorized as an agent — no permission required from LeafSheep. Third-party developers welcome.
Frozen Contract Logic
Core bytecode is permanently frozen under DEP_ONLY upgrade policy. Fee logic and PM invariants cannot change.
Atomic Transactions
Rebalancing and lending supply/redeem happen in the same Sui PTB. Either both succeed or neither does.
Formally Verified
5 Move specs formally verified: fee cap ≤50%, lending conservation, accumulation monotonicity, and more.
7 Strategy Families
Each strategy maps a distinct market thesis to a bin distribution shape. The interactive Strategy Playbook shows visual bin diagrams and price curve simulations for all 7.
V-shaped distribution for oscillating pairs. Earns fees from every swing and auto-rotates inventory when price flips direction.
Best for: Volatile pair with clear support / resistance range. Want fees from both up and down moves.
Bid-side ladder positioned below active price. When the dip fills bids, the worker redeploys captured base coin into an ask-shape for the rebound.
Best for: Pullback you believe will revert. Accumulate on the dip, profit on the bounce.
Ask-side ladder positioned above active price. When the rally fills asks, the worker redeploys captured quote into a bid-shape for the give-back.
Best for: Short-term pop you expect to mean-revert. Sell into strength, rebuy the dip.
Passive bid ladder — buy only at lower prices. No auto-sell. Worker collects filled base coin to PM balance once price crosses the zone midpoint.
Best for: Conviction long who only accumulates below current price and has no intention to sell.
Passive ask ladder — sell only at higher prices. No auto-rebuy. Worker collects filled quote coin to PM balance once price crosses the zone midpoint.
Best for: Profit-taker who only sheds inventory on the way up and has no intention to re-enter.
Triangular-peak distribution centred on the active bin. Maximises fee density right where swaps happen. Re-centres when active bin drifts.
Best for: Stable pairs (USDC/USDT, LSTs) or assets with a strong price magnet. Tight-range fee maximiser.
Uniform distribution across the configured bin range. Neutral, robust fee harvesting without a directional bias. Re-centres when active escapes the range.
Best for: No strong directional view. Want consistent fee collection on a pair you hold long-term.
Protocol Integrations
Cetus DLMM v2
The primary liquidity pool. LeafSheep manages positions inside Cetus DLMM bins on Sui mainnet. All swap fees accrue to position owners.
Scallop Lending
Pool-based lending protocol. Idle coins (USDC, SUI, DEEP, WAL, HAEDAL) are supplied as sCoin receipts and redeemed on demand.
Kai SAV
Vault-based yield aggregator. Additional lending avenue for supported tokens; returns YT receipt tokens.
Permission Model
Three tiers with no escalation path between them. Authorizing an agent simultaneously locks out the protocol worker and waives the managed-service fee at the contract level. Any Sui address can be an agent — no permission required from LeafSheep.
| Tier | Who | Rebalance | Withdraw | Protocol Fee |
|---|---|---|---|---|
| Owner | Your connected wallet | Yes | Yes | 0% |
| Agent | Any authorised Sui address | Yes | No | 0% |
| Protocol | LeafSheep worker (only when no agent is set) | Yes | No | 20% on earned yield |
Note: Agent delegation is one-way and permanent at the contract level. Once any agent has been authorized, the protocol worker never returns — even if all agents are later revoked.
Frequently Asked Questions
What is LeafSheep and what does it do?
LeafSheep is the consumer brand for CDPM (Cetus DLMM Position Manager), an automated liquidity management protocol on Sui mainnet. It takes custody of your Cetus DLMM positions and manages them on your behalf — rebalancing liquidity as the active price bin moves, and earning yield on idle capital through Scallop and Kai SAV lending protocols.
How does automated rebalancing work?
The strategy worker polls each Cetus DLMM pool's active bin every 3 seconds. When the active price bin moves, the worker evaluates the affected Position Managers, builds a Sui Programmable Transaction Block (PTB) that removes liquidity from out-of-range bins and adds it around the new active bin, then submits via gRPC. Scallop and Kai SAV supply/redeem are inlined in the same PTB for atomicity.
Does LeafSheep charge fees?
The built-in managed service (protocol worker) charges 20% on collected trading fees and lending interest. Authorizing your own agent via user_insert_agent waives this fee entirely and locks the protocol worker out. The 20% fee applies only to earnings — never to your principal deposit.
How do I use my own agent with LeafSheep?
Connect your wallet to the app, open your Position Manager, and use the Agent management panel to add any Sui address as an authorized agent. Alternatively, call user_insert_agent directly via the CDPM SDK. This permanently locks the protocol worker out and waives the 20% fee. Important: agent delegation is one-way — the protocol worker never returns even if all agents are later revoked.
What tokens and pools are supported?
LeafSheep supports whitelisted Cetus DLMM pools on Sui mainnet, including USDC/SUI, USDT/SUI, DEEP/SUI, WAL/SUI, HAEDAL/SUI, and other Cetus ecosystem pairs. Lending yield via Scallop is available for USDC, SUI, DEEP, WAL, and HAEDAL; Kai SAV covers additional tokens.
Is the contract upgradeable? Can the team change the fee?
The core contract bytecode is permanently frozen under UpgradePolicy::DEP_ONLY. Only dependency package pointers (Cetus DLMM, Scallop, Kai IDs) can ever be updated. The PM permission model, fee logic (fee cap ≤50%, formally verified), and lending conservation invariants cannot change post-deploy. The 20% managed-service fee is a parameter, but its cap is enforced by formally verified specs.
How does LeafSheep compare to manually managing a DLMM position?
Manual management requires monitoring prices around the clock and signing a rebalance transaction every time the active bin moves. LeafSheep automates this 24/7 and additionally earns yield on idle capital — something manual management leaves on the table. The worker handles up to 3 concurrent rebalances and retries transient failures automatically.
Can I build my own strategy agent on top of CDPM?
Yes. Any Sui address can be authorized as an agent. The cdpm-agent-sdk covers everything an agent can sign: add/remove liquidity, collect fees, supply/redeem from Scallop and Kai SAV. Third-party agents compete on live strategy performance with no permission required from LeafSheep.
Where can I learn about the different strategies?
The interactive Strategy Playbook at app.leafsheep.xyz/playbook shows visual bin-shape diagrams, simulated price curves, when-to-use guidance, worker notes, and risk descriptions for all 7 strategy families.
Where is the developer documentation?
The Skills page at app.leafsheep.xyz/skills hosts complete SDK documentation covering agent operations, lending integration (Scallop and Kai), bin math, fee accounting, and Sui client setup. There are also three invariants every integrator must know before signing anything — see the Skills README.
Technical Details
Contract Address
0x573584cc4698e82fd85f2b54e64ad4cd901c42b768f7628ec167bf2d24aa2aa7
Sui mainnet — DEP_ONLY upgrade policy
Frontend
React SPA on Cloudflare Pages. No backend API. All reads go via Sui GraphQL; writes are wallet-signed PTBs.
Workers
TypeScript / Bun processes on a private host with a self-hosted Sui full node. Submits PTBs via gRPC. Max 3 concurrent tasks.
Security
5 formally verified Move specs. AI-audited with 3 findings resolved. Formally proven fee cap ≤50%.