Skip to main content

Questions tagged [defi]

Decentralized finance offers financial instruments without relying on intermediaries such as brokerages, exchanges, or banks by using smart contracts on a blockchain.

Filter by
Sorted by
Tagged with
1 vote
0 answers
14 views

Most Ethereum Wallets are unable to properly estimate the gas for this transaction - is it a recurring bug?

These are two defi transactions that are doing a loan rollover on mainnet: borrowing money from Aave to pay off a loan and open a new loan. When i simulate them in tenderly it looks like they run out ...
admazzola's user avatar
  • 121
0 votes
0 answers
14 views

Error: VM Exception while processing transaction: reverted with reason string '1inch swap failed'

Error: VM Exception while processing transaction: reverted with reason string '1inch swap failed'this error came when I run 1inch swap functions. swap code as below IAggregationRouterV6....
Bmroxx Roxx's user avatar
1 vote
1 answer
27 views

Damn Vulnerable

I'm currently working on a smart contract challenge from Damn Vulnerable DeFi (or a similar CTF) and I'm trying to solve it without watching any walkthrough videos. I've been analyzing the contract ...
serpent0x's user avatar
0 votes
0 answers
26 views

What is Collateral swap? How to get benefits from this feature?

Let's say ETH price is $3,000 and wstETH price is $3,500. I have collateral using ETH on Aave. and tomorrow ETH price is $2,950 and wstETH price is $3,650. I did swap my collateral from ETH to wstETH. ...
Ijimai Damemai's user avatar
1 vote
0 answers
28 views

Can I just earn ETH by buying a stablecoin and then burn it getting someone's collateral back?

I am just learning how stablecoins work. And I learned that some of them work by requiring a user that wants to mint a token to provide some collateral that has to be worth more. I think it is call &...
Andrew Slock's user avatar
1 vote
0 answers
91 views

Is it possible to submit private bundled transactions on chains other than ethereum mainnet?

my ethereum wallet was hacked via chrome extension and my private key was leaked. After stealing all my main assets, he left me about 20% of my networth in the account and has setup a sniper bots on ...
Nikhil Kolte's user avatar
0 votes
1 answer
12 views

Issues due to openzeppelin updated versions

Im building defi token Im developing it with reference cource in which the educator is using openzeppelin version 4.8.3 in which ERC20Mock contract takes 4 parameters , but right now there is only ...
user139686's user avatar
0 votes
0 answers
14 views

What is the purpose of notfiyRewardAmount for staking contract?

Video from 7:40 doesn't explain clearly on how notfiyRewardAmount: https://www.youtube.com/watch?v=OJ-IRzCYSXI Why do we need the owner to call it? Doesn't that contract already holds the amount of ...
anonauditor's user avatar
0 votes
0 answers
10 views

Tokenized margin positions

Is there a protocol in DeFi that tokenizes long & short positions? So you're able to buy a token that represents all variables from N position.
dNyrM's user avatar
  • 948
0 votes
2 answers
94 views

Are cross-chain Decentralized Exchanges and cross-chain bridges are the same?

I am newbie at DeFi. I am struggling with understanding what does author of Yellow paper of LayerZero mean in this sentence: "Currently, to convert between tokens of two chains, a user must ...
hardhat-enjoyer's user avatar
0 votes
0 answers
21 views

why the error is not checked in Hex2Bytes of bytes.go?

https://github.com/ethereum/go-ethereum/blob/master/common/bytes.go I am looking at the following codes https://github.com/ethereum/go-ethereum/blob/a3829178af6cec64d6def9131b9340a3328cc4fc/common/...
ak tech's user avatar
0 votes
0 answers
8 views

Missing transaction [duplicate]

MISSING TRANSACTION I have no idea what went wrong here but I had tried to send two tokens to my coinbase wallet from my crypto. Com defi wallet . And it never arrived . I also messed up and sent a ...
FrozenFury's user avatar
3 votes
1 answer
70 views

How does Uniswap v3-core derive the look up table used in TickMath?

Background In TickMath.sol of v3-core codebase, getSqrtRatioAtTick(int24 tick) implements \sqrt{1.0001}^n with binary fixed point arithmetics in Q128 and down casts to Q96. With a lookup table of Q128 ...
scad's user avatar
  • 31
0 votes
2 answers
194 views

UniSwapV2 Testnet Support

As you may be aware, the Goerli Testnet has been deprecated, and furthermore, UniSwapV2 is not supported on the Sepolia Testnet. What would be the recommended solution? Thank you in advance.
rebwar's user avatar
  • 3
0 votes
1 answer
50 views

Type address is not implicitly convertible to expected type struct HelperConfig.NetworkConfig memory

Why even if I am returning a struct from a function then if I initialize another variable with the struct type it is showing me the following error: Type address is not implicitly convertible to ...
Nirban Chakraborty's user avatar
1 vote
0 answers
74 views

Calculate value of Uniswap V3 position

