Giter VIP home page Giter VIP logo

engine's Introduction

derivable-tools

engine's People

Contributors

blackskin18 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

engine's Issues

tools UT

use the following data in .env, make sure the .env.example contains their format

SCAN_API_KEY_{CHAINID}=
SCAN_API_KEY_{CHAINID}=
RPC_{CHAINID}=
RPC_{CHAINID}=

if the SCAN_API_KEY is not defined in .env, use empty as defaul
if the RPC is not defined in .env, set the default rpc URL for each chain in the code

And:

  • don't use private key in tests, change the tx to callstatic to test the results
  • make sure a fresh github clone can run the test
  • remove the .spec prefix for non-test files (and move them to a sub folder of /test/)
  • change .spec to .test for generic case test files

DEX aggregator intergration

Intergrate free DEX aggregator API and Contract so position can be opened by any token in the network. And vice versa: closing to any token.

1inch is not free

paraswap seem to be the best option: https://developers.paraswap.network/api/master

testing for: ETH <-> rETH

UTR Flow:

  1. UTR TRANSFER 10 USDT to Helper
  2. Helper approve 10 USDT to ParaswapRouter
  3. Helper call ParaswapRouter.data (with recipient is UTR) to receive x WETH
  4. UTR call Helper.swap to open position using x WETH

Execution Flow:

  • write an UT to aggAndOpen(a position with TOKEN_R = WETH using USDT as input)
  • construct the engine with aggregrator params
  • call paraswap api to get target and data
  • construct the UTR Flow above and staticcall the data to estimate amountOut

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.