GithubHelp home page GithubHelp logo

Comments (3)

hauzlife avatar hauzlife commented on July 21, 2024 1

"I'm not involved with this project at all, but My guess is that the -0,6 comes from the UniSwap and SushiSwap fees (0.3% each). So we want the profit spread to be more than 0.6%.

Jackson"

Maybe?

#1 (comment)

from uni-sushi-flashloaner.

xale76 avatar xale76 commented on July 21, 2024

I really don't understand this:

const spread = Math.abs((priceSushiswap / priceUniswap - 1) * 100) - 0.6;

  const shouldTrade = spread > (
    (shouldStartEth ? ETH_TRADE : DAI_TRADE)
     / Number(
       ethers.utils.formatEther(uniswapReserves[shouldStartEth ? 1 : 0]),
     ));
  1. spread is in percentage, right?
  2. why in shouldTrade formula, we divide ETH_TRADE for DAI reserves (if shouldStartEth is true) and we divide DAI_TRADE for ETH reserve elsewhere?

please help

from uni-sushi-flashloaner.

frankandrobot avatar frankandrobot commented on July 21, 2024

@xale76 had the same question as well.... not sure what the relationship between spread and the calculation. It seems that we should trade if the ratio of the ETH_TRADE (or DAI_TRADE) in to the reserve in uniswap is less than the spread. But then that spread comparison seems arbitrary.

  • so spread = ratio of price difference
  • should trade = ratio of price difference > ratio of ETH_TRADE / uniswap ETH reserve

yea, i guess i'm not seeing this connection.

from uni-sushi-flashloaner.

Related Issues (6)

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.