ONCHAINRead from the NonfungiblePositionManager and each pool directly. Uncollected fees come from a static collect call, which is the real figure rather than an estimate.
The guardrails, stated rather than assumed
Read from PancakeSwap’s own guide for building V3 trading agents and enforced on every execution. Where a rule is ours rather than theirs, it says so — attributing our own choices to their guide would misrepresent it.
Slippage bound, never zeroPancakeSwap guide
amountOutMinimum / amount*Min derived from an explicit tolerance · default 0.50% (Percent(50, 10_000))The guide requires minimums derived from a stated tolerance and never left at 0. A zero minimum is an instruction to accept any price, which is what a sandwich needs.Deadline of five minutes or lessPancakeSwap guide
deadline = now + 5 × 60 secondsThe guide’s recommended default. A transaction that can sit in the mempool indefinitely will eventually execute at a price nobody agreed to.Approvals scoped to the exact amountPancakeSwap guide
Permit2, approved for the amount being spent — never an infinite allowanceThe guide is explicit: allowance scoped to the amount, not infinite. An infinite approval outlives the transaction that needed it.Atomic multicallPancakeSwap guide
Multicall.encodeMulticall([...]) — decreaseLiquidity, collect and burn in one transactionThe guide calls this a safety property rather than a gas saving: a rebalance that removes liquidity and then collects must never half-execute.State re-read between transactionsPancakeSwap guide
waitForTransactionReceipt, then re-read slot0, liquidity and tickCurrent before mintingThe guide: do not reuse pre-removal numbers. Removal and mint are separate transactions, so the pool can move between them.Ticks snapped to the fee tier’s spacingPancakeSwap guide
nearestUsableTick(tick, spacing) · 0.01%→1, 0.05%→10, 0.25%→50, 1.00%→200A tick that is not a multiple of the pool’s spacing reverts. It is also the single most common agent failure we have measured, and MCS-REB-1 checks it.Per-run cap on value movedPancakeSwap guide
Enforced by the charter: a spend cap, an expiry, and an explicit contract allowlistThe guide asks for a per-run cap. Ours is the charter itself, so the cap is on chain and revocable rather than a constant inside the agent.Pool price sanity-checked before actingPancakeSwap guide
Pool price compared against an independent reference; the run is skipped if they divergeThe guide’s defence against acting on a manipulated pool. A price that only one source believes is not a price.Raw units for all contract mathsPancakeSwap guide
No display-scaled values; ERC-8056 UI multipliers are ignored in arithmeticThe guide warns that some BSC tokens carry on-chain UI multipliers. Doing maths in display units silently scales every amount.Token safelistMarque
Charter allowlist limits which contracts may be touched at allThe guide prescribes NO safelist and offers no honeypot filtering — we checked. This one is ours, and it is enforced by the charter’s contract allowlist rather than by a curated token list we would have to maintain and could get wrong.How “hours out of range” is measured
There is no public source for it on BSC. Pool state prunes after about 64 blocks, the official PancakeSwap V3 subgraph is roughly four months behind head, and public log queries reach back around 37 minutes. So we watch: a worker records each pool’s tick every two minutes, and the figure is measured from our own observations.
That means it starts when we start watching. A position we have only just seen shows how long we have been watching it, not a number we invented for the time before that. The method and the measurements behind it are in the Ledger methodology.