Skip to main content
Version: Next

Strategies

Strategies are very tightly connected to Agents. Each agent can get assigned a strategy but its optional.

Agents have a tight relationship with strategies. Strategies can be used to define the behavior of an agent. Specific implementations on how to deal with the behavior defined in a strategy should be implemented inside the agent itself. (for more info what the exact differentiating factors are reach out to the product team)

Models

The main power of a strategy is models, it allows you to use a machine learning model to make more advanced decisions. Learn more about how models work in the simulator and how to configure them here.

Configuration

Strategies are configured mainly through its own almanak-library.yaml. It doesn't require many options:

name: "Trend Following"
type: "strategy"
version: "1.0.0"
author: "Almanak AG"
description: "Trend Following strategy"
license: "MIT"

settings:
example_setting: "example_value"

models:
- alias: "trading_prediction"
source: "wandb://almanak/model-registry/Uniswap_Trader_Trend-Following:latest"
- alias: "bancor_lp_action"
source: "wandb://almanak/uncategorized/action_user.onnx:latest"

supported_chains:
- engine: 'evm'
chainId: '1'
dependencies:
protocols:
- "library://almanak/protocols/aave-v3:1.0.0"
- engine: 'evm'
chainId: '2'
dependencies:
protocols:
- "library://almanak/protocols/aave-v3:1.0.0"
settings:
uniswap_v3_usdc_pool: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"

There are quite a few things that you can add here. One of the big ones is the latest option supported_chains, which is simply an array of objects that you can use to configure dependencies and only allow the agent to work on certain chains because it has unique features to them.

  • engine is the Chain Engine as configured for the environment.
  • chainId is the chain id as configured for the environment.
  • dependencies allow you to set certain dependencies on an environment level, these have to be library items.
  • settings are like any other settings but can overwrite them on an environment level. Useful for contract addresses that are different per chain

There are also settings on a top level. They work the same as the settings at the environment level, the environment level will overwrite the top level!

And models which have to be configured here to be made available in the simulator. Read more about models here.