Skip to main content

An ultimate DeFi research library for strategy development and fractaling.

Project description

Fractal

Fractal is an ultimate DeFi research library for strategy development and fractaling created by Logarithm Labs.

Docs

Technical docs.

How to install?

pip install fractal-defi

Quick start with ready-to-go strategies

Run MLFlow locally or self-hosted:

pip install mlflow
mlflow io

Than just import pre-built strategies and run the pipeline:

from typing import List

from sklearn.model_selection import ParameterGrid

from fractal.strategies import GMXV2UniswapV3Basis, BasisTradingStrategyHyperparams
from fractal.loaders import BinanceDayPriceLoader, LoaderType

from fractal.core.pipeline import DefaultPipeline, MLFlowConfig, ExperimentConfig
from fractal.core.base import Observation


# Load data and build observations
def build_observations() -> List[Observation]:
  ...


# Build a grid of parameters to search
def build_grid() -> ParameterGrid:
  ...


# Define MLFlow and Experiment configurations
mlflow_config: MLFlowConfig = MLFlowConfig(
    mlflow_uri='http://127.0.01:5000',
    experiment_name='my_strategy'
)
experiment_config: ExperimentConfig = ExperimentConfig(
    strategy=GMXV2UniswapV3Basis,
    backtest_observations=build_observations(),
    window_size=24,
    params_grid=build_grid(),
    debug=True
)
pipeline: DefaultPipeline = DefaultPipeline(
    experiment_config=experiment_config,
    mlflow_config=mlflow_config
)
pipeline.run()

See more detailes examples in /examples directory

Changelog

See our discord dev channel for updates.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fractal_defi-1.1.0.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fractal_defi-1.1.0-py3-none-any.whl (50.6 kB view details)

Uploaded Python 3

File details

Details for the file fractal_defi-1.1.0.tar.gz.

File metadata

  • Download URL: fractal_defi-1.1.0.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for fractal_defi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b6665ab6a1d7c2cf99f2dbf04c6b230c4824ac5c921fda2365b3e2b575efd10b
MD5 04234dae1c374102d9601b8f763143f4
BLAKE2b-256 88429cfb7d658247ee8d04c77d834f67e9373e857901a62f0bd8036afbf5f97d

See more details on using hashes here.

File details

Details for the file fractal_defi-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: fractal_defi-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 50.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for fractal_defi-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4ee7c78d1ad0aa7b4512995ea139840e4987ac7af3c87ead60bed1215d8cfec
MD5 7fff107e05af26cace1d8c9041e9e0d4
BLAKE2b-256 d50f6b12129e425fa61ed03077bd8d30a06542b3d55cf60a4925310e7d8778f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page