Skip to content

question: shouldTrade? #6

@frankandrobot

Description

@frankandrobot

Struggling to understand this comparison:

      const shouldTrade = spread > (
        (shouldStartEth ? ETH_TRADE : DAI_TRADE)
         / Number(
           ethers.utils.formatEther(uniswapReserves[shouldStartEth ? 1 : 0]),
         ));

It seems that we should trade when the ratio of the ETH_TRADE (or DAI_TRADE) in to the reserve in uniswap is less than the spread. That is,

  • spread = ratio of price difference
  • shouldTrade = ratio of price difference > ratio of ETH_TRADE / uniswap ETH reserve

Why is this comparison necessary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions