ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
2
Price functionETH reserve
Balloon reserve
3
input reserve2ETH
How much ETH is currently in the DEX
290000000
4
output reserve90000000balloons
How many balloons are currently in the DEX
5
input amount0.6ETH
How much ETH I want to pay
6
input with fee0.5982ETH
How much ETH is left after 0.03% DEX fee is subtracted
7
numerator53838000
8
denominator2.5982
9
price20,721,268.570549balloons
How many balloons I will get for the amount of ETH I'm paying
10
34535447.617581balloons / ETH
Price per balloon
11
12
ETH to Token
How many ballons I can get for the given amount of ETH
13
ETH2ETH
How much ETH I pay
14
ETH reserve2ETH
How much ETH is currently in the DEX
15
token reserve90000000balloons
How many balloons are currently in the dex
16
tokens bought44,932,398.597897balloons
How many balloons I will get for my ETH
17
18
Token to ETH
How much ETH I can get for the given amount of balloons you want to sell to a contract
19
Balloons1balloons
How many balloons I want to sell
20
ETH reserve2ETH
How much ETH is currently in the DEX
21
Token reserve90000000balloons
How many balloons are currently in the dex
22
ETH "bought"0.000000ETH
How much ETH I will get for my balloons
23
24
Adding liquidity to the liquidity pool (deposit function)
25
ETH deposited100ETH
How much ETH I want to add to the liquidity pool
26
ETH reserve2ETH
How much ETH is currently in the DEX
27
Token reserve90000000balloons
How many balloons are currently in the DEX
28
Total liquidity2LP tokens
Assuming there were no swaps in the initial DEX contract, total liquidity is equal to ETH reserve
29
Tokens to deposit4500000000balloons
How many tokens need to be sent to DEX when depositing the given amount of ETH. Calculated based on current liquidity pool ratio.
30
Minted liquidity100LP tokens
How many LP tokens were added to the liquidity pool
31
New total liquidity102LP tokens
Newly minted liquidity added to the previous total
32
33
Removing liquidity from the liquidity pool (withdraw function)
34
Liquidity withdrawn4LP tokens
How many LP tokens are removed from the liquidity pool
35
Total liquidity2LP tokens
Current total liquidity, before removing LP tokens. Assuming there were no swaps in the initial DEX contract, total liquidity is equal to ETH reserve
36
ETH reserve2ETH
How much ETH is currently in the DEX
37
Token reserve90000000balloons
How many balloons are currently in the DEX
38
ETH withdrawn4ETH
How much ETH is removed from the liquidity pool
39
Token withdrawn180000000balloons
How many balloons are withdrawn from the liquidity pool
40
New total liquidity-2LP tokens
New total of the liquidity pool
41
42
43
By: Radek | velvetshark.com
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100