paco0x / amm-arbitrageur

An arbitrage bot between Uniswap AMMs
Do What The F*ck You Want To Public License
1.91k stars 834 forks source link

got stuck in function getProfit #30

Open ben2077 opened 3 years ago

ben2077 commented 3 years ago

yarn run v1.22.10 warning ../package.json: No license field warning ../../../package.json: No license field $ hardhat run --network bsc bot/index.ts Creating Typechain artifacts in directory typechain for target ethers-v5 Successfully generated Typechain artifacts! (node:51798) ExperimentalWarning: The fs.promises API is experimental 2021-06-16 04:01:32 info: Load pairs from json 2021-06-16 04:01:35 info: Start arbitraging 2021-06-16 04:01:39 info: BNB price: $365.58

I noticed that, every time i call the function getProfit, there will be: 2021-06-16 04:07:29 info: cannot estimate gas; transaction may fail or may require manual gas limit (error={"name":"ProviderError","code":3,"_isProviderError":true,"data":"0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000154e6f206261736520746f6b656e20696e20706169720000000000000000000000"}, method="call", transaction={"from":"0x343CEBd1E7D1A6838CD8b82f6238B29ad78e235E","to":"0xf53da1c2694b16692957d8c86212f4C45d472f32","data":"0x759eee10000000000000000000000000e7cc44de50b54906a9c1c48240650be2766481fc000000000000000000000000408d46d0f351f51ebc15e466aa897e5e0f5d2060","accessList":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.3.1)

nnzo commented 3 years ago

Seem to be getting this error as well.

paco0x commented 3 years ago

There might be some error during the contract call. FWIK, some DEXes are suspended because of security issues. You might need to figure out that. Write a UT using hardhat's mainnet fork is a good way to debug because it can print the stack trace of error calls.

Sorry, I'm not maintaining this repo anymore. Actually, this is just for learning purposes.

nnzo commented 3 years ago

@paco0x All good! I'll take a look and of course update this issue if I find anything out.