Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniswap #5

Open
Richa-iitr opened this issue Apr 9, 2022 · 1 comment
Open

Uniswap #5

Richa-iitr opened this issue Apr 9, 2022 · 1 comment

Comments

@Richa-iitr
Copy link
Owner

Richa-iitr commented Apr 9, 2022

  • "constant product" market making formula
  • Selling ETH for ERC20 tokens --> increases the size of the ETH reserve and decreases the size of the ERC20 reserve --> shifts the reserve ratio, increasing the ERC20 token's price relative to ETH for subsequent transactions.
  • Limit Order: traders can specify the minimum amount bought on sell orders or the max amount sold on buy orders --> limti order --> automatically cancels if not fulfilled.
  • Transaction deadlines: cancel orders if they are not executed fast enough.
  • Only one exchange per token can be registered
  • Factory contract: can be used to create exchange contracts for any ERC20 token that does not already have one.
  • separate exchange contract for each ERC20 token --> hold reserves of both ETH and their associated ERC20.
@Richa-iitr
Copy link
Owner Author

Richa-iitr commented Apr 9, 2022

Concentrated Liquidity

  • For a pair of tokens X,Y, where we measure price of token X in terms of Y.
  • When providing liquidity for this pair, an LP chooses a price range [𝑝𝑎, 𝑝𝑏] in which they would like to provide liquidity.
  • Together with the current price 𝑝, this determines the ratio of the two tokens the LP needs to deposit.
  • The exact amounts of both tokens the LP decides to deposit then determines the amount of liquidity 𝐿 provided to the interval.
  • When a trade occurs, current price of the pool moves.
  • All LPs earn a portion of the trading fees proportional to the amount of liquidity they provided to the interval by which the price moved.
  • If the price moves outside the chosen range of an LP, the position consists of only one of the two tokens and stops earning fees.
  • Once the price returns to the range, the position earns fees again.
  • Finding real amount of tokens from virtual ones.
    Screenshot from 2022-04-10 02-21-52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant