Loading page…
The work Counterbook builds on, and what it borrows from each.
Counterbook is built on open-source work and on ideas other teams published before it.
| Project | What Counterbook uses |
|---|---|
| Uniswap v4 | The PoolManager, hooks, dynamic fees, StateLibrary, LiquidityAmounts, the V4Quoter and HookMiner from v4-periphery. Mainnet uses Uniswap's own PoolManager deployment on HyperEVM. |
| OpenZeppelin uniswap-hooks | BaseHook, the audited base contract the Counterbook hook extends |
| hyper-evm-lib by Obsidian | The ICoreWriter and ICoreDepositWallet interfaces, and the reference for precompile layouts, CoreWriter encodings and the bridging pattern that CoreAgent and VaultLib mirror (bridgeToCore through 0x2222…2222 and the CoreDepositWallet, bridgeToEvm through send asset to the system address, and HYPE on HyperCore paying for non-HYPE transfers). The CoreWriter encoding tests are cross-checked against it. Counterbook's own readers are non-reverting rewrites for the swap path, and its exchange simulator for tests is its own, because CoreSimulatorLib does not model the CoreWriter delay or silent ALO rejection. |
| Hyperliquid | HyperEVM, HyperCore, the read precompiles and CoreWriter, as documented by Hyperliquid |
| Project | What came from it |
|---|---|
| Aven | The idea of a Uniswap v4 fee set from in-block HyperCore prices, and of charging the gap between the pool and the book. Counterbook's gap term follows Aven; the spread and inventory-skew terms and the spot BBO reference are additions. The off-chain fee verifier follows the same pattern. |
| Bunni v2 | Design reference for a Uniswap v4 hook that manages liquidity on behalf of a vault |
| lambda and coldcascade | Earlier CoreWriter inventory management, with perp hedges and IOC taker orders. Counterbook uses spot maker orders instead. |
| Avellaneda and Stoikov, "High-frequency trading in a limit order book" (2008) | The inventory-skew idea behind the fee's inventory term |
Built with Fumadocs, with KaTeX for formulas and Mermaid for diagrams.