yuichiroaoki / poly-flashloan-bot

Flashloan Bot on Polygon
https://yuichiroaoki.medium.com/flashloan-bot-on-polygon-part-2-3eae0ac33986?sk=80821da4ca1d0462c7c9ae617df56bdd
MIT License
303 stars 192 forks source link

Error Request failed with status code 400 #1

Closed GNMarques closed 2 years ago

GNMarques commented 2 years ago

Hi! First of all thanks for sharing this code. I am having an issue I cant solve when I use the command "yarn start". It says "Error Request failed with status code 400". Can you please help me to sort that issue?

Thanks in advance.

yuichiroaoki commented 2 years ago

Hi ! No problem !

That message might be come from 1inch API, and for most part, that wouldn't be a problem.

Did you add your deployed contract address ? see https://github.com/yuichiroaoki/poly-flashloan-bot#3-add-your-deployed-smart-contract-address

Sorry that I haven't elaborated the docs that much. I have added this one just now.

GNMarques commented 2 years ago

Thank you very much for your quick reply.

yes I add the deployed contract from mumbai testnet. This might be the problem dont you think?

yuichiroaoki commented 2 years ago

Yes, I think that's the one.

This code doesn't work on mumbai testnet because all these addresses are polygon mainnet addresses. Maybe there's no dodo lending pools on mumbai where you can borrow tokens, if you find one, you need to change the addresses below into mumbai ones.

https://github.com/yuichiroaoki/poly-flashloan-bot/blob/main/src/constrants/addresses.ts

Also, alchemy api url too.

https://github.com/yuichiroaoki/poly-flashloan-bot/blob/138c0b16ced81b5ca2984e3eddafc010de887554/src/flashloan.ts#L9

GNMarques commented 2 years ago

Thank you very much for your help. Sorry my late reply. I think I will try it in the mainnet the fees are not that high. I can live with that

thanks for sharing the code. Have a good day.

yuichiroaoki commented 2 years ago

No problem ! It took me 0.19 MATIC to deploy the contract. Have a good one.