The valuation of Uniswap V2 positions seems to be pretty straightforward through the subgraph. All I need to do is query a user's LP token balances, and then determine the price of each LP token, ...
x_X's user avatar
  • 21
1 vote
0 answers
44 views

Manipulate Uniswap oracles

Is it practically safe to consume from Uniswap v3 spot TWAP oracles on big pairs like WETH/USDC for example? I mean, I know it's technically possible to manipulate them, but based on this article, it ...
dNyrM's user avatar
  • 948
1 vote
1 answer
73 views

What are the correct units and parameters for generating swap calldata using the 1inch API?

I using the 1inch API to build a dex and am struggling to execute a swap correctly. I believe the problem may have to due with when to use WEI and when to use the actual number of tokens I am desiring ...
user23470409's user avatar
0 votes
1 answer
230 views

Token Balance not changing after simulating swap on uniswap v2

Hi I am trying to mock the process of buying and selling token through uniswap v2 router. I start with a local network fork anvil --fork-url https://mainnet.infura.io/xxx Then I have to do 2 things ...
newbiesolidty's user avatar
0 votes
0 answers
187 views

Uniswap UniversalRouter/Permit2 integration problem

I'm trying to use the UniversalRouter and Permit2 contracts on Sepolia. I'm trying to swap from UNI to WETH. I get Error: transaction failed, reason: 'transaction failed', code: 'CALL_EXCEPTION' //...
Matt's user avatar
  • 1
0 votes
1 answer
90 views

How to decode internal transaction in mempool

i'm researching on how mev works. I know that they are watching all pending transactions, then define function that is swap on dex and calculate amount to do sandwitch. However, when user do a swap, ...
dang.pm.IT's user avatar
1 vote
2 answers
404 views

What happens when we directly send tokens to Uniswap pair?

This is about Uni V2 pools. So usually we call the function addLiquidity to add liquidity, but the function decides how many tokens should be added depending on the reserves. What if we directly send ...
Solidity Nerd's user avatar
0 votes
0 answers
116 views

Transaction Reverting with my smart contract

I am making a defi page using uniswap v2 router, but my transaction are reverting. Here is my swapToken.sol contract:- Pls help me in this, to fix this issue. Also link to the expolorer - https://...
Swarnabha Sinha's user avatar
0 votes
1 answer
492 views

How to Calculate SqrtPriceX96 for a Specific Percentage Change in Uniswap v3?

I am working with Uniswap v3 and need to calculate the sqrtPriceX96 value that is exactly 5% (or any other percentage) above or below the current pool price. I understand that each tick in Uniswap v3 ...
MShakeG's user avatar
  • 1,855
3 votes
1 answer
879 views

What is a returnbomb attack?

I've read that when making an external call to an unknown contract, if the contract returns a large amount of random or junk byte it will cause some type of bug. But I dont know exact what it is and ...
kumar's user avatar
  • 71
0 votes
1 answer
18 views

Is there any other use-case of having a decentralised network other than majorly DeFi and GameFi?

I have been familiar with the Web3 ecosystem for almost 2-years now. But I still fail to understand if there is any other real world use-case for a decentralised network other than DeFi, ICOs and NFTs ...
MT 16's user avatar
  • 45
0 votes
1 answer
192 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
1 answer
21 views

Purpose of pegged asssets

I'm auditing my first smart contract for a protocol that issues pegged assets collateralized by liquid ETH staking tokens. It also has a decentralized orderbook exchange where you can buy and sell the ...
auditor_chick's user avatar
0 votes
1 answer
10 views

How the uint changes to address type in solidity when using delegatecall?

