Questions tagged [aave]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
16 votes
2 answers
5k views

Explain "griefing" attack on Aave flash loan

Aave doc about flash loan warns to never store funds inside a receiver contract as it can be exposed to "griefing" attack. So my questions are Can you give an example of this attack? How ...
tsknakamura's user avatar
5 votes
0 answers
4k views

Contract call: data out of bounds

I'm working on a nextjs/react project in which i want to fetch the health factor of an address on AAVE. This can be done by calling getUserAcountData(address) on the lending pool contract. I can ...
Conviley's user avatar
  • 390
4 votes
1 answer
1k views

Double Flash Loan

Looking into Flash Loans, is it possible to take out TWO at once (aave/dydx/uniswap)? How would you go about doing this? Here is what I'm thinking of, but it seems too complicated: Contract 1 takes a ...
superuser's user avatar
  • 143
4 votes
1 answer
1k views

How to import Aave and Uniswap contracts from a 0.8.x Solidity contract

So I have some smart contracts with version pragmas set to 0.8.0, my Truffle config's solc is set to 0.8.2 and everything compiles except for some imported contracts from Aave and Uniswap. This is ...
Brendon Rofe's user avatar
3 votes
2 answers
154 views

Why are the Aave V2 supply and borrow index rate calculations done differently?

I have a question about the math in Aave V2 that performs the update liquidity and borrow index. This question was also asked and unanswered in the Aave Governance Forum. I see calculateLinearInterest ...
Mike's user avatar
  • 101
3 votes
2 answers
1k views

Flashloan error `reverted with reason string 'SafeERC20: low-level call failed'`

I'm attempting to execute a flashloan on a forked mainnet within hardhat and am getting Error: VM Exception while processing transaction: reverted with reason string 'SafeERC20: low-level call failed'....
pygeek's user avatar
  • 131
3 votes
1 answer
31 views

What are the countermeasures for losses in decentralized finance platforms like Aave?

I am a newbie in the blockchain/Web3 space and trying to understand the AAVE protocol. Suppose a borrower deposits 1 ETH whose value is 500 DAI Tokens(500$) as collateral to borrow 100 DAI Tokens(100$)...
Hrithik Raj's user avatar
3 votes
0 answers
45 views

Why borrow DAI from compound has lower rate than borrow USDT?

As shown in the figure, borrowing Tether from compound have 10.73% APY, while borrow DAI from compound only have 4.64%. However, we can exchange DAI or USDC to Tether in any exchange very easily, so ...
loin.liao's user avatar
2 votes
1 answer
59 views

Aave's gas consumption on state modification

On every action from LendingPool (deposit, withdraw, repay, borrow, etc), Aave updates its entire state for certain variables, including the aToken balances of each user holding aTokens. How can Aave ...
dNyrM's user avatar
  • 713
2 votes
1 answer
263 views

What does AaveV3 Error Code '51' actually mean?

Here is a scenario I am simulating on a Hardhat Avalanche Mainnet fork: Supply USDC to AaveV3. Borrow WAVAX. Wait four weeks. Claim WAVAX rewards. Swap the rewards into USDC via a UniswapV2-like pair....
Eric's user avatar
  • 395
2 votes
1 answer
87 views

Calculating AAVE intereset rate belonging to different users that transferred into a smart contract

I have a smart contract that accepts user funds and adds them to an AAVE lending pool (DAI for example). Something like this: lendingPool.deposit(stableCoinAddress, amount, address(this), 0); As you ...
Ehsan Khodarahmi's user avatar
2 votes
1 answer
434 views

why aave total supply not equal to circulation supply?

I'm new to the blockchain world. I'm trying hard to understand how tokens are generated and I learned that the tokens are not minable, unlike bitcoin or eth coins. also learned that these tokens only ...
Ravi's user avatar
  • 121
2 votes
0 answers
235 views

Pros and cons of interest bearing elastic supply (rebase) tokens

Single asset vaults usually choose from 2 types of tokens that represent user shares. Tokens pegged 1:1 to underlying assets employing the rebase architecture. When underlying asset volume grows then ...
origaminal's user avatar
2 votes
0 answers
422 views

Simple Contract to supply eth to aave

I'm trying programatically deposit using into Aave V2 Contract Aave's Code Examples // SPDX-License-Identifier: MIT pragma solidity >= 0.4.22 < 0.8.7; import { IERC20, ILendingPool, ...
johnny 5's user avatar
  • 292
2 votes
3 answers
283 views

How to calculate the value of supply apy seen on the aave frontend?

I tried to implement the following aave docs in order to calculate the deposit apy that you can see on the market page in Aave defi protocol. https://docs.aave.com/developers/v/2.0/guides/apy-and-apr ...
Alessandro Morandi's user avatar
1 vote
1 answer
54 views

