Skip to main content

Module pool

Module pool 

Source
Expand description

Message handler that maintains the Pool state stored in the global [Cache].

The handler is functionally equivalent to BookUpdater but for DeFi liquidity pools. Whenever a [PoolSwap] or [PoolLiquidityUpdate] is published on the message bus the handler looks up the corresponding Pool instance in the cache and applies the change in-place (for now we only update the ts_init timestamp so that consumers can tell the pool has been touched).

Structsยง

PoolCollectHandler
Handler for pool fee collect events that delegates to a PoolUpdater.
PoolFlashHandler
Handler for pool flash events that delegates to a PoolUpdater.
PoolLiquidityHandler
Handler for pool liquidity update events that delegates to a PoolUpdater.
PoolSwapHandler
Handler for pool swap events that delegates to a PoolUpdater.
PoolUpdater
Handles [PoolSwap]s and [PoolLiquidityUpdate]s for a single AMM pool.