Questions tagged [amm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
18 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 ...
user avatar
  • 105
1 vote
2 answers
227 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/...
user avatar
1 vote
2 answers
42 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 ...
user avatar
  • 11
1 vote
1 answer
98 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 ...
user avatar
1 vote
0 answers
24 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 ...
user avatar
  • 230
0 votes
1 answer
51 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 ...
user avatar
  • 101
0 votes
0 answers
31 views

Difference in Selling big amount of tokens all in one tx or selling all in multiple tx's? (pool draining / high price impact)

I'm wondering whether there's a difference in total received output amount (for ex. in ETH), when selling a big amount of tokens all at once (very high price impact) versus selling all, one after ...
user avatar
  • 11
0 votes
0 answers
27 views

token issuing and liquidity pools basics

I'm starting my journey to learn smart contract development. Want to clear out the basics of new token issuing in a decentralized environment. When creating a new erc20 token "XYZ" and a ...
user avatar
  • 1
1 vote
0 answers
222 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 🍻
user avatar
0 votes
0 answers
325 views

get exact input/output amount pancake swap inside my contract

Pancake frontend using below method to get exact input and output amount for swap. public getOutputAmount(inputAmount: TokenAmount): [TokenAmount, Pair] { invariant(this.involvesToken(inputAmount....
user avatar
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. ...
user avatar
  • 1
0 votes
0 answers
101 views

TypeError: Cannot read property 'getAmountsIn' of undefined BSC Price Bot

new to dapps and newer to coding here - trying to create a pricebot for BSC. As of right now I am only trying to integrate PCS (if I can get thi s to work I'll obviously add more). I am getting this ...
user avatar
0 votes
0 answers
10 views

Launching pegged price tokens on ETH network/

Anyone have experience launching a pegged token value to any type of AMM Dex? Being the price of the asset is always constant. Example would be a stable coin like Vai, Dai, or USDC?
user avatar
0 votes
0 answers
31 views

Getting the token address from new pools on AMM's through API

I'm using bitquery for get the new pools on pancakeswap in nextjs with this code: export async function getStaticProps(context) { const client = new ApolloClient({ uri: "https://...
user avatar
1 vote
1 answer
345 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 ...
user avatar
  • 129
1 vote
0 answers
87 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 ...
user avatar
2 votes
0 answers
403 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 ...
user avatar
0 votes
1 answer
165 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 ...
user avatar
  • 245
1 vote
0 answers
452 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 =...
user avatar
  • 245
1 vote
1 answer
329 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 ...
user avatar
  • 113