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.0.3.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.0.3-py3-none-any.whl (50.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fractal_defi-1.0.3.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.0.3.tar.gz
Algorithm Hash digest
SHA256 32f428e3f49a27802a854f2763666da4d00c5c88eec7ac170c927fe83863977a
MD5 07044d697e5aa89d5671eb1cc5eb76da
BLAKE2b-256 ce645db3c6077d243a40c8164073cd65c11d2213a04a44ecef344630a95fc3a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fractal_defi-1.0.3-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.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 86946a13f27cc55cdd95fd99ad1cd59d43967130b19f34cfa7fe1922d1e039b8
MD5 9f1ff44b293e480d5d605452ea983cd2
BLAKE2b-256 708476cfb049049d3709d03b542ecf474bedc08dc20281e90e7aad1c2cb8148b

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