Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request failed with status code 400 #4

Closed
GNMarques opened this issue Dec 8, 2021 · 7 comments
Closed

Request failed with status code 400 #4

GNMarques opened this issue Dec 8, 2021 · 7 comments

Comments

@GNMarques
Copy link

Hi,

Sorry to bother you again with the same issue.
I deployed in the mainnet and I still get the same error message.
I can see in alchemy I am sucefully making API calls but I still get the same error message.
Do you know how to solve this.

Thanks in advance.

@yuichiroaoki
Copy link
Owner

Hi.
Did you update your code?? That error comes from the bot code.
You can try running the following commands:

git pull origin main
yarn install 
yarn build
yarn start

@GNMarques
Copy link
Author

Thank you very much for yor help.
I will try

@GNMarques
Copy link
Author

GNMarques commented Dec 14, 2021

I was getting "Error: Failed to fetch data from 1inch". I run the program again it looks ok.
Does it happear anything in the console.log?

@yuichiroaoki
Copy link
Owner

That is expected behavior and meaning the bot is working correctly.
When the bot execute the flashloan and there's not an arbitrage opportunity, the transaction will be reverted with that message.

https://github.com/yuichiroaoki/poly-flash/blob/c2b8e78c0d7c57005715362ba17ba76639feba3e/contracts/Flashloan.sol#L131

@GNMarques
Copy link
Author

Nice thanks. I will wait for a while I let you know when I find a deal.
Did you try it?
I checked on polygonscan your contract (0x0e0ec2c716b5ba2512af9d3790d8804da42ddd58) have some transactions reverted did you solve that issue?

@leuhk
Copy link

leuhk commented Dec 15, 2021

I think there's an issue with the 1inch quote API? Keeps returning an error with status code 400

@yuichiroaoki
Copy link
Owner

Nice thanks. I will wait for a while I let you know when I find a deal. Did you try it? I checked on polygonscan your contract (0x0e0ec2c716b5ba2512af9d3790d8804da42ddd58) have some transactions reverted did you solve that issue?

Some people modified the code and run flashloan with that contract, so I'm not sure why.

However, the following error message is expected when you run flashloan with no arbitrage opportunities.
Fail with error 'Not enough amount to return loan'

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants