The vault
The hook is also an ERC20 vault (Oorka Vault Share, symbol oLP, 18 decimals). Its liquidity always sits at the seat holder’s range, in a single PoolManager position salted type(uint256).max.
The first deposit mints
MIN_SHARES = 1,000 shares to 0xdead to prevent share-price inflation attacks.
Takeover
The dethroned seat holder keeps 80% of their bond and stays in the competition as a challenger. They can try to win the seat back or exit and reclaim what’s left.
Deferred moves
Settlement is permissionless, so an attacker could push the price, callsettleEpoch() in the same block, and have the vault migrate into their sandwich. Oorka splits the two halves of a takeover:
- The seat always changes on time, because the score is computed at the epoch TWAP, which a push barely moves.
- The vault only moves at an honest price.
_syncVault()checks the deviation guard. If it fails, it emitsVaultMoveDeferredand returns; the next settlement or anycompound()call finishes the move.
Unmatched tokens
When the vault moves to a new range, the token ratio usually changes. Whatever doesn’t fit the new range stays inidle0 / idle1 inside the hook and counts toward the share price. compound() reinvests it as far as the range allows.