Comments (4)
Do you know what config was changed? Because I am not sure about that. But what I did is to make sure the arbitrage opportunity is higher before executing the transaction. I guess that the opportunity is changing quite quickly and while the transaction is running, the opportunity was already lost because it was too slow to execute.
from poly-flashloan-bot.
I thought this error happened when you fail to borrow a loan token from dodo.
it("should be reverted with `INSUFFICIENT_INPUT_AMOUNT` when the bot set a wrong dodo pool and the contract can't borrow tokens.", async () => {
await expect(
Flashloan.dodoFlashLoan({
flashLoanPool: dodoV2Pool.WMATIC_USDT,
loanAmount: getBigNumber(1, 6),
firstRoutes: [{
path: [erc20Address.USDC, erc20Address.DAI],
router: uniswapRouter.quickswap,
}],
secondRoutes: [{
path: [erc20Address.DAI, erc20Address.USDC],
router: uniswapRouter.quickswap
}],
}, { gasLimit: 1000000 })
).to.be.revertedWith("UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT");
});
In this scenario, the contract will try to borrow USDC, but it can't borrow USDC from dodoV2Pool.WMATIC_USDT.
The contract checks if the loan token is a base token of the dodo pool, and if not it borrow a quote token of the pool, so the contract would borrow USDT (quote token of dodoV2Pool.WMATIC_USDT).
I should have checked if the quote token is the loan token as well.
But it could be a different reason, I'm just guessing.
I will update the contract to check the dodo pool before executing flashloan and to make it clear.
ref.
https://docs.uniswap.org/protocol/concepts/V3-overview/swaps#safety-checks
https://ethereum.stackexchange.com/questions/90241/why-insufficient-output-amount
from poly-flashloan-bot.
Thank you for looking into this issue. What you have tested is the INPUT
amount, but my issue was about the OUTPUT
amount. Can you make sure both are tested?
from poly-flashloan-bot.
Sure. I opened an issue on that.
from poly-flashloan-bot.
Related Issues (20)
- Connect to smart contract HOT 2
- Trade array doesn't read string of protocols - messes up router setup! HOT 2
- SetInterval
- > [8/8] RUN yarn build: #12 40.25 src/index.ts(8,3): error TS2305: Module '"./config"' has no exported member 'tradingRoutes'. HOT 7
- Nothing happens... HOT 1
- Docker giving error, and yarn hanging infinitely. HOT 6
- build but no output HOT 1
- error when i get oppurtinity
- ENS Error on Yarn Start HOT 1
- Nothing posting to logs
- getting 0 confirmations transactions everytime i get oppurtunity HOT 1
- reason: 'insufficient funds for intrinsic transaction cost', HOT 4
- "Yarn Start" and nothing happens. HOT 4
- Discord and telegram group HOT 15
- Fail with error 'SafeERC20: low-level call failed' HOT 12
- Failed to estimate price: missing revert data in call exception !! HOT 3
- Analysis - % Diff inter Exchanges, Fee Uniswap, Fee Flash Loan - Very Difficult Opportunities HOT 3
- Testing - Error encountered during contract execution [execution reverted] HOT 3
- Error: EACCES: permission denied, mkdir 'log'
- Not enough amount to return loan HOT 11
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.
from poly-flashloan-bot.