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,
    fractal_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.2.tar.gz (30.3 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.2-py3-none-any.whl (45.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fractal_defi-1.0.2.tar.gz
  • Upload date:
  • Size: 30.3 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.2.tar.gz
Algorithm Hash digest
SHA256 8854eadab8f4d70942381cd5ff649bd88480299fa673ff39b2fc610c71cfb579
MD5 41afe7020d153f59d27c277db8a122a1
BLAKE2b-256 7e43a69be5c6139986c36938cf650c259c1985516776f080e4bf7ce258ba14cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fractal_defi-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 45.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1cdd68b6c6552676da8dd7f395c65407712bfa737f3dfa075f892421acd3e641
MD5 879ac7d6e2e6ce8f9189a06c4806ab27
BLAKE2b-256 02f3cf2f0cdfacfc3ed4391238406c3583580a3c4ab7667b5341d75bdba4a06b

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