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.0.tar.gz (29.1 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.0-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fractal_defi-1.0.0.tar.gz
  • Upload date:
  • Size: 29.1 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.0.tar.gz
Algorithm Hash digest
SHA256 6bcca3af176e25524a248f41a7d87e2abf5d22b914a03a9bc62841e120252d12
MD5 378073e28283c8045a06b1bb2da848fc
BLAKE2b-256 476f1655adba25d20bc9121d775e5a00caf4a1f4cbae0ae02a10ffa351d1064a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fractal_defi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 44.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dfb09f71a57864494dd07854f40529364ec8cc17a93323095b61ecd9d69f1313
MD5 8f12e111a81e0a6cff133d6aef5730bc
BLAKE2b-256 ad43da8683d857ee7a0e288738c00c650d1365bf74e18e5de2b88c349a9d6ff1

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