Giter Site home page Giter Site logo

smev's Introduction

sMEV

Warning: this code will not make you money. But by studying it you might learn how to capture MEV.

This repo contains a searcher developed to take advantage of a 1 off MEV opportunity created by the Synthetix team deprecating their ETH collateral trial program. As a result of this there were many loans that would be liquidatable after the governance proposal was executed. Taking advantage of this required a bot that could backrun the governance proposal execution transaction from the mempool as well as monitoring and execution infrastructure - all of which is contained here.

An accompanying blog post talking through the process of writing this bot and its strategy can be found here. This is highly recommended to understand the thought process and design decisions behind this repo.

Structure

The repo is structured as follows

  • contracts: contains the oracle contract (sAssetsOracle.sol) used to improve data collection and the execution contract(dYdXLiquidator.sol) used to liquidate loans
  • data: structured data from monitoring scripts, most importantly information on the optimal liquidation strategy
  • execute: actual execution scripts, best to start with index.js here. Also contains the sETH and sUSD monitoring scripts.
  • hardhat: my test environment. This is messy and I didn't clean my many files up. Note that you need to add your own rpc endpoint (Alchemy is good here) in hardhat.config.js.

To run index.js you must have an .env file with the right variables, but again, this code was for a 1 off opportunity and should be used exclusively for learning purposes.

smev's People

Contributors

bertmiller avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.