Questions tagged [aave]
The aave tag has no usage guidance.
90
questions
0
votes
0
answers
4
views
Not able to fetch correct APY in aave mumbai
I am following this doc - APY and APR - Developers to fetch lending and borrowing rates in mumbai for usdc but they doesn’t seem to be correct and are different from aave staging UI, how can I solve ...
0
votes
0
answers
4
views
Data Fetching from an Aave subgraph
Hi guys I am writing a dApp which deals with liquidations flash loans etc,
The 1st step of development is to receive the user addresses who have borrowed more than zero from 'The Graph'
I use hardhat....
0
votes
2
answers
624
views
How to deposit ETH in AAVE v3 testnet WETHgateway.depositETH()
My goal: AAVE v3, deposit ETH, and borrow DAI
I played around with AAVE in lesson 10 of the Solidity, Blockchain, and Smart Contract Course, and as long as I stick to the course and use the v2 code ...
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
...
0
votes
1
answer
404
views
How to implement a contract for AAVE V3 "Supply, borrow, withdraw, loan etc" functsions
I am trying to write a contract imported aave-v3 which includes the some aave v3 functions such as supply, borrow, repay etc. I will then make this contract accessible only to its owner.
For example:
/...
0
votes
3
answers
423
views
AttributeError - 'InterfaceContainer' object has no attribute
from brownie import config, network, interface
from scripts.helpful_scripts import get_account
from scripts.get_weth import get_weth
def main():
account = get_account()
erc20_address = config[...
0
votes
1
answer
374
views
revert SafeERC20: low-level call failed
SIO2 is aave v2 foked version on Astar chain. I want to execute flash loan on it and have the following code:
function myFlashLoanCall() public returns (bool){
address receiverAddress = ...
0
votes
0
answers
15
views
aave staking I cannot withdraw usdc tokens earned as rewards in my smart contract
function stake(address _asset, uint256 _amount) public {
require(_amount > 0, "Amount must be greater than 0");
IERC20(_asset).safeTransferFrom(msg.sender, address(this), _amount);...
0
votes
1
answer
20
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 ...
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/...
3
votes
2
answers
165
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 ...
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 ...
2
votes
3
answers
286
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
...
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 & ...
0
votes
0
answers
14
views
AAVE:COOLDOWN_SECONDS and UNSTAKE_WINDOW
AAVE V1 's redeem() function requires us to wait for COOLDOWN_SECONDS and withdraw money in UNSTAKE_WINDOW.
/**
* @dev Redeems staked tokens, and stop earning rewards
* @param to Address to ...
0
votes
1
answer
150
views
How to get user data of Aave pool position inside of Solidity smart contract?
I'm developing a smart contract, which deposits into Aave v3 stablecoin pools. For withdrawal, you have to specify the underlying token address of the a token (e..g usdc address, dai address, ...) and ...
0
votes
1
answer
2k
views
How can I acquire some ERC20 tokens to test AAVE on mumbai testnet?
I need to acquire some DAI or other assets which are supported by AAVE on Mumbai testnet to test my smart contract, but it seems that the AAVE faucet on their site is broken and does not work! (I ...
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 ...
0
votes
0
answers
26
views
Aave's V3 Supply APY
I'm working on a lending protocol that partially based on Aave's V3 interest rate. I'm trying to understand the Supply APY. I only have one rate, don't have a stable and variable rate. I understand ...
0
votes
2
answers
105
views
Calling Aave Lending Pool V2 "Borrow" function returns "reverted with reason string 59"
My smart contract is trying to use stETH as collateral to borrow 250 WETH on the Aave Lending Pool V2, but the borrow function reverts with code 59:
BORROW_ALLOWANCE_NOT_ENOUGH = '59'; // User borrows ...
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 ...
0
votes
0
answers
62
views
How did AAVE dapp calculate the “maximum available withdraw” value (v2)?
I can not find the dapp of aave manage to find the exact amount that I can withdraw.
I have 5 "aUSDC" but when I go on dapp, I can only withdraw 4.3.
I know it's due to the debt of another ...
0
votes
1
answer
127
views
Liquidity Pool Addresses
I am looking to run some analytics on different liquidity pools in Curve, Uniswap and AAVE and for that I need their addresses. Is there any way I can get the list of pools and their contract ...
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 ...
0
votes
0
answers
72
views
ValueError: Gas estimation failed: 'execution reverted'. This transaction will likely revert
Im building an DEFIAPP (AAVE)V3
I do have enough eth
function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external
Added settings:
gas_limit: "100000000000&...
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$)...
0
votes
0
answers
75
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 ...
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'....
0
votes
1
answer
75
views
Credit delegation in Aave not working
I have a question on Aave Credit Delegation. I have gone through the documentation and based on that tried to set it up so that an address that deposits the collateral can delegate the borrowing power ...
0
votes
0
answers
113
views
I am wondering what address do you use to call flashloan?
I am using this address to call flashloan 0x65aFADD39029741B3b8f0756952C74678c9cEC93 but I get Gas estimation failed error please let me know if you use another address and successfully call the ...
0
votes
2
answers
354
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: '...
0
votes
1
answer
122
views
-32000 Execution Reverted - Simple AAVE Price Oracle request
I'm currently in the early stages of learning solidity and diving into the blockchain world; I do have prior programming experience.
I'm currently stumped on something that seems rather trivial, but ...
0
votes
0
answers
23
views
How to increase supplyCap on aave v3
I am working with aave-v3 on testnet deployed from the @aave-v3-deply deployment repo. I am unable to increase the supplyCap on the pool via the poolConfigurator.I have all the permission on the ...
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-...
1
vote
1
answer
636
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://...
0
votes
1
answer
17
views
liquidate undercollateralized user without third party intervention
Im building a simple lending-borrowing protocol, using yield-generating and debt tokenization pattern, and for users liquidation when its position is undercollateralized, i want to liquidate part of ...
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 ...
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, ...
0
votes
1
answer
48
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?
0
votes
1
answer
296
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 ...
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 (...
1
vote
1
answer
168
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, ...
0
votes
1
answer
926
views
AAVE Flashloan: SafeERC20: low-level call failed
I have this flashloan contract here:
pragma solidity ^0.6.6;
import "@aave/protocol-v2/contracts/flashloan/base/FlashLoanReceiverBase.sol";
import "@aave/protocol-v2/contracts/...
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!
0
votes
1
answer
85
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 ...
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 ...
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 ...
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 ...
0
votes
0
answers
157
views
Use AAVE contract in my own contract. cannot estimate gas; transaction may fail or may require manual gas limit
I am tring to use AAVE contract in my own contract. but I have a question on this mysterious error. Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://...
0
votes
2
answers
194
views
Deposit in AAVE v2 contract from HardHat
I'm trying to deposit into AAVE v2 using hardhat.
My code is the following:
const hre = require('hardhat')
...
const contractAddress = '0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9'
const contract = ...