Git Product home page Git Product logo

damms-filters's Introduction

damms-filters

Note: damms-filters has been migrated into amms and this repo has been archived.

A collection of filters to reduce invalid or poor quality AMMs on EVM chains.

Value Filters

Note: A good weth_value_in_token_to_weth_pool_threshold is a setting with a $USD value > $1000 at least. Lower than this, you are getting pools that could have poor liquidity and show inflated prices.

pub async fn filter_pools_below_weth_threshold<M: Middleware>(
    pools: Vec<Pool>,
    dexes: &[Dex],
    weth: H160,
    weth_value_in_pool_threshold: U256, // This is the threshold where we will filter out any pool with less value than this
    weth_value_in_token_to_weth_pool_threshold: U256, //This is the threshold where we will ignore any token price < threshold during batch calls
    middleware: Arc<M>,
) -> Result<Vec<Pool>, CFMMError<M>> {
// --snip--
}
pub async fn filter_pools_below_usd_threshold<M: Middleware>(
    pools: Vec<Pool>,
    dexes: &[Dex],
    usd_weth_pool: Pool, 
    usd_value_in_pool_threshold: f64, // This is the threshold where we will filter out any pool with less value than this
    weth: H160,
    weth_value_in_token_to_weth_pool_threshold: U256, //This is the threshold where we will ignore any token price < threshold during batch calls
    middleware: Arc<M>,
) -> Result<Vec<Pool>, CFMMError<M>> {
// --snip--
}

damms-filters's People

Contributors

0xkitsune avatar 0xosiris avatar

Stargazers

zachi.eth avatar  avatar Nooneoneno avatar  avatar  avatar  avatar  avatar Michael Demarais avatar  avatar  avatar

Watchers

Michael Demarais avatar  avatar

Forkers

rfk1118

damms-filters's Issues

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.