Questions tagged [amm]
The amm tag has no usage guidance.
25
questions
0
votes
0
answers
8
views
Do Balancer swaps only update the state of the Vault?
I'm trying to understand the Balancer v2 architecture.
When a swap occurs in a given pool_id, does this only result in updating the state of the Vault, and pool contracts themselves are just constant ...
1
vote
0
answers
12
views
How to setup routing in pancakeswap
Pancake V2 has this smart order routing(SOR) feature. I was wondering how to build this efficiently, so that I can do permutation and combinations on existing pairs and get their reserves, and thereby ...
0
votes
1
answer
72
views
What is the quote function in UniswapV2Library used for?
What is the purpose of the quote function and how does it differ from getAmountOut?
0
votes
1
answer
185
views
Does the sqrtPricex96 on the Uniswap V3 swap-event represent the average price paid by the swapper, or the new price of the pool after swap?
sqrtPricex96 on a Uniswap V3 swap-event can be used to calculate the token1/token0 price.
I'm not asking how to do this conversion. Instead I'm asking which token1/token0 price does this represent?
...
0
votes
2
answers
52
views
how to make a contract compatible with different ERC-20 Decimals
I'm making a tutorial about how to create an AMM ( Automated Market Maker ), but I have a problem with the decimals. Both tokens have different decimals, and when I want to transfer them, the ...
0
votes
0
answers
17
views
How can i have all the pools addresses of which an user has deposited liquidity to in Uniswapv2 like DEX
how can i have the data like the your liquidity field?
0
votes
0
answers
17
views
Calculate user data in curve
I want to read the data in curve.fi. In this address 0x182B723a58739a9c974cFDB385ceaDb237453c28 is crvstETH gauge. I can get the amount of crvStETH by calling balance of. But i want ot calculate the ...
0
votes
1
answer
377
views
Can someone explain Uniswap's v2 getAmountIn?
Code can be seen here: https://github.com/Uniswap/v2-periphery/blob/master/contracts/libraries/UniswapV2Library.sol#L53
What I don't understand is that if you use the constant product formula, you ...
0
votes
0
answers
67
views
Same ratio of both tokens when adding liquidity in an AMM
I was wondering why, when adding liquidity in an AMM, both tokens should be provided at the same ratio. The reason I found is to prevent price change before and after adding liquidity. But why can't ...
0
votes
1
answer
39
views
How to do Snapshot and extract Token Balances for Holders of UniV2Pair?
Trying to figure out how to get all addresses and balances of all holders for both token0 and token1 from a UniPair and make a snapshot for all individual balances.
What I'm interested in is:
...
0
votes
0
answers
262
views
UniSwap v2 Subgraph return 0 for Volume in USD and ETH
I've forked Uniswap v2 contracts including WETH, and Deployed on Rinkeby. the functionality of Creating Pools, adding and removing liquidity works fine.
Now to get the stats like TVL, Volume, 24hr ...
0
votes
1
answer
59
views
Liquidity pool price and oracle price
I am trying to wrap my head around. I understand the concept of x*y=k vol. when we are calculating this we can get the price but there’s also an exchange price, say eth. That means the pool will have ...
2
votes
2
answers
314
views
Curve AMM - How is fee calculated when adding liquidity?
When adding liquidity to Curve AMM, fees are calculated by the following code
_fee: uint256 = self.fee * N_COINS / (4 * (N_COINS - 1))
https://github.com/curvefi/curve-contract/blob/...
1
vote
2
answers
113
views
How would I create my own amm or exchange?
Good afternoon, I have a goal of making my own amm website similar to pancake swap or uniswap and I don't have great first place to start to break ground on actually developing, I have a some what of ...
1
vote
1
answer
351
views
uniswap price for pair
If I go to https://app.uniswap.org/#/add/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/3000?chain=mainnet I can see liquidity details for USDC-DAI
It looks like ...
1
vote
0
answers
98
views
How to calculate annual percentage yield on an AMM?
A related question has been asked here but a satisfactory answer has not been provided. I understand that APY for x*y=k AMMs is a function of average volume(V), liquidity provided by LP(l), fee(f) and ...
0
votes
1
answer
203
views
How can I get all the holders of an LP token for a date range
Is there any api/contract call sample etc that can help me get a list of everyone who holds an LP token within a particular date range? I. E people who held it thro and never transferred it or sold it
...
1
vote
0
answers
253
views
Looking for a price impact calculator
Looking for a calculator to work out price impact based on differing variables.
Token start price
Liquidity
Total supply of tokens
Buy amount
Usd pair
Cheers 🍻
0
votes
2
answers
3k
views
Swap exact ETH for min tokens not accurate?
Just swapped some tokens on an AMM.
AMM said minimum I will receive was around 282 tokens, I really recevied around 254 tokens.
I had slippage at 12% as the token I was trading takes 10% reflections.
...
1
vote
1
answer
487
views
PancakeSwap charges a fee to mint LP according to their code?
I am looking at the PancakeSwap contract for LP's and I noticed they charge a fee for creating LP's. No where in their documentation does it say there is a fee for depositing liquidity. What is ...
1
vote
0
answers
113
views
Are all of these Dexes just frontend interface to coin swapping contracts? Uniswap, 1inch, balance defi-swap, shibaswap, etc
I'm still wrapping my head around all these swapping services like Uniswap, sushiswap, etc...
Uniswap
Sushiswap
1 Inch
Balancer
Defiswap
Shibaswap
Are all those above just front end interface to ...
3
votes
0
answers
781
views
Uniswap V2 AmountIn Calculation Procedure
So, I was working on a project which heavily uses uniswap.
I have to show the calculations and derivations of stuff that is happening inside uniswap.
So, I was reading it's whitepaper, seeing it ...
0
votes
1
answer
290
views
Is there a way to find out how much I earned in fees from just the UniswapPair V2 contract?
Let's say I add liquidity to the ETH-USDT pool, then I remove liquidity some time later.
In between that time, trades have happened and people have added and removed liquidity too.
I only have what's ...
1
vote
0
answers
586
views
Is the Uniswap v2 0.3% trading fee calculated wrong?
I am digging into the details of how the token swapping fee is calculated and I cannot get a formula that reproduces the expected 0.3% fee.
Let's say there's a USDT-ETH pool with:
1000 USDT
10 ETH
k =...
1
vote
1
answer
444
views
Uniswap WETH_WBTC price is orders of magnitude off when using constant product market maker formula
I am trying to calculate the value of an exchange on Uniswap using Web3js and methods from the Uniswap smart contract.
This is the Uniswap contract address for the WETH (Wrapped Ether) : WBTC (Wrapped ...