How are costs modeled?
Every fill pays two costs. The pool fee. And price impact.
The fee comes from the deepest main pool. Pool fees are in parts per million. We divide by one million. A v4 pool with a dynamic fee uses the default 0.003.
Impact grows with order size. Depth D is the pool value. Half of it sits on each side.
impact = x / (D / 2)buy price = chain price × (1 + impact)sell proceeds = notional × (D / 2) / (D / 2 + notional)round trip % = 100 × (2 × fee + impact_in + impact_out)x is the order in USD. The sell side is exit-bounded. It asks what the whole lot sells for now.
| Cost | Where it shows |
|---|---|
| Fee | feeUsd on each trade |
| Impact | impactUsd on each trade |
| Both | netUsd after costs |
Sample
Section titled “Sample”Depth is $100,000. The order is $500. Impact is 1% each way. The fee is 0.3%. The round trip is 2.6%.