Questions tagged [flash-loans]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
9 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
  • 1
0 votes
1 answer
40 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
19 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
27 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
109 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
67 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
51 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
44 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
15 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
65 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
55 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
42 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
24 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
36 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
0 votes
0 answers
60 views

Is it possible to use flashloan as liquidity provider?

I am reading about flash loans where I come over a use case of flash loan as providing liquidity to DEXs. I am bit confused here. How we can earn profits by just providing liquidity to DEXs since we ...
Rishabh Raghwendra's user avatar
3 votes
2 answers
227 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
  • 83
2 votes
1 answer
95 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
  • 83
1 vote
1 answer
24 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
  • 83
1 vote
1 answer
911 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
  • 46
2 votes
1 answer
164 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
113 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
  • 83
1 vote
0 answers
53 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
228 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
319 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
190 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
311 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
533 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
63 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
177 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
77 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
86 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
2k 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
0 votes
0 answers
56 views

FlashSwap within one DEX

Good day every one, my question is related to arbitrage within one dex and i will be glad to hear your opinions: Lets' say i have 3 tokens A, B and C and three swap pairs. A->B (AB), B->C (BC) ...
ailmcm's user avatar
  • 101
2 votes
2 answers
3k 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
265 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
0 answers
231 views

transaction reverted while swap in polygon

Im trying to swap using Uniswap SDK on polygon mainnet. It approves, and execute the swap function from router, but the transaction get error inside blockchain, prolly because an wrong data from ...
Anderson's user avatar
0 votes
0 answers
100 views

I am getting "fail" error when calling flash loans aave on polygon network, when calling the loan pool

I am having error when calling flash loans aave on polygon network, when calling the pool the transaction fails "fail" here is my contract code and my bot script, what could it be? I am ...
Bruno Do TI's user avatar
0 votes
0 answers
307 views

Flashloan with DyDx on mainnet-fork

I forked the Ethereum mainnet with the ganache-cli using this command below : ganache-cli -f https://eth-mainnet.g.alchemy.com/v2/GsxpURWipc2UTubeBm3Mf-WdEyioVdwV -u ...
noro meb's user avatar
  • 328
0 votes
0 answers
151 views

Explanation for payment logic in Uniswap FlashLoan example?

The code is here (see below): https://github.com/Uniswap/v2-periphery/blob/master/contracts/examples/ExampleFlashSwap.sol#L28 question1: to confirm, to transfer tokens, you have to first deposit into ...
U Avalos's user avatar
  • 113
0 votes
1 answer
76 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
0 answers
124 views

Writing a flashLoan function call in assembly

I am making a call for an Aave flashloan per the code block below and am getting a too deep in the stack error. Would writing this function in assembly eliminate the error? If yes, what would that ...
em_mutable's user avatar
0 votes
0 answers
118 views

Flash Loan Implementation for EOA

Good day Devs. I finished my solidity course not too long ago and currently looking into getting flash loans with a contract. My question is : Is it possible to make the calling contract of the flash ...
Maximctrl's user avatar
0 votes
0 answers
120 views

Flashloan smart contract examples

Are there any complete examples of flashloan smart contracts that include a swapping arbitrage function and show how to enter the loan amount. Thanks in advance.
Ben Kirby's user avatar
0 votes
1 answer
177 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
2 votes
1 answer
334 views

Pancakeswap swapExactETHForTokens fails with non zero value in input

i have a problem with swapExactETHForTokens(). It seems to fail everytime I change the input value to something else than Zero. To help you to follow the path of de DATA, I show you : ...
david's user avatar
  • 41
1 vote
1 answer
307 views

Problem running arbitrage flashloan test app in JS [closed]

I´ve created a JS script to test arbitrage flashloan with Ethereum blockchain. When I attempt to run this code sample directly under the Truffle command line and run the uniswapFactory.getPair(...
Samboy's user avatar
  • 21
0 votes
1 answer
113 views

flashloan increase price of token in AMM

I've made a contract which basically do an arbitrage between two exchanges. What I couldn't understand it is that in AMM whenever the liquidity gets increased or decreased the price gets fluctuated. ...
Saad Suri's user avatar
0 votes
0 answers
60 views

How will flashloans recover funds if the borrower makes a loss?

I was studying flash loans recently which can be used for trading purposes. If we go through the smart contract code needed for the flash loans we need to repay the cost to the lender in 1 transaction ...
Rishabh Raghwendra's user avatar
0 votes
1 answer
111 views

Transaction failing but I'm unsure why

I am attempting to create a test arbitrage bot on the Goerli testnet. Here is my smart contract which should perform a swap from Uniswap to Sushiswap : pragma solidity =0.6.6; import './...
pocockn's user avatar
  • 163
0 votes
1 answer
202 views

Uniswap V2 Flashswap. Pool doesn't exist

I'm trying to upgrade a flashloan file from my study and I don't get one moment about checking pool existence. Here is the code. // Get the Factory Pair address for combined tokens address ...
Viktor Cortez's user avatar