Questions tagged [amm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
22 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 ...
1
vote
0answers
116 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
0answers
168 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....
0
votes
2answers
2k 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. ...
0
votes
0answers
39 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 ...
0
votes
0answers
7 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?
0
votes
0answers
18 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://...
1
vote
1answer
195 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
0answers
60 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 ...
2
votes
0answers
178 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
1answer
97 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
0answers
330 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
1answer
179 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 ...
0
votes
0answers
15 views

Does it cost more in AMM fees to split a trade into multiple pieces?

Suppose you're trading against an AMM with a static invariant, such as Uniswap v2. I define "static" as meaning the invariant containing no dynamic parameter in the price curve. A good ...