# Incorrect validation during checking liquidity spread

Panoptic's liquidity spread check skips validation when NetLiquidity is zero, letting option buyers mint long legs and burn them without paying premium.

- Payout: Audit contest
- Severity: medium
- Program: Panoptic
- Found by: KupiaSec
- Disclosed: 2024-06-24
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-04-panoptic-findings/issues/479
- Library page: https://bugbountylibrary.com/r/c4%3A2024-04-panoptic%3AM-04
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** PanopticPool / SemiFungiblePositionManager liquidity spread validation
**Root cause:** The liquidity spread check returns early when netLiquidity == 0 without reverting even if totalLiquidity > 0, so a long leg consuming all selling liquidity bypasses the TotalLiquidity/NetLiquidity <= 9 constraint.
**Steps:**
1. Mint a long leg of amount equal to total liquidity T so NetLiquidity N becomes zero, bypassing the spread check.
2. Observe s_grossPremiumLast stored at mint via _updateSettlementPostMint.
3. Burn the long leg; _updateSettlementPostBurn fetches accumulated premium but SFPM skips premium update when N is zero (SFPM:L1085-L1094).
4. No premium difference is owed, so buyer pays no premium.
**How found:** Code review of the liquidity spread check noticed the early return on netLiquidity == 0 ignores the case where totalLiquidity is positive, then traced premium settlement paths in _updateSettlementPostMint/_updateSettlementPostBurn and SFPM to confirm premium is never charged.
**Exploitation:** Attacker mints a long leg sized to consume all selling liquidity, driving NetLiquidity to zero and skipping the spread validation; on burn, premium accounting is skipped because N==0, so the buyer avoids paying premium.
**Insight:** When auditing ratio/limit checks, look for early-return branches on a zero denominator that skip the constraint entirely; trace downstream accounting (here premium settlement) to see if the skipped state lets value escape.

