engine's Introduction
engine's People
engine's Issues
missing PnL in position after some txs
wrong LP value
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:
- UTR TRANSFER 10 USDT to Helper
- Helper approve 10 USDT to ParaswapRouter
- Helper call ParaswapRouter.data (with recipient is UTR) to receive x WETH
- 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.