Is there MEV in replacing referral code in calldata?

I've been reading AAVE document and saw that user can include a referral code inside deposit calldata, so that the referrer can receive some rewards(source: https://docs.aave.com/developers/v/1.0/...
johnhckuo's user avatar
  • 341
1 vote
1 answer
972 views

Retrieving Matic Reward Rates on AAVE with a Python script

I am trying to build a Python script to retrieve different AAVE rates programmatically (borrow, lending, and rewards), on the Polygon blockchain (will be very similar for Ethereum). I am using Python. ...
Dji enne's user avatar
1 vote
2 answers
86 views

Aave V3 Liquidations - Testing on Sepolia

I'm trying to test my nodejs app on the Sepolia testnet. What I want to do is monitor some events, gather user accounts, I will then call getUserAccountData() from the pool to see the HF. As explained ...
iliev951's user avatar
1 vote
1 answer
121 views

how aave increases debtTokens?

im working on a lending protocol and for tracking borrowers debt i want to use aave debtTokens pattern but i don't get how aave increases borrowers balances in real time since we cannot change ...
noro meb's user avatar
  • 328
1 vote
1 answer
343 views

Approving tokens after flash loan

I'm creating a smart contract that can both make flash loans and swap tokens via 0x. I can call the flash loan and token swap functions just fine, but when I try to call the token swap within the ...
kingfish's user avatar
1 vote
1 answer
742 views

Getting a compile error every time I try to compile a contract with Brownie that includes an import statement from the web

I have a contract that starts with the following import statements: import 'https://github.com/aave/protocol-v2/blob/master/contracts/flashloan/base/FlashLoanReceiverBase.sol'; import 'https://github....
Pickinanameainteasy's user avatar
1 vote
1 answer
1k views

Transaction Reverted when attempting to withdraw from aave

I got an example running which deposits the Aave token into Aave. I'm using the Code Contracts examples provided by Aave v2 github // Fork Kovan await hre.network.provider.request({ method: '...
johnny 5's user avatar
  • 292
1 vote
1 answer
748 views

Failing to borrow from Aave's Lending Pool

I'm trying to borrow USDC from Aave v2's lending pool through an interface, but I can't manage to do it: My contract: //SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import './interfaces/...
dNyrM's user avatar
  • 713
1 vote
1 answer
266 views

How to calculate AAVE yield on chain

I’m working on a project which involves tracking and withdrawing AAVE yield on chain while maintaining the original deposit balance. I’m confused as to how to accurately calculate AAVE yield at a ...
xde's user avatar
  • 13
1 vote
1 answer
221 views

Hardhat network resetting repeatedly

I'm trying to test out some functionality using the AAVE sandbox network, which is a hardhat forked network that has their protocol built in for testing purposes. I am able to deploy my contract to ...
l1nkm4rine's user avatar
1 vote
1 answer
1k views

What could go wrong if I change the version pragma of a third-party contract to make it importable with a newer Solidity compiler?

What are the consequences of changing compiler versions in dependency contracts to the same version as the main contract? I have one main contract that inherits some other contracts to interact with ...
Sevasoft's user avatar
1 vote
2 answers
2k views

Is there any way to find the Aave health factor for a given address (not mine) at a given block?

Is there any way to find the Aave health factor for a given address (not mine) at a given block? e.g. Find out the exact “health factor” for the address 0x0000006daea1723962647b7e189d311d757Fb793 at ...
MacPapatheBrave's user avatar
1 vote
1 answer
33 views

Distribution coefficient

I'm building a dapp and I need some help with creating the formula for a "distribution coefficient/index" (my math is rusted). The idea behind it is: There's a total balance. Let's call it &...
dNyrM's user avatar
  • 713
1 vote
1 answer
486 views

How do I claim rewards on polygon aave with smart contract?

What is the function to claim rewards on polygon aave? I can't seem to find it in its docs. Thanks!
DeviousDev's user avatar
1 vote
1 answer
558 views

How does flash loan lender know you are not able to pay it back?

Basically I am wondering how does it know when the loan is not paid back. I understand this is easy to check but how can it revert the transaction? For example let's say I borrow 1M USDT, and then I ...
Joan Venge's user avatar
1 vote
2 answers
724 views

Is there any version of AAVE protocol deployed on polygon/matic testnet?

As AAVE documentation suggests, there is a deployed version of the protocol on matic/polygon mainnet. However, it does not make any mention of those smart contracts on Mumbai testnet which I need to ...
Ehsan Khodarahmi's user avatar
1 vote
0 answers
63 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
86 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
1 vote
1 answer
166 views

aave accounts with health factor <1

Did a quick check in subgraph, and found ids with <1 health factor. Should not they be liquidated instantly? like 0xc49b59301be4d9660961f62fbeea0e234e3a53b5, ...
Castle_inthe_Air's user avatar
1 vote
0 answers
113 views

