Class Implementations
Each of the classes that you can provide as inputs for the simulator have to
implement an Interface
. The main goal of this is to force a standardized class
that the simulator can easily parse and use to run simulations.
- Agent
AgentInterface
- Environment
EnvironmentInterface
- Strategy
StrategyInterface
- Protocols
- Dex
DexInterface
- Lending
LendingInterface
- Custom
CustomProtocolInterface
- Dex
- Metrics
- Agent
AgentMetricInterface
- Environment
EnvironmentMetricInterface
- Simulator
GlobalMetricInterface
- Agent
File names
File naming is very specific to what you're building. Here is an overview of which files you need to have available:
Agent, Environment, Strategy, Metrics
main.py
required (the main file from which the class is imported)almanak-library.yaml
required (an additional file that has be included for each class which provides the simulator with metadata and is required for using the library system)
Protocols
almanak-library.yaml
required (an additional file that has be included for each class which provides the simulator with metadata and is required for using the library system)- At least one of:
dex.py
optional (class that implements theDexInterface
)lending.py
optional (class that implements theLendingInterface
)custom.py
optional (class that implements theCustomProtocolInterface
)
Almanak Library file
The almanak-library.yaml
is a required file for every class item, regardless
if the item is actually uploaded to the library or just used directly in the
simulator.
The library system allows you to publish classes so others (or just you) can easily re-use it. Think of it as the NPM or PyPi for the Almanak Simulator.
To clarify; you don't need to use the library system. Its completely
optional, you can just code your classes locally and use file://
as the prefix
to the path of the directory in which the required files have been built (as
long as the directory is available in the same or child folders of the
configuration.yaml
).
It only makes sense to use the library system when you want to share your classes with others (either publicly or privately). If you don't plan on doing this, its recommended to just keep your files locally.
The almanak-library.yaml
file has a few standard parameters that are always
required. On top of that, there are class specific configurations. The following
items are always required:
name: "Super amazing environment"
version: "1.0.0"
type: "environment" # agent, strategy, protocol, metric
author: "Almanak AG"
description: ""
license: "MIT"
The specifics for each of the classes and how to add them to your configuration file correctly can be found in their respective documentation: