-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUNIV3DAIUSDCDD.txt
177 lines (143 loc) · 5.73 KB
/
GUNIV3DAIUSDCDD.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
https://etherscan.io/address/0x5a464C28D19848f44199D003BeF5ecc87d090F87#readContract
Gelato Uniswap DAI/USDC LP - 0.05% fee (0.09% APR)
G-UNI erc20: 0xAbDDAfB225e10B90D798bB8A886238Fb835e2053
G-UNI ilk: 0x47554e49563344414955534443312d4100000000000000000000000000000000
(gem: 0xAbDDAfB225e10B90D798bB8A886238Fb835e2053
xlip: 0x5048c5Cd3102026472f8914557A1FD35c8Dc6c9e)
[ ilkData(bytes32) method Response ] 0x47554e49563344414955534443312d4100000000000000000000000000000000
pos uint96 : 41
join address : 0xbFD445A97e7459b0eBb34cfbd3245750Dba4d7a4
gem address : 0xAbDDAfB225e10B90D798bB8A886238Fb835e2053
dec uint8 : 18
class uint96 : 1
pip address : 0x7F6d78CC0040c87943a0e0c140De3F77a273bd58
xlip address : 0x5048c5Cd3102026472f8914557A1FD35c8Dc6c9e
name string : Gelato Uniswap DAI/USDC LP
symbol string : G-UNI
Gelato Uniswap DAI/USDC2 LP 2 - 0.01% fee (0.08% APR)
ilk: 0x47554e49563344414955534443322d4100000000000000000000000000000000
[ ilkData(bytes32) method Response ]
pos uint96 : 47
join address : 0xA7e4dDde3cBcEf122851A7C8F7A55f23c0Daf335
gem address : 0x50379f632ca68D36E50cfBC8F78fe16bd1499d1e
dec uint8 : 18
class uint96 : 1
pip address : 0xcCBa43231aC6eceBd1278B90c3a44711a00F4e93
xlip address : 0xB55da3d3100C4eBF9De755b6DdC24BF209f6cc06
name string : Gelato Uniswap DAI/USDC LP
symbol string : G-UNI
https://kb.oasis.app/help/earn-with-dai-and-g-uni-multiply
0.05%:
beta.arrakis.finance/#/vaults//0xAbDDAfB225e10B90D798bB8A886238Fb835e2053
0.01%:
https://beta.arrakis.finance/#/vaults/0x50379f632ca68D36E50cfBC8F78fe16bd1499d1e
from brownie import interface
MINT:
yieldBearing = interface.GUniPool("0xAbDDAfB225e10B90D798bB8A886238Fb835e2053")
yieldBearing = Contract("0xAbDDAfB225e10B90D798bB8A886238Fb835e2053")
this = accounts.at("0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503", force=True)
dai = Contract("0x6B175474E89094C44Da98b954EedeAC495271d0F")
usdc = Contract("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48")
dai.approve(yieldBearing, "100000000 ether", {'from': this})
usdc.approve(yieldBearing, "100000000 ether", {'from': this})
yieldBearing.mint("1000 ether", this, {'from': this})
yieldBearing.balanceOf(this)/1e18
BURN:
yieldBearing.burn(1000e18, this, {"from": this})
getUnderlyingBalances[0] = dai
getUnderlyingBalances[1] = usdc
(yieldBearing.getUnderlyingBalances()[0]/1e18+yieldBearing.getUnderlyingBalances()[1]/1e6)/(yieldBearing.totalSupply()/1e18)*1000
---> ratio gives price of GUNI in dollars
PSM:
//DAI-->USDC:
want.approve(psm, token.balanceOf(noob), {"from": noob})
psm.buyGem(noob, token.balanceOf(noob) / otherTokenTo18Conversion);
Multiply:
https://etherscan.io/address/0x2a49eae5cca3f050ebec729cf90cc910fadaf7a2
function getMintAmounts(uint256 amount0Max, uint256 amount1Max)
external
view
returns (
uint256 amount0,
uint256 amount1,
uint256 mintAmount
)
{
uint256 totalSupply = totalSupply();
if (totalSupply > 0) {
(amount0, amount1, mintAmount) = _computeMintAmounts(
totalSupply,
amount0Max,
amount1Max
);
} else {
(uint160 sqrtRatioX96, , , , , , ) = pool.slot0();
uint128 newLiquidity =
LiquidityAmounts.getLiquidityForAmounts(
sqrtRatioX96,
lowerTick.getSqrtRatioAtTick(),
upperTick.getSqrtRatioAtTick(),
amount0Max,
amount1Max
);
mintAmount = uint256(newLiquidity);
(amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(
sqrtRatioX96,
lowerTick.getSqrtRatioAtTick(),
upperTick.getSqrtRatioAtTick(),
newLiquidity
);
}
}
// solhint-disable-next-line function-max-lines, code-complexity
function _computeMintAmounts(
uint256 totalSupply,
uint256 amount0Max,
uint256 amount1Max
)
private
view
returns (
uint256 amount0,
uint256 amount1,
uint256 mintAmount
)
{
(uint256 amount0Current, uint256 amount1Current) =
getUnderlyingBalances();
// compute proportional amount of tokens to mint
if (amount0Current == 0 && amount1Current > 0) {
mintAmount = FullMath.mulDiv(
amount1Max,
totalSupply,
amount1Current
);
} else if (amount1Current == 0 && amount0Current > 0) {
mintAmount = FullMath.mulDiv(
amount0Max,
totalSupply,
amount0Current
);
} else if (amount0Current == 0 && amount1Current == 0) {
revert("");
} else {
// only if both are non-zero
uint256 amount0Mint =
FullMath.mulDiv(amount0Max, totalSupply, amount0Current);
uint256 amount1Mint =
FullMath.mulDiv(amount1Max, totalSupply, amount1Current);
require(amount0Mint > 0 && amount1Mint > 0, "mint 0");
mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;
}
// compute amounts owed to contract
amount0 = FullMath.mulDivRoundingUp(
mintAmount,
amount0Current,
totalSupply
);
amount1 = FullMath.mulDivRoundingUp(
mintAmount,
amount1Current,
totalSupply
);
}