A simple, modular, and fast framework for writing MEV bots in Rust.

Overview

CI status Telegram Chat

What is Artemis?

Artemis is a framework for writing MEV bots in Rust. It's designed to be simple, modular, and fast.

At its core, Artemis is architected as an event processing pipeline. The library is made up of three main components:

  1. Collectors: Collectors take in external events (such as pending txs, new blocks, marketplace orders, etc. ) and turn them into an internal event representation.
  2. Strategies: Strategies contain the core logic required for each MEV opportunity. They take in events as inputs, and compute whether any opportunities are available (for example, a strategy might listen to a stream of marketplace orders to see if there are any cross-exchange arbs). Strategies produce actions.
  3. Executors: Executors process actions, and are responsible for executing them in different domains (for example, submitting txs, posting off-chain orders, etc.).

Strategies

The following strategies have been implemented:

Build, Test and Run

First, make sure the following are installed:

  1. Anvil

In order to build, first clone the github repo:

git clone https://github.com/paradigmxyz/artemis
cd artemis

Next, run tests with cargo:

cargo test --all

In order to run the opensea sudoswap arbitrage strategy, you can run the following command:

cargo run -- --wss <INFURA_OR_ALCHEMY_KEY> --opensea-api-key <OPENSEA_API_KEY> --private-key <PRIVATE_KEY> --arb-contract-address <ARB_CONTRACT_ADDRESS> --bid-percentage <BID_PERCENTAGE>

where ARB_CONTRACT_ADDRESS is the address to which you deploy the arb contract.

Acknowledgements

Comments
  • Init functionality by adding a small CLI

    Init functionality by adding a small CLI

    Simple code generation that allows you to enter the following command

    cargo run --package cli -- --strategy-name {NAME}
    

    this will generate a new base strategy to make it easier to develop faster.

    the implementation could be a lot cleaner and I think this should be added into the base artemis command however I thought I would start a discussion on that within this thread because it may change a bit overtime. I am a big fan of how the forge library and cli is set up and we could migrate to something similar to allow for more cli additions

    opened by 0xfourzerofour 4
  • Add Seaport v5 contract as part of Seaport 1.5 release

    Add Seaport v5 contract as part of Seaport 1.5 release

    Description

    Add Seaport v1.5 Contract address as part of the Seaport 1.5 release. Without this fix, there is an error when sending the request with the Opensea API. The error is more specifically:

    INFO opensea_sudo_arb::strategy: Error getting order from opensea: error decoding response body: missing field protocol at line 1 column 57

    References

    Seaport 1.5 release: https://docs.opensea.io/changelog/seaport-1-5-release Seaport 1.5 contract address: 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC

    opened by JohnChangUK 2
  • Add Minimal Implementation of MEV-Share SSE Collector

    Add Minimal Implementation of MEV-Share SSE Collector

    Thought I'd get the ball rolling on this. Currently only added a collector following https://docs.flashbots.net/flashbots-mev-share/searchers/event-stream.

    I imagine eventually the MEV-Share implementation will have a complementary executor with shared types, so anyone reading feel free to steal this for yourself if doing that.

    Added a test as well but wasn't sure what it should test against, any ideas? Also, because MEV-Share has to send out an event before test completes, the test takes an indeterminate amount of time, sometimes ~5s waiting for a streamed event.

    Related #4

    opened by grayleonard 2
  • Added some more data fields for block collector

    Added some more data fields for block collector

    A PR for adding more data fields into the block creator. I think it would be beneficial if we had the base_fee_per_gas, the total gas, timestamp, and the extra_data of the block being collected.

    Open question: I've set the base fee to be 0 for blocks previous to London. Maybe there's a cleaner way to do this.

    P.S.: I'm new to rust and the library, so I wanted to draft a small PR as I learn and explore Artemis further.

    opened by mw2000 3
  • Why use `openssl` in docker image?

    Why use `openssl` in docker image?

    Is it possible to replace the use of openssl with rustls? If so, you should be able to change the runtime image to use distroless which would reduce the image size from 137MB to 16.5MB and increase the security of the image since you cannot shell into it or make it execute anything other than app logic.

    - FROM ubuntu:20.04 AS runtime
    + FROM gcr.io/distroless/static-debian11
    
    REPOSITORY                                     TAG             IMAGE ID       CREATED          SIZE
    artemis                                        distroless      f7648ddb5cfb   45 seconds ago   16.5MB
    artemis                                        latest          ffa038e5053e   34 minutes ago   137MB
    
    opened by 0xmichalis 0
  • Getting started guide

    Getting started guide

    Looked all around the repo for a getting started guide. Would be nice to have a guide.

    I'm keen to build a strategy that listens to pending txs in the mempool and does something (not yet sure, what). Is there a collector for to get all pending txs? Where can I find this?

    If a collector doesn't exist, I'm happy to contribute one with some pointers. Thank you.

    opened by pkpio 1
  • More of a feature descussion

    More of a feature descussion

    Firstly if like to say I am a big fan of the design of the project.

    I migrated one of my arbitrage searchers to use it over the weekend and only took about an hour.

    I had a couple thoughts on the project that may make thinks a little easier to use.

    1. Create an init script that allows you to create a repo with artimis core with a --strategy name to construct a bare strategy implementation.
    2. Upload some docs to docs.rs

    I am happy to create a PR and help out if you need!

    opened by 0xfourzerofour 2
  • Create a standardised representation of a protocol

    Create a standardised representation of a protocol

    Adding support for new protocols and maintaining support for protocol updates is a huge overhead for atomic teams. It would be great if we could collaborate publicly here to share the workload, as it's very high effort / low alpha.

    The collectors / strategies / executors is a great base for separating concerns, but to be really useful in a plug-and-play fashion the architecture should also separate the concerns of "protocols".

    Protocols should fit a common and extendable interface which is useful for a wide array of strategies. Implementation of new protocols should be test-driven both for accuracy of protocol interactions, and also for speed benchmarks. The idea is essentially to encapsulate the work of supporting new protocols which can then be dropped into strategies.

    This feels like a potentially huge win/win for searchers, provided multiple teams are willing to contribute.

    enhancement 
    opened by CodeForcer 3