How can I deploy aave protocol locally or in testnet

Aave v2 mumbai testnet faucet is broken, So I was thinking to deploy the aave protocol locally or in any testnet to mint new tokens. Aave protocol is built on hardhat and I am new on hardhat. can't ...
Yeasin Rahaman's user avatar
1 vote
0 answers
204 views

Trouble with Solidity Compiler Version when combining Aave and Openzeppelin in Foundry

I'm trying to follow this tutorial by Patrick Collins on Flashloans but in Foundry: https://www.youtube.com/watch?v=Aw7yvGFtOvI&t=328s When in try to forge build I get the following error: : src\...
banyan's user avatar
  • 21
1 vote
1 answer
195 views

How To deposit erc20 tokens into AAVE v3 protocol using solidity and remix?

I was trying to deposit some funds from my metamask wallet into AAVE V3 protocol using solidity and remix? plz anyone post the code
sourav menon's user avatar
1 vote
0 answers
342 views

Depositing Weth ERC20 from Brownie into Aave Pool in contract

I am tying to do a simple deposit into an Aave V2 pool with Python Brownie and Solidity on a mainnet-fork but my transaction keeps getting reverted and I dont know why. In brownie, I call my function ...
Pysnek313's user avatar
1 vote
1 answer
656 views

Issue implementing and testing aave V3 flash loan

I'm trying to implement a flash loan using aave-v3 flash loan contracts. and when testing using hardhat I get this error: Error: Transaction reverted: function returned an unexpected amount of data ...
AJERMOUNE's user avatar
1 vote
1 answer
635 views

How to correctly import aave/flashloan-box in Remix IDE

I was following the step-by-step guide, and since there is only the main code, I've tried with the following imports pragma solidity 0.6.12; import { FlashLoanReceiverBase } from "https://...
waaat's user avatar
  • 13
1 vote
0 answers
54 views

AAVE Protocol v1 issue on reserve addresses with compound ctoken addresses

https://kovan.etherscan.io/tx/0xa7f5e857d1a9ecb4aca0714b24a70ca0942cc1a656c8e09b6d01bab9af4ec9e5 I am trying to make a transaction from DSProxy (Smart Wallet) on a contract https://kovan.etherscan.io/...
Mohsin Laeeque's user avatar
1 vote
1 answer
573 views

Getting current user balance of an aToken for a specific asset in AAVE v2 protocol

As AAVE protocol V2 documentation says: aTokens are interest-bearing tokens that are minted and burned upon deposit and withdraw. The aTokens' value is pegged to the value of the corresponding ...
Ehsan Khodarahmi's user avatar
1 vote
0 answers
1k views

Does the gas limit for AAVE transactions need to be so high?

There are two parts to the fee you pay for an Ethereum transaction - gwei and gas limit. Gwei is determined by how competitive (ie, congested) the Ethereum network is. As most people are aware, the ...
CES's user avatar
  • 11
1 vote
0 answers
474 views

Cant receive wETH to my contract after swap on uniswap

I write a simple contract to do a flash loan from aave and interact with uniswap in it. I found out that no wETH is sent to my contract after swaping on uniswap. Transcations are here: https://kovan....
Wei Pan's user avatar
  • 41
1 vote
0 answers
57 views

Presign transaction to later publish with aave

Is it possible to have pre-signed tx that I could publish to close a position with aave. Let's imagine I have 0.1 wbtc deposited with aave and I borrow 1000 usdt. I can close my position from the ...
Marie90's user avatar
  • 23
0 votes
1 answer
47 views

When liquidations occur on Aave or Synthetix or Compound or any other protocol, where are the liquidated assets sold?

Do they sell them on Uniswap or Binance? Does it happen automatically? If they just sell on some random Dex, how do they avoid major slippage? Where does a protocol say how it liquidates positions?
Ilan Katz's user avatar
0 votes
1 answer
206 views

Why can't I deposit to Goerli Aave with web3.py?

I'm trying to deposit weth to aave on the goerli testnet. My approveErc20 function works and I confirmed that tokens are approved for transfer. This is my code: def deposit_to_aave_goerli(privateKey, ...
Ilan Katz's user avatar
0 votes
1 answer
77 views

Unable to find WETH contract in mainnet fork

I have created a fork of the ethereum mainnet using Alchemy. When I try to fetch the WETH contract in the fork, it says no contract deployed at the given address (...
sramasub's user avatar
0 votes
1 answer
83 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
142 views

AAVE supply Pool failing with error 'ERC20: transfer amount exceeds allowance'

I'm trying write a contract that takes a transfer from a user which then deposits the sent tokens into an AAVE lending pool (I'm using USDT for testing on Georli testnet). I was able to get the funds ...
l1nkm4rine's user avatar