# Strategy main ticks are not symmetric when the tick spacing is one due to incorrect isLowerSided inequality

Yieldoor Strategy's isLowerSided check misplaces main position ticks when tick spacing is 1, making ranges asymmetric and losing fees.

- Payout: Audit contest
- Severity: medium
- Program: Yieldoor
- Found by: 000000
- Disclosed: 2025-02-21
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-02-yieldoor-judging/issues/94
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-02-yieldoor%3AM-3
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error

**Target:** Uniswap V3 LP strategy rebalancing logic
**Root cause:** isLowerSided uses `modulo < (tickSpacing / 2)`; with tickSpacing=1 this is always true, so tickBorder is always shifted up, producing asymmetric lower/upper ticks around the current tick.
**Steps:**
1. Fork Base at block 26874136 with WBTC/USDC pool 0x20E0...e7e
2. Call `rebalance()` as rebalancer
3. Read `getMainPosition()` and `pool.slot0()`
4. Observe tick=-1769 but ticks are -1770/-1766 instead of symmetric -1771/-1767
**How found:** Code review of `_setMainTicks` arithmetic; noticed modulo<0 normalization plus strict `<` comparison makes isLowerSided always true for tickSpacing=1, then confirmed via fork PoC.
**Insight:** When normalizing modulo for negative ticks, check boundary behavior at tickSpacing=1: strict inequalities against tickSpacing/2 collapse to a single branch, so verify symmetry of derived ranges across spacing values.

## Proof of concept (copied exactly from the original report)

**Foundry test asserting asymmetric main ticks**

```
function test_POC_WrongTicks_DueToIsLowerSide() public {
    skip(10 minutes);
    vm.startPrank(rebalancer);
    IStrategy(strategy).rebalance();

    IStrategy.Position memory mainPos = IStrategy(strategy).getMainPosition();
    (, int24 tick,,,,,) = pool.slot0();
    //@audit position is not symmetric, harming long term fees
    assertEq(tick, -1769);
    assertEq(mainPos.tickLower, -1770);
    assertEq(mainPos.tickUpper, -1766);
}
```