Owner
Paradigm
A research-driven technology investment firm.
Paradigm
This repository contains a collection of aori bots utilising the artemis framework.

Aori Artemis Artemis is a framework for writing MEV bots in Rust. It's designed to be simple, modular, and fast. At its core, Artemis is architected a

aori 9 Nov 18, 2023
Ergonomic and modular web framework built with Tokio, Tower, and Hyper

axum axum is a web application framework that focuses on ergonomics and modularity. More information about this crate can be found in the crate docume

Tokio 7.9k Dec 31, 2022
The simplest build-time framework for writing web apps with html templates and typescript

Encoped A build-time fast af tool to write static apps with html and TypeScript Features Template-based ESLint, Prettier and Rollup integration No ext

null 1 Dec 11, 2021
Proof of concept writing a monolith BBS using Rust, GraphQL, WASM, and SQL. WILL BE ARCHIVED ONCE PROVEN

GraphQL Forum Important DO NOT even think about using this in production, lest your sanity be destroyed and credentials lost! Loosely following the aw

Rongcui Dong 25 Apr 25, 2023
A (flash) message framework for actix-web. A port to Rust of Django's message framework.

actix-web-flash-messages Flash messages for actix-web Web applications sometimes need to show a one-time notification to the user - e.g. an error mess

Luca Palmieri 31 Dec 29, 2022
Silkenweb - A library for writing reactive single page web apps

Silkenweb A library for building reactive single page web apps. Features Fine grained reactivity using signals to minimize DOM API calls No VDOM. Call

null 85 Dec 26, 2022
Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.

Actix 16.2k Jan 2, 2023
Thruster - An fast and intuitive rust web framework

A fast, middleware based, web framework written in Rust

null 913 Dec 27, 2022
Seed is a Rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

Seed is a Rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

null 3.6k Jan 6, 2023
Perseus is a blazingly fast frontend web development framework built in Rust with support for major rendering strategies

Perseus is a blazingly fast frontend web development framework built in Rust with support for major rendering strategies, reactivity without a virtual DOM, and extreme customizability

arctic_hen7 1.2k Jan 8, 2023
Super Fast & High Performance minimalist web framework for rust

Super Fast & High Performance minimalist web framework for rust

null 6 Oct 12, 2022
This is a simple Api template for Rust ( Axum framework )

Axum-Rust-Rest-Api-Template This project is an open source Rest Api Template built with Rust's Axum framework. Why this project? I have been learning

Thani 20 Jun 16, 2023
A rust web framework with safety and speed in mind.

darpi A web api framework with speed and safety in mind. One of the big goals is to catch all errors at compile time, if possible. The framework uses

null 32 Apr 11, 2022
A full-featured and easy-to-use web framework with the Rust programming language.

Poem Framework A program is like a poem, you cannot write a poem without writing it. --- Dijkstra A full-featured and easy-to-use web framework with t

Poem Web 2.2k Jan 6, 2023
A framework independent animation library for rust, works nicely with Iced and the others

anim A framework independent animation library for rust, works nicely with Iced and the others. Showcase How to install? Include anim in your Cargo.to

joylei 37 Nov 10, 2022
Implementation of the RealWorld backend API spec in Actix, Rust's powerful actor system and most fun web framework.

Actix codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API. ❗ (2021/05/13) This cod

Allen 475 Jan 2, 2023
Demo of Rust and axum web framework

Demo of Rust and axum web framework Demonstration of: Rust: programming language that focuses on reliability and stability. axum: web framework that f

Joel Parker Henderson 115 Dec 29, 2022
Hirola is an opinionated web framework for that is focused on simplicity and predictability.

Hirola Hirola is an opinionated web framework for that is focused on simplicity and predictability. Goals Keep it simple. Most Rust web frameworks hav

null 27 Nov 3, 2022
Starter template for use with the Leptos web framework and Axum.

Leptos Axum Starter Template This is a template for use with the Leptos web framework and the cargo-leptos tool using Axum. Creating your template rep

Leptos 10 Mar 4, 2023