GithubHelp home page GithubHelp logo

od-relayer's People

Contributors

daopunk avatar jahabeebs avatar mrdeadce11 avatar pi0neerpat avatar st4rgarden avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

dashbaord202401

od-relayer's Issues

Test Q64.96 Math

https://ethereum.stackexchange.com/questions/98685/computing-the-uniswap-v3-pair-price-from-q64-96-number

https://blog.uniswap.org/uniswap-v3-math-primer

Todo:
After initializing value of liquidity pool, use following calculations to confirm correct value:

    sqrtPriceX96 = sqrt(price) * 2 ** 96
    # divide both sides by 2 ** 96
    sqrtPriceX96 / (2 ** 96) = sqrt(price)
    # square both sides
    (sqrtPriceX96 / (2 ** 96)) ** 2 = price
    # expand the squared fraction
    (sqrtPriceX96 ** 2) / ((2 ** 96) ** 2)  = price
    # multiply the exponents in the denominator to get the final expression
    sqrtRatioX96 ** 2 / 2 ** 192 = price
    ```

Research: Oracle Circuit Breaker

Proxy which consumes both chainlink and teller data, and will fail to return isValid if the prices differ by more than a certain percentage.

Related to #50

Add oracle tests

Oracle test for down-versioned

  • Algebra relayer
  • Chainlink relayer
  • denominated oracle

[L-11] ChainlinkRelayerWithL2Validity.getResultWithValidity should not revert, when sequencer is down

ChainlinkRelayerWithL2Validity.getResultWithValidity function is designed to not revert, when result is not valid, it should just return false as validity. But in case if sequencer is down, then function reverts, which may revert integrations.

function getResultWithValidity() public view override returns (uint256 _result, bool _validity) {
    require(getSequencerFeedValidation(), 'SequencerDown');
    (_result, _validity) = super.getResultWithValidity();
  }

Add Github Actions to run tests

od-contracts has actions set up to run on PRs, but od-relayer does not.

Expected outcome:
od-relayer repo should have similar setup and Github Actions as od-contracts

Deploy mainnet DenominatedOracle

Required to calculate TVL deposit information

See here for the list of oracle addresses open-dollar/od-sdk#56

RETH

  1. ChainlinkRelayer RETH / ETH
  2. DenominatedOracle (RETH / ETH) * (ETH / USD)

WSTETH

  1. ChainlinkRelayer WSTETH / ETH
  2. DenominatedOracle (WSTETH / ETH) * (ETH / USD)

[L-10] ChainlinkRelayerFactory can't deploy ChainlinkRelayerWithL2Validity

ChainlinkRelayerWithL2Validity extends ChainlinkRelayer and provides L2 sequencer check. Currently it can't be deployed with ChainlinkRelayerFactory and there is not separate factory for it, as ChainlinkRelayerFactory allows to deploy ChainlinkRelayerChild only, which is ChainlinkRelayer.

  function deployChainlinkRelayer(
    address _aggregator,
    uint256 _staleThreshold
  ) external isAuthorized returns (IBaseOracle _chainlinkRelayer) {
    _chainlinkRelayer = IBaseOracle(address(new ChainlinkRelayerChild(_aggregator, _staleThreshold)));
    relayerId++;
    relayerById[relayerId] = address(_chainlinkRelayer);
    emit NewChainlinkRelayer(address(_chainlinkRelayer), _aggregator, _staleThreshold);
  }

Add greater/less than check on liquidity pool

Problem:
token0 and token1 are unrelated to arg input, but ordered by size. When SystemCoin address changes (after new deployed), it can break test setup by changing the token order.

Todo:

  • add check and accommodate tests to dynamic token order in pool

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.