#strategies #bots #framework #mev #action #events #provider

strategy

A framework for writing MEV strategies and bots in Rust

2 releases

0.1.1 Sep 8, 2023
0.1.0 Sep 8, 2023

#5 in #mev

38 downloads per month

MIT license

7KB
87 lines

Strategy

Rust Rust

About

A framework for writing MEV strategies and bots in Rust

Install

Cargo.toml

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

Usage

strategy.rs


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

pub struct Sandwicher<M> {
    provider: Arc<M>
}


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

#[async_trait]
impl<M: Middleware + 'static> Strategy<Event, Action> for Sandwicher<M> {
    async fn process_event(&mut self, event: Event) -> Option<Action> {

        // Process incoming event/tx

        None
    }
}

Dependencies

~28–44MB
~817K SLoC