strategy.strategies.dynamic_lp.models
datetime
Enum
Any
Dict
List
Optional
Tuple
UUID
BaseModel
confloat
conint
validator
Chain
Network
Protocol
InternalFlowStatus
PersistentStateBase
StrategyConfigBase
DataFormat
DataSource
Web3
State Objects
class State(Enum)
Enum representing the state of the strategy.
INITIALIZATION
CHECK_FOR_REBALANCE
CLOSE_POSITION
SWAP_ASSETS
OPEN_POSITION
COMPLETED
A "Cycle" is completed in between Checks for Rebalance
TEARDOWN
TERMINATED
The Strategy is terminated (manual intervention required)
SubState Objects
class SubState(Enum)
Enum representing the substates of some of the strategy states. A state machine within a state machine.
NO_SUBSTATE
INITIALIZATION_SWAP0
INITIALIZATION_SWAP1
INITIALIZATION_OPEN
TEARDOWN_CLOSE
TEARDOWN_SWAP0
TEARDOWN_SWAP1
TEARDOWN_UNWRAP
PersistentState Objects
class PersistentState(PersistentStateBase)
current_state
current_substate
current_flowstatus
current_actions
sadflow_counter
sadflow_actions
not_included_counter
position_id
last_close_amounts_total
last_close_amounts_fees
last_close_amounts_liquidity
last_open_amounts
last_open_bounds
last_open_unallocated_amounts
last_open_model_price
last_swap_amounts
initialize_token_amounts
teardown_close_amounts_total
teardown_swap_amounts
teardown_unwrap_target_amount
teardown_unwrap_amount
last_rebalance_time
initialized_time
Config Objects
class Config()
arbitrary_types_allowed
json_encoders
model_dump
def model_dump(**kwargs)
InitializationConfig Objects
class InitializationConfig(BaseModel)
initial_position_value_USD
Ensure the value is greater than 0
initial_funding_token
initial_token0_pool
initial_token1_pool
ModelConfig Objects
class ModelConfig(BaseModel)
method
params
data_source
data_format
model_dump
def model_dump(**kwargs)
StrategyConfig Objects
class StrategyConfig(StrategyConfigBase)
id
network
chain
protocol
wallet_address
max_sadflow_retries
max_not_included_retries
initiate_teardown
pause_strategy
granularity
time_window
volatility_factor
pool_address
rebalance_price_bounds
Position Ratio for rebalance trigger (1.0 = full position)
initialization
rebalance_frequency
Frequency to “force” a rebalance in granularity units
run_duration
Teardown the strategy after run_duration in granularity units
data_source
price_model
volatility_model
validate_ethereum_address
@validator(
"wallet_address",
"pool_address",
"initialization__initial_funding_token",
"initialization__initial_token0_pool",
"initialization__initial_token1_pool",
check_fields=False,
)
def validate_ethereum_address(cls, value)
model_dump
def model_dump(*args, **kwargs)