Getting Started

Supported Platforms

We currently support Linux(x86) and Mac(AppleSilicon).
You may be able to use Dojo in Windows using WSL, but we are not actively developing for it.

We aim to always support the latest version of Python. Currently we support 3.10+.


Licensing

Dojo requires a licensing key. To get started - contact us.


Prerequisites

There's a few more things you need to set up for Dojo. If you've done some coding in web3 before, chances are you're good to go already!

  1. RPC Node provider: setup an account with a provider, such as Infura, or use your own archive node. You'll need the ETHEREUM_RPC_URL environment variable (or ARBITRUM_RPC_URL for an arbitrum node) to the URL where it provides its API. e.g. https://mainnet.infura.io/v3/ac8ee<...>961
  2. A local ethereum development environment: we recently switched from hardhat to anvil. Check out the installation guide here.

Setup

Setting up Dojo shouldn't take more than 5 minutes:

1. Install Dojo

Dojo is provided as a Python package on PyPi. To install, simply run

Terminal
pip install dojo-compass

2. Install Anvil

Dojo requires Anvil as EVM. It is what's going to process the raw transactions on your local machine.
Installing it is simple. Just follow the instructions here.

3. Setup configuration

Create a .env file in your main directory, or export the environment variables:

.env
ETHEREUM_RPC_URL=<YOUR ETHEREUM URL>
ARBITRUM_RPC_URL=<YOUR ARBITRUM URL> # you only need to set the url corresponding to the chain(s) you're using
CHAIN=<ETHEREUM|ARBITRUM> # specify the chain you're using
LICENSE_KEY=<YOUR LICENSE KEY>

For ETHEREUM_RPC_URL, you'll need to provide an etherum archive node address. We recommend to setup an account with a provider, such as Infura and specify the ETHEREUM_RPC_URL it provides.
The archive node is only used to read the pool state at simulation start, but if you prefer, you can also setup your own node, of course.

4. Verify install

If everything is set up correctly, the following command should throw no errors.

Terminal
python -c "from dojo.environments import UniswapV3Env"

Congratulations! You've got everything working as expected.