-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from primitivefinance/documentation
Documentation
- Loading branch information
Showing
16 changed files
with
346 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ docs/ | |
.env | ||
*.lock | ||
|
||
analysis/counter/* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
# arbiter-template | ||
# Arbiter Template | ||
|
||
Minimal template for simulating contracts with arbiter. | ||
Minimal template for simulating contracts with arbiter. This template is used by the `arbiter init` command when starting new simulations. This template provides a framework for performantly simulating Agent Based Models (ABM) with evm parity. In this model you can think of any things that happens as an action of an agent. Agents can own keys and externally owned accounts, they can interact with each other and they can interact with smart contracts. | ||
|
||
## Usage | ||
This repository has some example agents including a [`TokenAdmin`](src/agents/token_admin.rs), [`BlockAdmin`](src/agents/block_admin.rs), and [`CounterAgent`](src/agents/counter_agent.rs) which their own functionality and responsibilities. We also give an example of [how to parametarize your simulations](src/settings/mod.rs) with a configuration file containing different price paths and price path parameters. These can be played with to see how the simulation changes. Furthermore we provide an [api to batch simulations](src/simulations/mod.rs) and run them in parallel. This is useful for running many simulations with different parameters. | ||
|
||
1. Clone this repository | ||
### Prerequisites | ||
|
||
``` | ||
git clone https://github.com/primitivefinance/arbiter-template.git | ||
cd arbiter-template | ||
``` | ||
- Rust programming language and Cargo package manager (latest stable version recommended) | ||
- [Foundry](https://book.getfoundry.sh/getting-started/installation) is used behind the scenes to generate rust contract bindings. Make sure you have forge installed and up to date. | ||
|
||
2. Install foundry | ||
## Usage | ||
1. Install arbiter | ||
|
||
``` | ||
curl -L https://foundry.paradigm.xyz | bash | ||
foundryup | ||
``` bash | ||
cargo install arbiter | ||
``` | ||
|
||
3. Install forge libraries | ||
2. Create arbiter project from this template | ||
|
||
``` | ||
forge install | ||
``` bash | ||
arbiter init <name_of_project> | ||
``` | ||
|
||
4. Generate bindings | ||
|
||
``` | ||
forge bind --revert-strings debug -b src/bindings/ --module --overwrite | ||
3. Run the project | ||
```bash | ||
cargo run simulate src/config/counter.toml | ||
``` | ||
|
||
5. Run the project | ||
## Documentation | ||
|
||
``` | ||
cargo run | ||
``` | ||
The documentation for the repository is primarily inline with the code. Cargo automatically can compile these into a browsable format. To view the documentation run the following command: | ||
|
||
```bash | ||
cargo doc --open | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.