Alexangelj / arbiter

Code that runs code that runs code to study how code runs code.

Home Page:https://www.primitive.xyz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

arbiter

Expanding the EVM tooling ecosystem.

Github Actions codecov Twitter Badge

The Ethereum blockchain's execution environment, the Ethereum Virtual machine (EVM), contains a rich collection of decentralized applications. The EVM is stack machine that sequentially executes opcodes sent to it by users and smart contracts. Arbiter is a highly configurable rust interface over revm which is a Rust implementation of the EVM stack machine logic. The purpose of Arbiter is to interface with arbitrary agents and contracts and run this all directly on a blazing-fast simulated EVM.

Financial engineers need to study a wide array of complex portfolio management strategies against thousands of market conditions, contract parameters, and agents. To configure such a rich simulation environment on a test network could be possible, but a more efficient choice for getting the most robust, yet quick, simulations would bypass any local networking and use a low level language's implementation of the EVM.

Arbiter is being primarily developed to be a tool in evaluating economic and game theoretic security of DeFi applications.

Arbiter can be used for:

  • Evaluating the game theoretic and composable security of smart contracts in production environments (security firms and academics)
  • investigating risk, capital efficiency, rebalancing strategies, and portfolio replication (or performance). (LPs, funds, quants, traders)
  • Engineering and testing new financial products built on top of more primitive financial products (DeFi firms and academics)

Features:

For our next beta release, we will be focusing on the following features:

Build From Source

First, clone the repository to your local environment so

git clone https://github.com/primitivefinance/arbiter.git
cd arbiter

Install arbiter on your system:

cargo install --path . --force

With the arbiter binary generated, you can run commands such as:

arbiter simulate uniswap

Generating Docs

To see the documentation for Arbiter, after cloning the repo, you can run:

cargo doc --workspace --no-deps --open

This will generate and open the docs in your browser. From there, you can look at the documentation for each crate in the Arbiter workspace.

Including More Contracts

In the contracts/ directory you can add additional smart contracts or regenerate Rust bindings. Once that is done, you will want to make sure the bindings are generated in the script:

./bind.sh

You will need to add the relevant directory for your new contracts to the script above and make sure they are also handled by forge install. We look forward to improving upon this UX in the future.

At the moment, this only builds the bindings for the contracts in the lib/arbmod/contracts/ and lib/portfolio/contracts. You can of course add an additional directory of contracts in lib/. Just be sure to include it when you generate bindings!

Contributing

See our Contributing Guidelines

About

Code that runs code that runs code to study how code runs code.

https://www.primitive.xyz/

License:Apache License 2.0


Languages

Language:Rust 100.0%