An open API service indexing awesome lists of open source software.

https://github.com/dennohpeter/strategy

A framework for writing MEV strategies and bots in Rust
https://github.com/dennohpeter/strategy

blockchain ethereum mev strategy trading

Last synced: about 1 month ago
JSON representation

A framework for writing MEV strategies and bots in Rust

Awesome Lists containing this project

README

        

### Strategy

[![Rust](https://github.com/dennohpeter/strategy/actions/workflows/general.yml/badge.svg)](https://github.com/dennohpeter/strategy/actions/workflows/general.yml)
[![Rust](https://github.com/dennohpeter/strategy/actions/workflows/audit.yml/badge.svg)](https://github.com/dennohpeter/strategy/actions/workflows/audit.yml)
[![](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)
[![](https://img.shields.io/crates/v/strategy)](https://crates.io/crates/strategy)

### About

A framework for writing MEV strategies and bots in Rust

### Install

`Cargo.toml`

```toml
[dependencies]
strategy = { version = "0.1.1" }
```

### Usage

`strategy.rs`

```rust

use strategy::types::Strategy, Event, Action};

pub struct Sandwicher {
provider: Arc
}

impl Sandwicher {
pub fn new(provider: Arc) -> Self {
Self {
provider
}
}
}

#[async_trait]
impl Strategy for Sandwicher {
async fn process_event(&mut self, event: Event) -> Option {

// Process incoming event/tx

None
}
}
```