fractal.core package
Subpackages
- fractal.core.base package
- fractal.core.entities package
- Subpackages
- Submodules
- fractal.core.entities.aave module
- fractal.core.entities.gmx_v2 module
- fractal.core.entities.hedge module
- fractal.core.entities.lending module
- fractal.core.entities.pool module
- fractal.core.entities.spot module
- fractal.core.entities.steth module
- fractal.core.entities.uniswap_v2_lp module
UniswapV2LPConfig
UniswapV2LPEntity
UniswapV2LPGlobalState
UniswapV2LPInternalState
UniswapV2LPInternalState.token0_amount
UniswapV2LPInternalState.token1_amount
UniswapV2LPInternalState.price_init
UniswapV2LPInternalState.liquidity
UniswapV2LPInternalState.cash
UniswapV2LPInternalState.cash
UniswapV2LPInternalState.liquidity
UniswapV2LPInternalState.price_init
UniswapV2LPInternalState.token0_amount
UniswapV2LPInternalState.token1_amount
- fractal.core.entities.uniswap_v3_lp module
UniswapV3LPConfig
UniswapV3LPEntity
UniswapV3LPEntity.action_close_position()
UniswapV3LPEntity.action_deposit()
UniswapV3LPEntity.action_open_position()
UniswapV3LPEntity.action_withdraw()
UniswapV3LPEntity.balance
UniswapV3LPEntity.calculate_fees()
UniswapV3LPEntity.calculate_position()
UniswapV3LPEntity.calculate_position_from_notional()
UniswapV3LPEntity.get_desired_token0_amount()
UniswapV3LPEntity.price_to_tick()
UniswapV3LPEntity.tick_to_price()
UniswapV3LPEntity.update_state()
UniswapV3LPGlobalState
UniswapV3LPInternalState
UniswapV3LPInternalState.token0_amount
UniswapV3LPInternalState.token1_amount
UniswapV3LPInternalState.price_init
UniswapV3LPInternalState.price_lower
UniswapV3LPInternalState.price_upper
UniswapV3LPInternalState.liquidity
UniswapV3LPInternalState.cash
UniswapV3LPInternalState.cash
UniswapV3LPInternalState.liquidity
UniswapV3LPInternalState.price_init
UniswapV3LPInternalState.price_lower
UniswapV3LPInternalState.price_upper
UniswapV3LPInternalState.token0_amount
UniswapV3LPInternalState.token1_amount
- fractal.core.entities.uniswap_v3_spot module
- Module contents
AaveEntity
AaveGlobalState
BaseHedgeEntity
BaseLendingEntity
BasePoolEntity
BaseSpotEntity
GMXV2Entity
GMXV2GlobalState
GMXV2Position
StakedETHEntity
StakedETHGlobalState
UniswapV2LPConfig
UniswapV2LPEntity
UniswapV2LPGlobalState
UniswapV3LPConfig
UniswapV3LPEntity
UniswapV3LPEntity.action_close_position()
UniswapV3LPEntity.action_deposit()
UniswapV3LPEntity.action_open_position()
UniswapV3LPEntity.action_withdraw()
UniswapV3LPEntity.balance
UniswapV3LPEntity.calculate_fees()
UniswapV3LPEntity.calculate_position()
UniswapV3LPEntity.calculate_position_from_notional()
UniswapV3LPEntity.get_desired_token0_amount()
UniswapV3LPEntity.price_to_tick()
UniswapV3LPEntity.tick_to_price()
UniswapV3LPEntity.update_state()
UniswapV3LPGlobalState
UniswapV3SpotEntity
UniswapV3SpotGlobalState
Submodules
fractal.core.launcher module
- class fractal.core.launcher.Launcher(strategy_type: Type[BaseStrategy], params: BaseStrategyParams)[source]
Bases:
object
Launcher is used to run strategies with different scenarios: - Single trajectory - Multiple trajectories - Scenario (multiple fractals in sliding window across the observations)
- property last_created_instance: BaseStrategy | None
- run_multiple_trajectories(observations: List[List[Observation]], debug: bool = False) List[StrategyResult] [source]
Run the fractal for multiple trajectories. For simulation, we run the fractal for multiple Monte Carlo simulated trajectories.
- Parameters:
observations – List of trajectories, where each trajectory is a list of observations.
- Returns:
List of fractal results for each trajectory.
- run_scenario(observations: List[Observation], window_size: int = 720, step_size: int = 24, debug: bool = False) List[StrategyResult] [source]
Run the scenario (multiple fractals in sliding window across the observations).
- run_strategy(observations: List[Observation], debug: bool = False) StrategyResult [source]
Run strategy for a single trajectory.
- strategy_instance() BaseStrategy [source]
Get the copy of the strategy to avoid storing outdated states.