Giter Club home page Giter Club logo

Comments (8)

happysammy avatar happysammy commented on May 28, 2024 1

Ok, I managed to deploy my own node with 20ms in the US East region. I updated the code as well.

The bsc push NewBlockHead timestamp is seconds, how to measure the node delay using milliseconds? Like you say 20ms.

from uniswap-arbitrage-flash-swap.

happysammy avatar happysammy commented on May 28, 2024 1

you had better have another measuring about the time intervals between your NewBlockHead data's timestamp and the raw startfunction transaction is mined by validator nodes. Even if you optimize the execution time of check function < 10ms, there also are so much fails. If you look into this fail transaction, you'll find that the transaction block number often fall behind NewBlockHead data block number 1~3 blocks.

from uniswap-arbitrage-flash-swap.

Haehnchen avatar Haehnchen commented on May 28, 2024

simply use all all of them

  • for light client you can pick every vserver < 2 USD / EUR; latency ~500ms, there is no need for bigger hardware. its still the fastest as new blocks are getting here at first
  • quicknode, chainstack have lowest latency of execution < 100ms, but getting notified later for new blocks
  • region: german / usa for hosting

i am never running into "e00: out of block" every transaction only takes 1-2 blocks. you can higher the "block.number + 2", but normally its too late.

from uniswap-arbitrage-flash-swap.

Haehnchen avatar Haehnchen commented on May 28, 2024

.... and feel free to remove estimateGas and replace it with a fixed value. this line takes normally its time ;)

estimateGas = await tx.estimateGas({from: admin});

vs

let estimateGas = 519540;

from uniswap-arbitrage-flash-swap.

rodolfopatane avatar rodolfopatane commented on May 28, 2024

@Haehnchen you say "...you can higher the "block.number + 2", but normally its too late" in this code in file watcher.js at line 106 is "block.number + 2", you make modification out of this public repository? you can share? tks

from uniswap-arbitrage-flash-swap.

mindfulme avatar mindfulme commented on May 28, 2024

Ok, I managed to deploy my own node with 20ms in the US East region. I updated the code as well.

from uniswap-arbitrage-flash-swap.

mindfulme avatar mindfulme commented on May 28, 2024

NewBlockHead

we measure the request time, i.e. how long it takes to fetch data from your node.

from uniswap-arbitrage-flash-swap.

Haehnchen avatar Haehnchen commented on May 28, 2024

there are 2 parts of measuring

  • connect to multiple websocket providers listen for "NewBlockHead", you will notice some nodes are getting new blocks faster
  • then execute the checks

so basically the calculation would be "first knowledge of the new block" + "execution time"

from uniswap-arbitrage-flash-swap.

Related Issues (20)

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.