Omnipool
The Hydration Omnipool is a novel type of AMM which concentrates all liquidity in a single trading pool, thus unlocking an array of efficiencies. This doc contains a mathematical specification of the mechanics which power the Omnipool.
The Omnipool
Hub token
The Omnipool uses H2O as a "hub" token through which all trades are routed, avoiding the segmentation of liquidity inherent to AMMs which require LPs to provide liquidity for a pair of tokens. Both transaction fees and partial impermanent loss mitigation are paid out in H2O.
A note on notation
Throughout this page, we will refer to the change in some amount as . When is a pool variable (e.g. the quantity of some asset in the pool), we adopt the convention that is negative if the pool variable is decreasing (e.g. some amount of the asset is leaving the pool) and is positive if the pool variable is increasing (e.g. some amount of the asset is entering the pool). In particular, note that this means when we consider a swap of of one asset for of another asset, one of these will be negative.
A user variable meanwhile will have the sign convention that flows to the user are denoted by positive while flows away from the user are denoted by negative . In particular, for a token transfer to/from the pool for some token , we will have .
We will also adopt the notational convention that .
Swap Execution
In version 1, the prices behave as though each TKN1/H2O pool is a constant product CFMM, although other CFMMs continue to be under investigation.
Let be the quantity of H2O in the TKN1 pool and be the quantity of TKN1. Suppose a trader stipulates they wish to sell of TKN1 for TKN2. Then , so with asset fee and protocol/H2O fee , we have
The H2O or "protocol" fee is (which is positive since is negative) and the asset fee is