pragma solidity ^0.8.18; contract One{ address public first; address public second; address public third; function setaddress(address _address)public { third = _address; }...
kumar's user avatar
  • 71
1 vote
0 answers
13 views

Would a circuit breaker feature always execute one block after the trigger is detected?

Lets say I had a Dapp that used a popular stablecoin whereby the stablecoin had a freeze function. Then say I wanted to detect if the stablecoin accounts were frozen and then circuit break the Dapp. ...
zunior's user avatar
  • 1,322
2 votes
1 answer
550 views

Best practices for staking contract which redistributes variable stablecoin input (cash flow)

I need to develop an Staking contract which allows users to: Stake their tokens Claim rewards Unstake their tokens (no more rewards afterwards) I have been researching about different examples like ...
Alexander Herranz's user avatar
1 vote
0 answers
112 views

Reverted when adding another logic in Uniswap swap functions

I have been learning how to use Uniswap V2 recently and am trying to add logic on top of the original code. I want to have a fee of 1% on each swap transaction using the input token. I was ...
rasyidred's user avatar
0 votes
1 answer
52 views

I need 1000 Ethereum wallets for load testing of my project, is there a way i can get that?

I have to test out the functionality of auto reinvest in my smart contract in staking, therefore I need about 1000 Ethereum wallets to test out my code! Please help me out here if there is any ...
Talha Sajid Chaudhary's user avatar
0 votes
1 answer
24 views

value for transaction for stable price with chainlink price feed

I have an NFT marketplace contract that sells NFTs with stable price and uses chainlink aggregator for price feed. the contract code is like this: import "@chainlink/contracts/src/v0.8/...
Sepehr Mirnasrollahi's user avatar
4 votes
5 answers
7k views

Error: contract runner does not support sending transactions (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=6.6.3)

I got this error when tried to deposit eth to weth contact from mainnet, using hardhat forking, does anyone know how to fix this error ? const { getNamedAccounts, ethers, } = require("hardhat&...
sohd9's user avatar
  • 325
0 votes
1 answer
2k views

What are Ethereum Genesis transactions?

I recently came across these transactions on Ethereum that don't have a typical transaction hash. They are sent by a wallet named "GENESIS," which is not associated with any specific address ...
0xWenMoon's user avatar
1 vote
1 answer
30 views

Implementing vote escrow with multiple positions and non-linear decay

I want to do vote escrow. I know that Curve is the most popular implementation. My problem with it is I want to allow multiple positions and a non-linear decay. I'd like to not write from scratch. ...
lukerogerson's user avatar
1 vote
0 answers
12 views

When using the zodiac modulue my transaction simulation works but, when i try executing my transaction on tally it reverts the transaction

i keep trying to use the zodiac govener module on my gnosis safe but no transaction is working at all, ive followed the youtube guide and firstly when i use the transaction encoder i get this error ...
shuayb's user avatar
  • 11
1 vote
1 answer
568 views

Liquidity provisioning with yield-bearing tokens

I want to add liquidity to a pool with a yield-bearing token, such as stETH/ETH. Where does the yield of this token go to? Does it just go to the smart contract and gets owned by the smart contract, ...
João Areias's user avatar
1 vote
1 answer
342 views

Uniswap V3 Active Liquidity Provision

I am trying out different strategies for UniSwap active liquidity management. I have been reading different articles on the best strategy and the most popular one seems to be using Bollinger Band. I ...
user122663's user avatar
1 vote
1 answer
2k views

How to access or calculate slippage from Uniswap-V3 trades on-chain?

I know we can extract swapping information on a Uniswap V3 LP pool (for example - https://info.uniswap.org/#/polygon/pools/0xefa98fdf168f372e5e9e9b910fcdfd65856f3986). Is there a way to find out the ...
KubiK888's user avatar
  • 123
1 vote
1 answer
202 views

implementing chart like Dextool's chart for my react.js application

I'm gonna implement chart into my react.js application. Chart method should be similar to dextools. Now I try to use GraphQL to retrieve all trading histories. And also I'm gonna use OHLC react chart ...
Kevin Lee's user avatar
  • 128
1 vote
0 answers
27 views

How does Curve's economic model sustain itself despite such low trading fees?

I've been providing LP on Curve's stETH/ETH pool for some time now, but I'm finding the trading fee rewards to be somewhat disappointing. This led me to wonder about the long-term sustainability of ...
Hinoon's user avatar
  • 11
1 vote
2 answers
71 views

Ways to earn ETH passive income

I have a decent amount of ETH in my cold wallet (<32 ETH). These bag of ETH is my HODL bag, meaning that I don't want to spend it and I am planning to hold it for the next 10-20 years. What are my ...
Chunior's user avatar
  • 11
1 vote
0 answers
32 views

why does the staking.sol contract have permissions on the notifyReward function?

In both this example and this example the notifyReward function has a modifier that only allows the owner to distribute rewards. function notifyRewardAmount( uint _amount ) external ...
Dylan Kerler's user avatar
3 votes
1 answer
42 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
1 vote
0 answers
43 views

My createTokenPair function isnt working when I call it from my frontend please help

Hello, I`ve forked Uniswap V2 perfectly fine on the backend and now I want to connect it to my frontend. I have built a basic webpage and I am now doing the frontend. When calling the createPair ...
CheeseMcBurger's user avatar
1 vote
0 answers
412 views

Calculate liquidity of UniSwap v3 pool based on ticks

If I mint position at T0 with the current Tick, upper tick, lower tick and position value (in USDC), how can I calculate total liquidity in the UniSwap V3 ETH/USDC pool? I would greatly appreciate any ...
Porsche Lim's user avatar
1 vote
1 answer
21 views

How to deploy a smart contract with the help of Api on bsctestnet

I have created one smart contract and want to create a button on the frontend which will deploy the contract to the testnet whenever we click on it, So is this can be done through an API, and if yes ...
Raju Raj Kishore's user avatar
0 votes
0 answers
74 views

Why do number of tokens I put in liquidity pool reduce? - Impermanent loss

Why is it that when the price changes, my number of tokens is reduced and not the price of each token? Shouldn't the number of tokens I hold stay constant so here I would still have 10 A and 10 B ...
IBeFrogs's user avatar

1
2 3 4 5