Questions tagged [dex]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
23 views

Why LP is better than order book?

For DEX, most popular ones are using liquidity providers instead of order books while I believe we can build DEX on both models. Then why is LP a better one?
0
votes
0answers
18 views

i need to get the uniswap v3 price for any given swap pair preferably using the v3-sdk

Can anyone provide an example of how to use uniseap-v3 sdk to fetch token swap prices or any other working method
1
vote
1answer
25 views

what is math for uniswap calculates the amountout and amountin why 997 and 1000

function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {//the amount of user,amount in pool,output token amount in pool require(amountIn > ...
0
votes
3answers
245 views

Understanding front running. Why did my transaction fail? (PancakeSwap V2)

I am doing some research on front running transactions. My goal is to purchase a token in PancakeSwap in the same block that liquidity is added. Lets take this token as an example: https://bscscan.com/...
1
vote
0answers
69 views

Is the Uniswap v2 0.03% 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
0answers
74 views

Custom BEP20 token and liquidity pool

What does adding your custom token liquidity really do? Does adding your token to liquidity pool automatically get your token able to be listed or available for other coins?
0
votes
0answers
154 views

How do decentralized exchanges make money?

I've been wondering how do DEXs make money. I know some of them like uniswap and airswap supposedly don't take any profits from trades. But are all DEXs like this? I read on Kyberswap FAQ that the ...
1
vote
1answer
175 views

Fetch price data: on-chain oracle vs smart contract function

I want to get the latest and most accurate price data from Uniswap and found out that I can either call the getAmountsOut() function which gives me the amount of tokens I will get in return of a given ...
3
votes
1answer
4k views

Retrieve price data from PancakeSwap [BSC]

Does PancakeSwap use the same constant product formula as Uniswap (x * y = k)? Because then I should be able to calculate a token pair exchange rate by just dividing the amount of token1 reserves by ...
2
votes
1answer
198 views

Retrieve Mdex.com exchange rates for token pair [Huobi Eco Chain] [closed]

After long Telegram conversations I have found out that MdexSwap uses a secret formula to calculate their token exchange rates on their swap platform. Unlike Uniswap they also don't really have an API,...
0
votes
1answer
45 views

Smart contract with infinity loop fetching DEX prices

I am trying to create an arbitrage bot which swaps between 2 decentralised exchanges. Lots of tutorials say that I need a Javascript or Python program that continuously runs and fetches prices from ...
5
votes
1answer
3k views

Get Uniswap Exchange Rate of any Token with Web3

I need to get the exchange rate for every token on Uniswap with Web3 like Uniswap itself which they then display on their web interface on app.uniswap.org like this: So when I enter to swap the ...
3
votes
1answer
1k views

How much liquidity to provide to Uniswap?

So you deployed your brand new ERC20 token to Uniswap. I understand you need to provide liquidity for your token pair in Uniswap so people can start buying your token. Now, what I'm trying to wrap my ...
0
votes
0answers
36 views

Transactions between ERC-20 Token and DEX on Etherscan

Below is a screenshot of transactions at an address I take to be the ERC-20 token SAND (Sandbox). Is this right? that the link below the image is the singular address where this ERC-20 token issues ...
0
votes
0answers
99 views

Could there be multiple asset pools In a DAMM liquidity pool?

In a DAMM (dynamic automated market making) DEX (decentralized exchange) the ration between two assets, e.g. DAI/ETH does not have to be 50/50 anymore, like it used to be in a AMM, (automated market ...
0
votes
1answer
76 views

copy etherdelta code [closed]

For a test project, I need to write the etherdelta's contract. but "function EtherDelta (address admin_, address feeAccount_, address accountLevelsAddr_, uint feeMake_, uint feeTake_, uint feeRebate_) ...
0
votes
2answers
465 views

Can one fork a decentralized exchange smart contract since the code is out in the open?

Since ethdelta and idex are decentralized exchanges, meaning there is no "central" server. The smart contract code is in the ethereum blockchain. Can one just copy this smart contract and launch a ...