Questions tagged [flash-loans]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

Are Binance smart chain flash swaps using Pancake swap working?

I am practicing solidity and I am trying to use flashswaps. I am trying to perform flash swaps / borrow a flash loan using Pancake swap. I wrote a script that does that but for some reason when I try ...
Design_Smith's user avatar
0 votes
2 answers
37 views

Is it possible to manipulate V2 getAmountOut() or V3 sqrtPriceX96 using Uniswap flash swaps or any kind of flash loan

I use this calls: IUniswapV2Router(uniswapV2Router).getAmountOut(tokenAmount, reserve1, reserve0) // Uniswap V2 token price (uint160 sqrtPriceX96, , , , , , ) = uniswapV3Pool.slot0(); // Uniswap V3 ...
blockson's user avatar
0 votes
1 answer
30 views

FlashLoans contract funds are being wrongly withdrawn without any action, how is this possible?

I'm new with flashloan, I'm using this code to test and everything works, however the tokens that remain in the contract after 30 to 40 minutes are "stolen", "improperly withdrawn",...
CodeLego Blockchain's user avatar
1 vote
0 answers
96 views

How to Calculate Arbitrage Optimal amount in, in Uniswap v3 pools?

Let us assume that there is an arbitrage opportunity in uniswap v3 pools.Now I want to take a flash loan to make a swap in uniswap v3 pools.My doubt is how can I calculate the optimal amount in for ...
kumar's user avatar
  • 61
0 votes
0 answers
16 views

npx hardhat test "Timeout of 40000ms exceeded" when repaying flash loan

I am trying to follow along with a youtube tutorial that teaches you how to make a basic uniswap flash loan application. I have copied every piece of code, line by line, from the video as instructed. ...
ChewyCorndog's user avatar
1 vote
1 answer
20 views

Hardhat impersonateAccount returns an empty "whale" wallet

I am impersonating a whale wallet so that I transfer ETH from that wallet to my flashloan contract for the sake of performing an example flash loan using my test script. I check the address to make ...
ChewyCorndog's user avatar
0 votes
0 answers
11 views

Arbitrage bots are way too risky [duplicate]

All I hear from forums is that the only way I can profit with a flash loan is I create my own arbitrage bot and I fund $800-$1600 worth of Ethereum upfront to cover for gas fees. I've never made that ...
Joseph Capozza's user avatar
0 votes
1 answer
36 views

"How can I recover funds in Remix after a failed Flash Loan process on Ethereum?"

While executing the contract, the transaction failed on Remix.eth. I would like to know how I can retrieve the Ethereum I deposited for the transaction. I am new to flash loans. Please help. Hash - ...
JamesNFT's user avatar
0 votes
0 answers
38 views

Pancakeswap V3 flash loan, receiving F0 error even though the flash loan has been repaid

I'm trying to finish up the callback function for a pancake swap flash loan. Everything is now working however for some reason the flash function fails due to an F0 error (ie. not paid the loan back). ...
Alexander Hunter's user avatar
0 votes
1 answer
37 views

Where Do I Get A WETH Flashloan On Goerli Ethereum?

I'm trying to test a flashloan on goerli ethereum. It seems AAVE may no longer be supporting this for WETH flashloans (if they ever did). Anybody know how I can run test Flashloans on Goerli ...
Trent Kennelly's user avatar
0 votes
0 answers
309 views

A little help with the Uniswap V3 flash loan arbitrage code

I'm trying to use flash loans on Uniswap V3 to trade across different pools (two of these four: 0.01%, 0.05%, 0.30%, 1.00%) I've tried running codes from multiple tutorials: https://solidity-by-...
Joseph Capozza's user avatar
0 votes
0 answers
33 views

failed transaction using flash loan

