Talos Launch App

03 · Build

The hub

The one contract a stacked pool calls. It forwards each callback to your hooks.

TalosHook is the hook address stored on the pool. The other contracts are modules. The pool never calls them directly.

How a swap moves

The PoolManager calls the hub. The hub looks at the list you registered and calls only the callbacks each module turned on. Before the swap, it collects fee overrides and keeps the highest one. After the swap, modules that need tokens call pull on the hub. The hub takes those tokens and returns the sum as its after-swap delta, so the pool's books balance against the hub, which is the address the pool actually called.

The rules that always hold

Writing a new hook

Extend LaunchHook, or implement IMarketModule and pull tokens through the hub instead of calling the PoolManager yourself. Deploy the new contract at its own flag address. Call attachHub once from the deployer, then createLaunch with the hub on the pool key, then add it in createMarket. A new pool keeps this hub on key.hooks. A pool that already exists keeps the module list it launched with.