@curvefi/llamalend-api 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +40 -0
- package/.github/workflows/lint.yml +15 -0
- package/.github/workflows/publish.yml +55 -0
- package/LICENSE +21 -0
- package/README.md +1976 -0
- package/lib/cache/index.d.ts +14 -0
- package/lib/cache/index.js +31 -0
- package/lib/constants/L2Networks.d.ts +1 -0
- package/lib/constants/L2Networks.js +1 -0
- package/lib/constants/abis/Controller.json +1027 -0
- package/lib/constants/abis/ERC20.json +222 -0
- package/lib/constants/abis/ERC4626.json +1674 -0
- package/lib/constants/abis/GaugeController.json +794 -0
- package/lib/constants/abis/GaugeFactoryMainnet.json +1 -0
- package/lib/constants/abis/GaugeFactorySidechain.json +475 -0
- package/lib/constants/abis/GaugeV5.json +958 -0
- package/lib/constants/abis/LeverageZap.json +35 -0
- package/lib/constants/abis/Llamma.json +984 -0
- package/lib/constants/abis/Minter.json +1 -0
- package/lib/constants/abis/MonetaryPolicy.json +221 -0
- package/lib/constants/abis/OneWayLendingFactoryABI.json +899 -0
- package/lib/constants/abis/SidechainGauge.json +939 -0
- package/lib/constants/abis/Vault.json +721 -0
- package/lib/constants/abis/crvUSD/DeleverageZap.json +248 -0
- package/lib/constants/abis/crvUSD/Factory.json +514 -0
- package/lib/constants/abis/crvUSD/HealthCalculatorZap.json +54 -0
- package/lib/constants/abis/crvUSD/LeverageZap.json +312 -0
- package/lib/constants/abis/crvUSD/MonetaryPolicy.json +294 -0
- package/lib/constants/abis/crvUSD/MonetaryPolicy2.json +299 -0
- package/lib/constants/abis/crvUSD/PegKeeper.json +411 -0
- package/lib/constants/abis/crvUSD/controller.json +991 -0
- package/lib/constants/abis/crvUSD/llamma.json +984 -0
- package/lib/constants/abis/gas_oracle_optimism.json +149 -0
- package/lib/constants/abis/gas_oracle_optimism_blob.json +203 -0
- package/lib/constants/aliases.d.ts +16 -0
- package/lib/constants/aliases.js +124 -0
- package/lib/constants/coins.d.ts +16 -0
- package/lib/constants/coins.js +24 -0
- package/lib/constants/llammas.d.ts +2 -0
- package/lib/constants/llammas.js +96 -0
- package/lib/constants/utils.d.ts +4 -0
- package/lib/constants/utils.js +27 -0
- package/lib/external-api.d.ts +13 -0
- package/lib/external-api.js +436 -0
- package/lib/index.d.ts +104 -0
- package/lib/index.js +123 -0
- package/lib/interfaces.d.ts +228 -0
- package/lib/interfaces.js +1 -0
- package/lib/lendMarkets/LendMarketTemplate.d.ts +510 -0
- package/lib/lendMarkets/LendMarketTemplate.js +4682 -0
- package/lib/lendMarkets/index.d.ts +3 -0
- package/lib/lendMarkets/index.js +3 -0
- package/lib/lendMarkets/lendMarketConstructor.d.ts +2 -0
- package/lib/lendMarkets/lendMarketConstructor.js +6 -0
- package/lib/llamalend.d.ts +80 -0
- package/lib/llamalend.js +878 -0
- package/lib/mintMarkets/MintMarketTemplate.d.ts +308 -0
- package/lib/mintMarkets/MintMarketTemplate.js +2998 -0
- package/lib/mintMarkets/index.d.ts +3 -0
- package/lib/mintMarkets/index.js +3 -0
- package/lib/mintMarkets/mintMarketConstructor.d.ts +2 -0
- package/lib/mintMarkets/mintMarketConstructor.js +4 -0
- package/lib/st-crvUSD.d.ts +35 -0
- package/lib/st-crvUSD.js +505 -0
- package/lib/utils.d.ts +58 -0
- package/lib/utils.js +661 -0
- package/package.json +42 -0
- package/src/cache/index.ts +41 -0
- package/src/constants/L2Networks.ts +1 -0
- package/src/constants/abis/Controller.json +1027 -0
- package/src/constants/abis/ERC20.json +222 -0
- package/src/constants/abis/ERC4626.json +1674 -0
- package/src/constants/abis/GaugeController.json +794 -0
- package/src/constants/abis/GaugeFactoryMainnet.json +1 -0
- package/src/constants/abis/GaugeFactorySidechain.json +475 -0
- package/src/constants/abis/GaugeV5.json +958 -0
- package/src/constants/abis/LeverageZap.json +35 -0
- package/src/constants/abis/Llamma.json +984 -0
- package/src/constants/abis/Minter.json +1 -0
- package/src/constants/abis/MonetaryPolicy.json +221 -0
- package/src/constants/abis/OneWayLendingFactoryABI.json +899 -0
- package/src/constants/abis/SidechainGauge.json +939 -0
- package/src/constants/abis/Vault.json +721 -0
- package/src/constants/abis/crvUSD/DeleverageZap.json +248 -0
- package/src/constants/abis/crvUSD/ERC20.json +222 -0
- package/src/constants/abis/crvUSD/Factory.json +514 -0
- package/src/constants/abis/crvUSD/HealthCalculatorZap.json +54 -0
- package/src/constants/abis/crvUSD/LeverageZap.json +312 -0
- package/src/constants/abis/crvUSD/MonetaryPolicy.json +294 -0
- package/src/constants/abis/crvUSD/MonetaryPolicy2.json +299 -0
- package/src/constants/abis/crvUSD/PegKeeper.json +411 -0
- package/src/constants/abis/crvUSD/controller.json +991 -0
- package/src/constants/abis/crvUSD/llamma.json +984 -0
- package/src/constants/abis/gas_oracle_optimism.json +149 -0
- package/src/constants/abis/gas_oracle_optimism_blob.json +203 -0
- package/src/constants/aliases.ts +141 -0
- package/src/constants/coins.ts +41 -0
- package/src/constants/llammas.ts +99 -0
- package/src/constants/utils.ts +33 -0
- package/src/external-api.ts +325 -0
- package/src/index.ts +128 -0
- package/src/interfaces.ts +237 -0
- package/src/lendMarkets/LendMarketTemplate.ts +3022 -0
- package/src/lendMarkets/index.ts +7 -0
- package/src/lendMarkets/lendMarketConstructor.ts +7 -0
- package/src/llamalend.ts +785 -0
- package/src/mintMarkets/MintMarketTemplate.ts +1781 -0
- package/src/mintMarkets/index.ts +7 -0
- package/src/mintMarkets/mintMarketConstructor.ts +5 -0
- package/src/st-crvUSD.ts +244 -0
- package/src/utils.ts +497 -0
- package/test/fetch.test.ts +152 -0
- package/test/general.test.ts +216 -0
- package/test/leverageBorrowMore.test.ts +245 -0
- package/test/leverageCreateLoan.test.ts +236 -0
- package/test/leverageRepay.test.ts +240 -0
- package/test/readme.test.ts +475 -0
- package/test/selfLiquidate.test.ts +57 -0
- package/test/selfLiquidateCrvUSD.test.ts +54 -0
- package/test/st_crvUSD.test.ts +68 -0
- package/test/swap.test.ts +62 -0
- package/test/swapCrvUSD.test.ts +56 -0
- package/test/vault.test.ts +112 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +72 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [],
|
|
4
|
+
"stateMutability": "nonpayable",
|
|
5
|
+
"type": "constructor"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"inputs": [],
|
|
9
|
+
"name": "DECIMALS",
|
|
10
|
+
"outputs": [
|
|
11
|
+
{
|
|
12
|
+
"internalType": "uint256",
|
|
13
|
+
"name": "",
|
|
14
|
+
"type": "uint256"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"stateMutability": "view",
|
|
18
|
+
"type": "function"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"inputs": [],
|
|
22
|
+
"name": "baseFee",
|
|
23
|
+
"outputs": [
|
|
24
|
+
{
|
|
25
|
+
"internalType": "uint256",
|
|
26
|
+
"name": "",
|
|
27
|
+
"type": "uint256"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"stateMutability": "view",
|
|
31
|
+
"type": "function"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"inputs": [],
|
|
35
|
+
"name": "decimals",
|
|
36
|
+
"outputs": [
|
|
37
|
+
{
|
|
38
|
+
"internalType": "uint256",
|
|
39
|
+
"name": "",
|
|
40
|
+
"type": "uint256"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"stateMutability": "pure",
|
|
44
|
+
"type": "function"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"inputs": [],
|
|
48
|
+
"name": "gasPrice",
|
|
49
|
+
"outputs": [
|
|
50
|
+
{
|
|
51
|
+
"internalType": "uint256",
|
|
52
|
+
"name": "",
|
|
53
|
+
"type": "uint256"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"stateMutability": "view",
|
|
57
|
+
"type": "function"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"inputs": [
|
|
61
|
+
{
|
|
62
|
+
"internalType": "bytes",
|
|
63
|
+
"name": "_data",
|
|
64
|
+
"type": "bytes"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"name": "getL1Fee",
|
|
68
|
+
"outputs": [
|
|
69
|
+
{
|
|
70
|
+
"internalType": "uint256",
|
|
71
|
+
"name": "",
|
|
72
|
+
"type": "uint256"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"stateMutability": "view",
|
|
76
|
+
"type": "function"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"inputs": [
|
|
80
|
+
{
|
|
81
|
+
"internalType": "bytes",
|
|
82
|
+
"name": "_data",
|
|
83
|
+
"type": "bytes"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"name": "getL1GasUsed",
|
|
87
|
+
"outputs": [
|
|
88
|
+
{
|
|
89
|
+
"internalType": "uint256",
|
|
90
|
+
"name": "",
|
|
91
|
+
"type": "uint256"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"stateMutability": "view",
|
|
95
|
+
"type": "function"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"inputs": [],
|
|
99
|
+
"name": "l1BaseFee",
|
|
100
|
+
"outputs": [
|
|
101
|
+
{
|
|
102
|
+
"internalType": "uint256",
|
|
103
|
+
"name": "",
|
|
104
|
+
"type": "uint256"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"stateMutability": "view",
|
|
108
|
+
"type": "function"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"inputs": [],
|
|
112
|
+
"name": "overhead",
|
|
113
|
+
"outputs": [
|
|
114
|
+
{
|
|
115
|
+
"internalType": "uint256",
|
|
116
|
+
"name": "",
|
|
117
|
+
"type": "uint256"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"stateMutability": "view",
|
|
121
|
+
"type": "function"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"inputs": [],
|
|
125
|
+
"name": "scalar",
|
|
126
|
+
"outputs": [
|
|
127
|
+
{
|
|
128
|
+
"internalType": "uint256",
|
|
129
|
+
"name": "",
|
|
130
|
+
"type": "uint256"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"stateMutability": "view",
|
|
134
|
+
"type": "function"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"inputs": [],
|
|
138
|
+
"name": "version",
|
|
139
|
+
"outputs": [
|
|
140
|
+
{
|
|
141
|
+
"internalType": "string",
|
|
142
|
+
"name": "",
|
|
143
|
+
"type": "string"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"stateMutability": "view",
|
|
147
|
+
"type": "function"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [],
|
|
4
|
+
"name": "DECIMALS",
|
|
5
|
+
"outputs": [
|
|
6
|
+
{
|
|
7
|
+
"internalType": "uint256",
|
|
8
|
+
"name": "",
|
|
9
|
+
"type": "uint256"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"stateMutability": "view",
|
|
13
|
+
"type": "function"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"inputs": [],
|
|
17
|
+
"name": "baseFee",
|
|
18
|
+
"outputs": [
|
|
19
|
+
{
|
|
20
|
+
"internalType": "uint256",
|
|
21
|
+
"name": "",
|
|
22
|
+
"type": "uint256"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"stateMutability": "view",
|
|
26
|
+
"type": "function"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"inputs": [],
|
|
30
|
+
"name": "baseFeeScalar",
|
|
31
|
+
"outputs": [
|
|
32
|
+
{
|
|
33
|
+
"internalType": "uint32",
|
|
34
|
+
"name": "",
|
|
35
|
+
"type": "uint32"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"stateMutability": "view",
|
|
39
|
+
"type": "function"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"inputs": [],
|
|
43
|
+
"name": "blobBaseFee",
|
|
44
|
+
"outputs": [
|
|
45
|
+
{
|
|
46
|
+
"internalType": "uint256",
|
|
47
|
+
"name": "",
|
|
48
|
+
"type": "uint256"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"stateMutability": "view",
|
|
52
|
+
"type": "function"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"inputs": [],
|
|
56
|
+
"name": "blobBaseFeeScalar",
|
|
57
|
+
"outputs": [
|
|
58
|
+
{
|
|
59
|
+
"internalType": "uint32",
|
|
60
|
+
"name": "",
|
|
61
|
+
"type": "uint32"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"stateMutability": "view",
|
|
65
|
+
"type": "function"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"inputs": [],
|
|
69
|
+
"name": "decimals",
|
|
70
|
+
"outputs": [
|
|
71
|
+
{
|
|
72
|
+
"internalType": "uint256",
|
|
73
|
+
"name": "",
|
|
74
|
+
"type": "uint256"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"stateMutability": "pure",
|
|
78
|
+
"type": "function"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"inputs": [],
|
|
82
|
+
"name": "gasPrice",
|
|
83
|
+
"outputs": [
|
|
84
|
+
{
|
|
85
|
+
"internalType": "uint256",
|
|
86
|
+
"name": "",
|
|
87
|
+
"type": "uint256"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"stateMutability": "view",
|
|
91
|
+
"type": "function"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"inputs": [
|
|
95
|
+
{
|
|
96
|
+
"internalType": "bytes",
|
|
97
|
+
"name": "_data",
|
|
98
|
+
"type": "bytes"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"name": "getL1Fee",
|
|
102
|
+
"outputs": [
|
|
103
|
+
{
|
|
104
|
+
"internalType": "uint256",
|
|
105
|
+
"name": "",
|
|
106
|
+
"type": "uint256"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"stateMutability": "view",
|
|
110
|
+
"type": "function"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"inputs": [
|
|
114
|
+
{
|
|
115
|
+
"internalType": "bytes",
|
|
116
|
+
"name": "_data",
|
|
117
|
+
"type": "bytes"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"name": "getL1GasUsed",
|
|
121
|
+
"outputs": [
|
|
122
|
+
{
|
|
123
|
+
"internalType": "uint256",
|
|
124
|
+
"name": "",
|
|
125
|
+
"type": "uint256"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"stateMutability": "view",
|
|
129
|
+
"type": "function"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"inputs": [],
|
|
133
|
+
"name": "isEcotone",
|
|
134
|
+
"outputs": [
|
|
135
|
+
{
|
|
136
|
+
"internalType": "bool",
|
|
137
|
+
"name": "",
|
|
138
|
+
"type": "bool"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"stateMutability": "view",
|
|
142
|
+
"type": "function"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"inputs": [],
|
|
146
|
+
"name": "l1BaseFee",
|
|
147
|
+
"outputs": [
|
|
148
|
+
{
|
|
149
|
+
"internalType": "uint256",
|
|
150
|
+
"name": "",
|
|
151
|
+
"type": "uint256"
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"stateMutability": "view",
|
|
155
|
+
"type": "function"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"inputs": [],
|
|
159
|
+
"name": "overhead",
|
|
160
|
+
"outputs": [
|
|
161
|
+
{
|
|
162
|
+
"internalType": "uint256",
|
|
163
|
+
"name": "",
|
|
164
|
+
"type": "uint256"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"stateMutability": "view",
|
|
168
|
+
"type": "function"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"inputs": [],
|
|
172
|
+
"name": "scalar",
|
|
173
|
+
"outputs": [
|
|
174
|
+
{
|
|
175
|
+
"internalType": "uint256",
|
|
176
|
+
"name": "",
|
|
177
|
+
"type": "uint256"
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
"stateMutability": "view",
|
|
181
|
+
"type": "function"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"inputs": [],
|
|
185
|
+
"name": "setEcotone",
|
|
186
|
+
"outputs": [],
|
|
187
|
+
"stateMutability": "nonpayable",
|
|
188
|
+
"type": "function"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"inputs": [],
|
|
192
|
+
"name": "version",
|
|
193
|
+
"outputs": [
|
|
194
|
+
{
|
|
195
|
+
"internalType": "string",
|
|
196
|
+
"name": "",
|
|
197
|
+
"type": "string"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"stateMutability": "view",
|
|
201
|
+
"type": "function"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const ALIASES_ETHEREUM: import("../interfaces.js").IDict<string>;
|
|
2
|
+
export declare const ALIASES_POLYGON: import("../interfaces.js").IDict<string>;
|
|
3
|
+
export declare const ALIASES_FANTOM: import("../interfaces.js").IDict<string>;
|
|
4
|
+
export declare const ALIASES_AVALANCHE: import("../interfaces.js").IDict<string>;
|
|
5
|
+
export declare const ALIASES_ARBITRUM: import("../interfaces.js").IDict<string>;
|
|
6
|
+
export declare const ALIASES_OPTIMISM: import("../interfaces.js").IDict<string>;
|
|
7
|
+
export declare const ALIASES_XDAI: import("../interfaces.js").IDict<string>;
|
|
8
|
+
export declare const ALIASES_MOONBEAM: import("../interfaces.js").IDict<string>;
|
|
9
|
+
export declare const ALIASES_AURORA: import("../interfaces.js").IDict<string>;
|
|
10
|
+
export declare const ALIASES_KAVA: import("../interfaces.js").IDict<string>;
|
|
11
|
+
export declare const ALIASES_CELO: import("../interfaces.js").IDict<string>;
|
|
12
|
+
export declare const ALIASES_ZKSYNC: import("../interfaces.js").IDict<string>;
|
|
13
|
+
export declare const ALIASES_BASE: import("../interfaces.js").IDict<string>;
|
|
14
|
+
export declare const ALIASES_BSC: import("../interfaces.js").IDict<string>;
|
|
15
|
+
export declare const ALIASES_FRAXTAL: import("../interfaces.js").IDict<string>;
|
|
16
|
+
export declare const ALIASES_SONIC: import("../interfaces.js").IDict<string>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { lowerCaseValues } from "./utils.js";
|
|
2
|
+
export var ALIASES_ETHEREUM = lowerCaseValues({
|
|
3
|
+
"crv": "0xD533a949740bb3306d119CC777fa900bA034cd52",
|
|
4
|
+
"one_way_factory": "0xeA6876DDE9e3467564acBeE1Ed5bac88783205E0",
|
|
5
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
6
|
+
"minter": '0xd061D61a4d941c39E5453435B6345Dc261C2fcE0',
|
|
7
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
8
|
+
// "leverage_zap": "0x3294514B78Df4Bb90132567fcf8E5e99f390B687", // 1inch
|
|
9
|
+
"leverage_zap": "0xC5898606BdB494a994578453B92e7910a90aA873",
|
|
10
|
+
"leverage_markets_start_id": "9",
|
|
11
|
+
"crvUSD": "0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E",
|
|
12
|
+
"st_crvUSD": "0x0655977FEb2f289A4aB78af67BAB0d17aAb84367",
|
|
13
|
+
});
|
|
14
|
+
export var ALIASES_POLYGON = lowerCaseValues({
|
|
15
|
+
"crv": "0x172370d5cd63279efa6d502dab29171933a610af",
|
|
16
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
17
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
18
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
19
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
20
|
+
});
|
|
21
|
+
export var ALIASES_FANTOM = lowerCaseValues({
|
|
22
|
+
"crv": "0x1E4F97b9f9F913c46F1632781732927B9019C68b",
|
|
23
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
24
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
25
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
26
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
27
|
+
});
|
|
28
|
+
export var ALIASES_AVALANCHE = lowerCaseValues({
|
|
29
|
+
"crv": "0x47536F17F4fF30e64A96a7555826b8f9e66ec468",
|
|
30
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
31
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
32
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
33
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
34
|
+
});
|
|
35
|
+
export var ALIASES_ARBITRUM = lowerCaseValues({
|
|
36
|
+
"crv": "0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978",
|
|
37
|
+
"one_way_factory": "0xcaEC110C784c9DF37240a8Ce096D352A75922DeA",
|
|
38
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
39
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
40
|
+
// "leverage_zap": "0x61C404B60ee9c5fB09F70F9A645DD38fE5b3A956", // 1inch
|
|
41
|
+
"leverage_zap": "0xb7b240CFa985306563A301bC417Bc9715059a117",
|
|
42
|
+
"leverage_markets_start_id": "9",
|
|
43
|
+
});
|
|
44
|
+
export var ALIASES_OPTIMISM = lowerCaseValues({
|
|
45
|
+
"crv": "0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53",
|
|
46
|
+
"one_way_factory": "0x5EA8f3D674C70b020586933A0a5b250734798BeF",
|
|
47
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
48
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
49
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
50
|
+
"gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f',
|
|
51
|
+
"gas_oracle_blob": '0x420000000000000000000000000000000000000f',
|
|
52
|
+
});
|
|
53
|
+
export var ALIASES_XDAI = lowerCaseValues({
|
|
54
|
+
"crv": "0x712b3d230f3c1c19db860d80619288b1f0bdd0bd",
|
|
55
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
56
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
57
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
58
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
59
|
+
});
|
|
60
|
+
export var ALIASES_MOONBEAM = lowerCaseValues({
|
|
61
|
+
"crv": "0x7C598c96D02398d89FbCb9d41Eab3DF0C16F227D",
|
|
62
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
63
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
64
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
65
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
66
|
+
});
|
|
67
|
+
export var ALIASES_AURORA = lowerCaseValues({
|
|
68
|
+
"crv": "0x64D5BaF5ac030e2b7c435aDD967f787ae94D0205",
|
|
69
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
70
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
71
|
+
"gauge_factory": "0x0000000000000000000000000000000000000000",
|
|
72
|
+
});
|
|
73
|
+
export var ALIASES_KAVA = lowerCaseValues({
|
|
74
|
+
"crv": "0x64D5BaF5ac030e2b7c435aDD967f787ae94D0205",
|
|
75
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
76
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
77
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
78
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
79
|
+
});
|
|
80
|
+
export var ALIASES_CELO = lowerCaseValues({
|
|
81
|
+
"crv": "0x0a7432cF27F1aE3825c313F3C81e7D3efD7639aB",
|
|
82
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
83
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
84
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
85
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
86
|
+
});
|
|
87
|
+
export var ALIASES_ZKSYNC = lowerCaseValues({
|
|
88
|
+
"crv": "0x0a7432cF27F1aE3825c313F3C81e7D3efD7639aB",
|
|
89
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
90
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
91
|
+
"gauge_factory": "0x0000000000000000000000000000000000000000",
|
|
92
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
93
|
+
});
|
|
94
|
+
export var ALIASES_BASE = lowerCaseValues({
|
|
95
|
+
"crv": "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415",
|
|
96
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
97
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
98
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
99
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
100
|
+
});
|
|
101
|
+
export var ALIASES_BSC = lowerCaseValues({
|
|
102
|
+
"crv": "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415",
|
|
103
|
+
"one_way_factory": "0x0000000000000000000000000000000000000000",
|
|
104
|
+
"gauge_controller": "0x0000000000000000000000000000000000000000",
|
|
105
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
106
|
+
"leverage_zap": "0x0000000000000000000000000000000000000000",
|
|
107
|
+
});
|
|
108
|
+
export var ALIASES_FRAXTAL = lowerCaseValues({
|
|
109
|
+
"crv": "0x331B9182088e2A7d6D3Fe4742AbA1fB231aEcc56",
|
|
110
|
+
"one_way_factory": "0xf3c9bdAB17B7016fBE3B77D17b1602A7db93ac66",
|
|
111
|
+
"gauge_controller": "0x0000000000000000000000000000000000000000",
|
|
112
|
+
"gauge_factory": "0xeF672bD94913CB6f1d2812a6e18c1fFdEd8eFf5c",
|
|
113
|
+
"leverage_zap": "0x37c5ab57AF7100Bdc9B668d766e193CCbF6614FD",
|
|
114
|
+
"leverage_markets_start_id": "0",
|
|
115
|
+
});
|
|
116
|
+
export var ALIASES_SONIC = lowerCaseValues({
|
|
117
|
+
"crv": "0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978",
|
|
118
|
+
"one_way_factory": "0xcaEC110C784c9DF37240a8Ce096D352A75922DeA",
|
|
119
|
+
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
|
|
120
|
+
"gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
|
|
121
|
+
// "leverage_zap": "0x0000000000000000000000000000000000000000", // 1inch
|
|
122
|
+
"leverage_zap": "0xb7b240CFa985306563A301bC417Bc9715059a117",
|
|
123
|
+
"leverage_markets_start_id": "9",
|
|
124
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const COINS_ETHEREUM: import("../interfaces.js").IDict<string>;
|
|
2
|
+
export declare const COINS_POLYGON: import("../interfaces.js").IDict<string>;
|
|
3
|
+
export declare const COINS_FANTOM: import("../interfaces.js").IDict<string>;
|
|
4
|
+
export declare const COINS_AVALANCHE: import("../interfaces.js").IDict<string>;
|
|
5
|
+
export declare const COINS_ARBITRUM: import("../interfaces.js").IDict<string>;
|
|
6
|
+
export declare const COINS_OPTIMISM: import("../interfaces.js").IDict<string>;
|
|
7
|
+
export declare const COINS_XDAI: import("../interfaces.js").IDict<string>;
|
|
8
|
+
export declare const COINS_MOONBEAM: import("../interfaces.js").IDict<string>;
|
|
9
|
+
export declare const COINS_AURORA: import("../interfaces.js").IDict<string>;
|
|
10
|
+
export declare const COINS_KAVA: import("../interfaces.js").IDict<string>;
|
|
11
|
+
export declare const COINS_CELO: import("../interfaces.js").IDict<string>;
|
|
12
|
+
export declare const COINS_ZKSYNC: import("../interfaces.js").IDict<string>;
|
|
13
|
+
export declare const COINS_BASE: import("../interfaces.js").IDict<string>;
|
|
14
|
+
export declare const COINS_BSC: import("../interfaces.js").IDict<string>;
|
|
15
|
+
export declare const COINS_FRAXTAL: import("../interfaces.js").IDict<string>;
|
|
16
|
+
export declare const COINS_SONIC: import("../interfaces.js").IDict<string>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { lowerCaseValues } from "./utils.js";
|
|
2
|
+
export var COINS_ETHEREUM = lowerCaseValues({
|
|
3
|
+
'eth': '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
|
|
4
|
+
'sfrxeth': '0xac3E018457B222d93114458476f3E3416Abbe38F',
|
|
5
|
+
'crvusd': '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
|
|
6
|
+
});
|
|
7
|
+
export var COINS_POLYGON = lowerCaseValues({
|
|
8
|
+
'sdt': '0x361a5a4993493ce00f61c32d4ecca5512b82ce90',
|
|
9
|
+
'weth': '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619',
|
|
10
|
+
});
|
|
11
|
+
export var COINS_FANTOM = lowerCaseValues({});
|
|
12
|
+
export var COINS_AVALANCHE = lowerCaseValues({});
|
|
13
|
+
export var COINS_ARBITRUM = lowerCaseValues({});
|
|
14
|
+
export var COINS_OPTIMISM = lowerCaseValues({});
|
|
15
|
+
export var COINS_XDAI = lowerCaseValues({});
|
|
16
|
+
export var COINS_MOONBEAM = lowerCaseValues({});
|
|
17
|
+
export var COINS_AURORA = lowerCaseValues({});
|
|
18
|
+
export var COINS_KAVA = lowerCaseValues({});
|
|
19
|
+
export var COINS_CELO = lowerCaseValues({});
|
|
20
|
+
export var COINS_ZKSYNC = lowerCaseValues({});
|
|
21
|
+
export var COINS_BASE = lowerCaseValues({});
|
|
22
|
+
export var COINS_BSC = lowerCaseValues({});
|
|
23
|
+
export var COINS_FRAXTAL = lowerCaseValues({});
|
|
24
|
+
export var COINS_SONIC = lowerCaseValues({});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import MonetaryPolicyABI from './abis/crvUSD/MonetaryPolicy.json' assert { type: 'json' };
|
|
2
|
+
import MonetaryPolicy2ABI from './abis/crvUSD/MonetaryPolicy2.json' assert { type: 'json' };
|
|
3
|
+
import { lowerCaseLlammasAddresses } from "./utils";
|
|
4
|
+
export var LLAMMAS = lowerCaseLlammasAddresses({
|
|
5
|
+
sfrxeth: {
|
|
6
|
+
amm_address: '0x136e783846ef68C8Bd00a3369F787dF8d683a696',
|
|
7
|
+
controller_address: '0x8472A9A7632b173c8Cf3a86D3afec50c35548e76',
|
|
8
|
+
monetary_policy_address: '0xc684432FD6322c6D58b6bC5d28B18569aA0AD0A1',
|
|
9
|
+
collateral_address: '0xac3E018457B222d93114458476f3E3416Abbe38F',
|
|
10
|
+
leverage_zap: '0xb556FA4C4752321B3154f08DfBDFCF34847f2eac',
|
|
11
|
+
deleverage_zap: '0xF113929F69FAbE165A2280CaC00c5f77196Aa34C',
|
|
12
|
+
collateral_symbol: 'sfrxETH',
|
|
13
|
+
collateral_decimals: 18,
|
|
14
|
+
min_bands: 4,
|
|
15
|
+
max_bands: 50,
|
|
16
|
+
default_bands: 10,
|
|
17
|
+
A: 100,
|
|
18
|
+
monetary_policy_abi: MonetaryPolicyABI,
|
|
19
|
+
},
|
|
20
|
+
wsteth: {
|
|
21
|
+
amm_address: '0x37417b2238aa52d0dd2d6252d989e728e8f706e4',
|
|
22
|
+
controller_address: '0x100daa78fc509db39ef7d04de0c1abd299f4c6ce',
|
|
23
|
+
monetary_policy_address: '0x1E7d3bf98d3f8D8CE193236c3e0eC4b00e32DaaE',
|
|
24
|
+
collateral_address: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',
|
|
25
|
+
leverage_zap: '0x293436d4e4a15FBc6cCC400c14a01735E5FC74fd',
|
|
26
|
+
deleverage_zap: '0x600E571106C31c4Ca1bF4177bA808E37146A4A0C',
|
|
27
|
+
collateral_symbol: 'wstETH',
|
|
28
|
+
collateral_decimals: 18,
|
|
29
|
+
min_bands: 4,
|
|
30
|
+
max_bands: 50,
|
|
31
|
+
default_bands: 10,
|
|
32
|
+
A: 100,
|
|
33
|
+
monetary_policy_abi: MonetaryPolicy2ABI,
|
|
34
|
+
},
|
|
35
|
+
wbtc: {
|
|
36
|
+
amm_address: '0xe0438eb3703bf871e31ce639bd351109c88666ea',
|
|
37
|
+
controller_address: '0x4e59541306910ad6dc1dac0ac9dfb29bd9f15c67',
|
|
38
|
+
monetary_policy_address: '0x1E7d3bf98d3f8D8CE193236c3e0eC4b00e32DaaE',
|
|
39
|
+
collateral_address: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
|
|
40
|
+
leverage_zap: '0xA2518b71ee64E910741f5Cf480b19E8e402de4d7',
|
|
41
|
+
deleverage_zap: '0xb911D7e59BA82FDF477a2Ab22Ff25125072C9282',
|
|
42
|
+
health_calculator_zap: "0xCF61Ee62b136e3553fB545bd8fEc11fb7f830d6A",
|
|
43
|
+
collateral_symbol: 'WBTC',
|
|
44
|
+
collateral_decimals: 8,
|
|
45
|
+
min_bands: 4,
|
|
46
|
+
max_bands: 50,
|
|
47
|
+
default_bands: 10,
|
|
48
|
+
A: 100,
|
|
49
|
+
monetary_policy_abi: MonetaryPolicy2ABI,
|
|
50
|
+
},
|
|
51
|
+
eth: {
|
|
52
|
+
amm_address: '0x1681195c176239ac5e72d9aebacf5b2492e0c4ee',
|
|
53
|
+
controller_address: '0xa920de414ea4ab66b97da1bfe9e6eca7d4219635',
|
|
54
|
+
monetary_policy_address: '0x1E7d3bf98d3f8D8CE193236c3e0eC4b00e32DaaE',
|
|
55
|
+
collateral_address: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
|
|
56
|
+
leverage_zap: '0xd3e576B5DcDe3580420A5Ef78F3639BA9cd1B967',
|
|
57
|
+
deleverage_zap: '0x9bE82CdDB5c266E010C97e4B1B5B2DF53C16384d',
|
|
58
|
+
collateral_symbol: 'ETH',
|
|
59
|
+
collateral_decimals: 18,
|
|
60
|
+
min_bands: 4,
|
|
61
|
+
max_bands: 50,
|
|
62
|
+
default_bands: 10,
|
|
63
|
+
A: 100,
|
|
64
|
+
monetary_policy_abi: MonetaryPolicy2ABI,
|
|
65
|
+
},
|
|
66
|
+
sfrxeth2: {
|
|
67
|
+
amm_address: '0xfa96ad0a9e64261db86950e2da362f5572c5c6fd',
|
|
68
|
+
controller_address: '0xec0820efafc41d8943ee8de495fc9ba8495b15cf',
|
|
69
|
+
monetary_policy_address: '0x1e7d3bf98d3f8d8ce193236c3e0ec4b00e32daae',
|
|
70
|
+
collateral_address: '0xac3e018457b222d93114458476f3e3416abbe38f',
|
|
71
|
+
leverage_zap: '0x43eCFfe6c6C1b9F24AeB5C180E659c2a6FCe11Bc',
|
|
72
|
+
deleverage_zap: '0x2bc706B83aB08d0437b8A397242C3284B5f81D74',
|
|
73
|
+
collateral_symbol: 'sfrxETH',
|
|
74
|
+
collateral_decimals: 18,
|
|
75
|
+
min_bands: 4,
|
|
76
|
+
max_bands: 50,
|
|
77
|
+
default_bands: 10,
|
|
78
|
+
A: 100,
|
|
79
|
+
monetary_policy_abi: MonetaryPolicy2ABI,
|
|
80
|
+
},
|
|
81
|
+
tbtc: {
|
|
82
|
+
amm_address: '0xf9bd9da2427a50908c4c6d1599d8e62837c2bcb0',
|
|
83
|
+
controller_address: '0x1c91da0223c763d2e0173243eadaa0a2ea47e704',
|
|
84
|
+
monetary_policy_address: '0xb8687d7dc9d8fa32fabde63e19b2dbc9bb8b2138',
|
|
85
|
+
collateral_address: '0x18084fba666a33d37592fa2633fd49a74dd93a88',
|
|
86
|
+
leverage_zap: '0xD79964C70Cb06224FdA4c48387B53E9819bcB71c',
|
|
87
|
+
deleverage_zap: '0xAA25a6Fa9e4dADaE0d3EE59bEA19fbcf0284830C',
|
|
88
|
+
collateral_symbol: 'tBTC',
|
|
89
|
+
collateral_decimals: 18,
|
|
90
|
+
min_bands: 4,
|
|
91
|
+
max_bands: 50,
|
|
92
|
+
default_bands: 10,
|
|
93
|
+
A: 100,
|
|
94
|
+
monetary_policy_abi: MonetaryPolicy2ABI,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IDict, ILlamma } from "../interfaces";
|
|
2
|
+
export declare const lowerCaseValues: (dict: IDict<string>) => IDict<string>;
|
|
3
|
+
export declare const lowerCaseLlammasAddresses: (llammas: IDict<ILlamma>) => IDict<ILlamma>;
|
|
4
|
+
export declare const extractDecimals: (llammas: IDict<ILlamma>) => IDict<number>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export var lowerCaseValues = function (dict) {
|
|
2
|
+
return Object.fromEntries(Object.entries(dict).map(function (entry) { return [entry[0], entry[1].toLowerCase()]; }));
|
|
3
|
+
};
|
|
4
|
+
export var lowerCaseLlammasAddresses = function (llammas) {
|
|
5
|
+
for (var llammaId in llammas) {
|
|
6
|
+
if (!Object.prototype.hasOwnProperty.call(llammas, llammaId))
|
|
7
|
+
continue;
|
|
8
|
+
var llamma = llammas[llammaId];
|
|
9
|
+
llamma.amm_address = llamma.amm_address.toLowerCase();
|
|
10
|
+
llamma.controller_address = llamma.controller_address.toLowerCase();
|
|
11
|
+
llamma.collateral_address = llamma.collateral_address.toLowerCase();
|
|
12
|
+
llamma.monetary_policy_address = llamma.monetary_policy_address.toLowerCase();
|
|
13
|
+
llamma.leverage_zap = llamma.leverage_zap.toLowerCase();
|
|
14
|
+
}
|
|
15
|
+
return llammas;
|
|
16
|
+
};
|
|
17
|
+
export var extractDecimals = function (llammas) {
|
|
18
|
+
var DECIMALS = {};
|
|
19
|
+
for (var llammaId in llammas) {
|
|
20
|
+
if (!Object.prototype.hasOwnProperty.call(llammas, llammaId))
|
|
21
|
+
continue;
|
|
22
|
+
var llamma = llammas[llammaId];
|
|
23
|
+
// Collateral
|
|
24
|
+
DECIMALS[llamma.collateral_address] = llamma.collateral_decimals;
|
|
25
|
+
}
|
|
26
|
+
return DECIMALS;
|
|
27
|
+
};
|