UniswapV2PoolValuationMethodV0#
API documentation for tradeexecutor.ethereum.uniswap_v2.uniswap_v2_valuation_v0.UniswapV2PoolValuationMethodV0 Python class in Trading Strategy framework.
- class UniswapV2PoolValuationMethodV0[source]#
Bases:
ValuationModel
Legacy valuation methdd.
- __init__(uniswap)[source]#
- Parameters:
uniswap (UniswapV2Deployment) –
Methods
__init__
(uniswap)- __init__(uniswap)[source]#
- Parameters:
uniswap (UniswapV2Deployment) –
- __call__(ts, position)[source]#
Set the new position value and reference price for an asset.
The implementation must check if the position protocol is correct for this valuation model.
The implementation must update
valuation_updates
The implementation must set legacy
last_token_price
andlast_pricing_at
variables.
- Parameters:
ts (datetime) – When to revalue. Used in backesting. Live strategies may ignore.
position (TradingPosition) – Open position
- Returns:
(revaluation date, position net value) tuple. Note that revaluation date may differ from the wantead timestamp if there is no data available.
- Return type: