PriceImpact#
tradingstrategy.priceimpact.PriceImpact Python class in Trading Strategy framework.
- class PriceImpact[source]#
Bases:
object
How much price impact a potential trade would have.
Because how Uniswap v2 like DEXes operate, liquidity provider and protocol fees are included within the price impact calculations. Depending on the example these fees are not included in the calculations.
This PriceImpact data also includes separate liquidity provider and protocol fees, as for trading companies these fees might be tax deductible.
TODO: These fees are not yet confirmed with a live exchange.
- __init__(available_liquidity, price_impact, delivered, lp_fees_paid, protocol_fees_paid, cost_of_trade)#
Methods
__init__
(available_liquidity, price_impact, ...)Attributes
Liquidity that was used for the price impact calculation, as expressed US dollars of one sided liquidity, see
XYLiquidity
.How much % worse execution you get because due to in availability of the liquidity.
How much worth of tokens you actually get for trade amount, expressed as US dollar
How much LP fees are paid in this transaction
How much protocol fees are paid in this transaction
How much the trade cost you totally (trade amount - delivered) This includes LP fees paid, protocol fees paid and any loss because of limited liquidity.
- available_liquidity: float#
Liquidity that was used for the price impact calculation, as expressed US dollars of one sided liquidity, see
XYLiquidity
.
- price_impact: float#
How much % worse execution you get because due to in availability of the liquidity.
- delivered: float#
How much worth of tokens you actually get for trade amount, expressed as US dollar