I, I`m new to flash loan, while i compiled this code trying to use the flash loan but i keep getting "Gas estimation failed Gas estimation errored with the following message (see below). The ...
jose celis's user avatar
0 votes
0 answers
32 views

What is the best place to learn how to code arbitrage flash loans?

This I already know: flash loans are given and paid in the same transaction, possibly to sell on one exchange and buy on the other. As you might or not know, I pasted someone else’s code in a separate ...
Joseph Capozza's user avatar
0 votes
1 answer
102 views

How to properly test my flashloan bot

I am building a simple flashloan bot as shown below: Flashloan from Aave -> lend it on Lending protocol A -> Borrow tokens from protocol A -> Lend borrowed to protocol B -> Borrow from ...
Rishabh Raghwendra's user avatar
0 votes
0 answers
160 views

How to buy on one exchange and sell on another with a flash loan

So, I’m trying to buy a coin on one exchange and sell the coin on another using the flash loan. In this example, specifically PancakeSwap and Uniswap V3. I actually copied a template, specifically “...
Joseph Capozza's user avatar
0 votes
1 answer
40 views

I want to subscribe to flashloan events on the Aave v2 contract via websocket, how do I find the function/event?

I am trying to set up a websocket connection with ethers.js to listen for flashloan events. I have made a connection successfully listening to Transfer events on the USDT contract - which was simple ...
Zara44's user avatar
  • 3
0 votes
1 answer
335 views

pancakeswap v2 flash loan arbitrage real output amount is not as expected

when i monitor a profitable trade. The difference in profit calculated by my own method and the result of getAmoutsOut is not significant. Before sending the transaction, I would use the getAmoutsOut ...
DOGGODCoder's user avatar
0 votes
1 answer
164 views

Can a sandwich attack be designed using 1 flashloans and no outside capital? attacker tx, victim tx, attacker tx bundled with 1 flash loan?

So the question is can you bundle 3 transactions into one transaction where the first transaction borrows using a flash loan executes certain conditions, requires a middle victim transaction be ...
Akash Patel's user avatar
2 votes
1 answer
227 views

What's Wrong With My Polygon Mainnet Aave Flashloan Script? - Fail with error '27' & Fail with error 'ERC20: transfer amount exceeds balance'

I have successfully deployed and executed a flashloan on the Polygon network in testnet and have since adapted it for mainnet. On Mainnet it compiles and gets deployed with no problem, but when I ...
Peter's user avatar
  • 23
1 vote
1 answer
671 views

Flashloan + flashbot

Can i use both flashloan and MEV builder in one transaction? Means borrowing from flashloan, then building my transaction in MEV builder (to prevent sandwich attack )? If it is possible, can anyone ...
Biruk Damte's user avatar
2 votes
1 answer
156 views

Finding IUniswapV2Callee in UniswapV2 clones for flashloans

In similar fashion to this question specific to PancakeSwap For many UniswapV2 clones, I want to find the part of the code which is replicating IUniswapV2Callee interface, so that I can use it in a ...
miskin's user avatar
  • 21
1 vote
0 answers
85 views

How can I make a flashloan bot

How Can I make a flash loan bot which can operate on Aave, uniswap, sushiswap etc? I know a furucombo, but this is too complicated for me. My Idea is the bot will keep an eye on certain tokens & ...
Saikat Karmakar's user avatar
1 vote
1 answer
145 views

flash loan arbitrage vs flash loan attack

What is the difference between a flash loan arbitrage and a flash loan attack? If I somehow find an opportunity to make a 1000% profit which crashes one or more token, will it be considered an attack? ...
Saikat Karmakar's user avatar
0 votes
1 answer
32 views

I am studying flashloan attack. How flashloan attack is possible?

I am a beginner to learn cryptocurrency vulnerabilities. How flash loan attack is possible? Doesn't there some limit to getting a tremendous amount of flash loans?
Wonjae Choi's user avatar
0 votes
1 answer
150 views

Flash Loans on Etherscan

Is it possible to see all the transactions triggered by a single flash loan on etherscan? Ex. could someone have called another contract from a single function that took a flash loan and this would be ...
zcooh's user avatar
  • 1
0 votes
1 answer
91 views

Is there any significant advantage that UniswapV3 has over UniswapV2 in a Flashloan(or Flashswap) scenario?

I have been following the flash loan market for a while and I want to eventually experiment on it but i am having a hard time choosing between UniswapV2 and uniswapV3 for making my swaps. Is there any ...
Shigaba Shigaba's user avatar
0 votes
1 answer
55 views

How to fix gas issue

Contract address: 0x2138fF6dB5125F68E69152679D340c09d09eDEF0 USDC token address goerli: 0x9FD21bE27A2B059a288229361E2fA632D8D2d074 I sent USDC to the contract which I can see it when I invoke the &...
JaySnel's user avatar
  • 55
0 votes
1 answer
56 views

Stacked flash loan

Would it be possible to use a flash loan to flash loan? Ex. I charge 10% for a flash loan. Someone asks my contract for money at 10% rate, so I go to Uniswap, get the money in a flash loan, and loan ...
user122417's user avatar
0 votes
1 answer
50 views

Are flash loans on chain?

I'm trying to understand flash loans. It seems like because the to/from payment both happen within the same function, we cannot atomize each to a transaction on chain. Is this assumption incorrect?
user122417's user avatar
3 votes
2 answers
612 views

TransferHelper: TRANSFER_FROM_FAILED

I want to swap some eth (that i receive from a flashloan) for x amount of a token. Then swap the token for some eth, pay back the flashloan and keep profit. For the flashloan i used dYdX and to swap i ...
Shadq's user avatar
  • 93
2 votes
1 answer
145 views

Arbitrage Bot error: The called function should be payable if you send value and the value you send should be less than your current balance

I'm building a arbitrage trading bot with solidity. The bot should: see an opportunity on the market, execute a flashloan, swap the token retrieved from the loan for another token, swap that token to ...
Shadq's user avatar
  • 93
1 vote
1 answer
35 views

Contract "DyDxPool" should be marked as abstract

i'm getting this error: Contract "DyDxPool" should be marked as abstract I have already seen others question like mine and they say that this error pops up because the contract that ...
Shadq's user avatar
  • 93
1 vote
1 answer
2k views

Flash Loan Arbitrage Bot

I'm design an Arbitrage bot, and I wanted it to grab the funds from a flash loan. How would you implement this?
Barrocz's user avatar
  • 66
2 votes
1 answer
270 views

Is it feasible to implement a Uniswap V3 contract integration that can simultaneously call flash and swap on the same pool in a single transaction?

We are considering the development of a Uniswap V3 flash liquidator smart contract. The liquidator will flash an amount of tokens (e.g., USDC) from the Uniswap V3 pool in order to liquidate a lending ...
Ahmed Ihsan Tawfeeq's user avatar
1 vote
0 answers
184 views

Gas estimation errored. Error: Transaction reverted without a reason string

Im building a trading bot with solidity, uniswap, sushiswap and dydx for the flashloans, when i execute the executeTrade function i get this error: Gas estimation errored with the following message (...
Shadq's user avatar
  • 93
1 vote
0 answers
63 views

hardhat script giving this error when ran

Please, I need help clearing this. root@DESKTOP-O7HMHFH:/mnt/c/pr0/projects/arbitrage/comp# npx hardhat run scripts/manipulate.js --network localhost Beginning Swap... Input Token: COMP Output Token:...
Soyaya's user avatar
  • 31
1 vote
1 answer
363 views

Manipulating Uniswap V2's pair totalSupply via flash loan

Let's assume that I'm writing a UniswapV2 LP token price oracle. Would it be a bad idea to rely on the LP token totalSupply for my calculation? Would it be possible to manipulate its value through a ...
Ahmed Ihsan Tawfeeq's user avatar
0 votes
1 answer
447 views

execution reverted: 27 HELP?

I have a simple flashloan solidity code : // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import {FlashLoanSimpleReceiverBase} from "@aave/core-v3/contracts/flashloan/base/...
Zura Gabichvadze's user avatar
0 votes
4 answers
432 views

Flash loan basics

hello everyone pls i've been trying to write some solidity code for flash loans , im kind of new to it , i would like to know after testing and deploying your smart contract with a test net without ...
RichMond's user avatar
0 votes
2 answers
458 views

Request flashloan fails: Gas estimation failed: 'execution reverted: 27'. This transaction will likely revert

I have written a simple flash loan smart contract with no custom logic and deployed it to goerli testnet. When I call the requestFlashLoan() function I get the following error. Gas estimation failed: '...
Rapithwin's user avatar
1 vote
1 answer
915 views

Triangular Arbitrage or multiple swap arbitrage

Is it posible to develop a bot with a multiple step arbitrage? like 5 swaps and above? trying my hands on triangular arbitrage with bots on dexes, able to run a binary arbitrage. can i get a sample ...
Soyaya's user avatar
  • 31
0 votes
1 answer
106 views

How is a flashloan paid back automatically?

AAVE flash loan documentation states You do not need to transfer the owed amount back to the Pool. The funds will be automatically pulled at the conclusion of your operation. But how does the ether ...
Majiick's user avatar
  • 135
0 votes
1 answer
270 views

Flash Loan Transaction

Please I need help here, I am new to flash loans. I want to understand flash loan transactions on ether scan , how to identify them, if the transaction make profit or not. I am trying to implement a ...
Soyaya's user avatar
  • 31
1 vote
1 answer
115 views

AAVE FlashLoanV3 alowance return 0

I'm trying to make a simple flashloan contract and export it in to goerli testnet. Everything start ok, but when I call requestFlashLoan() it become error, like this: FLashLoanArbitrage.sol // SPDX-...
Linh lê's user avatar
0 votes
1 answer
138 views

Flashloan in JavaScript

Is it possible to request for a flashloan for use exclusively in Javascript as opposed to in the smart contract back-end? I have a use case need to perform some adhoc logic based on received ...
Samboy's user avatar
  • 21
2 votes
3 answers
4k views

Cannot estimate gas; transaction may fail

I wrote a smart contract, that is able to borrow a flashloan, make a few trades and pays the flashloan back after that. I tested the smart contract with hardhat on a mainnet fork and everything worked ...
Dani's user avatar
  • 63
2 votes
2 answers
4k views

Hardhat deploy contract error: Error: cannot estimate gas; transaction may fail or may require manual gas limit

I want to deploy a FlashLoan smart contract using hardhat, and deploy the contract on hardhat network that fork by mainnet. But when I run the deploy script, keep showing Error: cannot estimate gas; ...
YUCHENG LIN's user avatar
0 votes
1 answer
384 views

Fail with error '27' - Aave flashloans solidity

I have succesfully deployed the contract to the goerli testnet, via hardhat. However when I try to call the requestFlashLoan function with metamask, the transaction suggested gas fee seems unusually ...
Simsimbutdifferent's user avatar
0 votes
1 answer
109 views

Aave: What is the meaning of Refinancing a loan with a Flash Loan

I was watching an old video on AAVE and at around the 2:45 mark it talks about "refinance a loan with flash loan". I am trying to understand what it means. I understand a Flash loan is a big ...
Somjit's user avatar
  • 265
0 votes
1 answer
250 views

Flashloan Equalizer

I try to understand how to get a flashloan from euqlizer finance and make something with it. There is a documentation where they say I have to call the onFlashLoan(...) function to borrow the ...
Dani S's user avatar
  • 21