@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.
Files changed (125) hide show
  1. package/.eslintrc.json +40 -0
  2. package/.github/workflows/lint.yml +15 -0
  3. package/.github/workflows/publish.yml +55 -0
  4. package/LICENSE +21 -0
  5. package/README.md +1976 -0
  6. package/lib/cache/index.d.ts +14 -0
  7. package/lib/cache/index.js +31 -0
  8. package/lib/constants/L2Networks.d.ts +1 -0
  9. package/lib/constants/L2Networks.js +1 -0
  10. package/lib/constants/abis/Controller.json +1027 -0
  11. package/lib/constants/abis/ERC20.json +222 -0
  12. package/lib/constants/abis/ERC4626.json +1674 -0
  13. package/lib/constants/abis/GaugeController.json +794 -0
  14. package/lib/constants/abis/GaugeFactoryMainnet.json +1 -0
  15. package/lib/constants/abis/GaugeFactorySidechain.json +475 -0
  16. package/lib/constants/abis/GaugeV5.json +958 -0
  17. package/lib/constants/abis/LeverageZap.json +35 -0
  18. package/lib/constants/abis/Llamma.json +984 -0
  19. package/lib/constants/abis/Minter.json +1 -0
  20. package/lib/constants/abis/MonetaryPolicy.json +221 -0
  21. package/lib/constants/abis/OneWayLendingFactoryABI.json +899 -0
  22. package/lib/constants/abis/SidechainGauge.json +939 -0
  23. package/lib/constants/abis/Vault.json +721 -0
  24. package/lib/constants/abis/crvUSD/DeleverageZap.json +248 -0
  25. package/lib/constants/abis/crvUSD/Factory.json +514 -0
  26. package/lib/constants/abis/crvUSD/HealthCalculatorZap.json +54 -0
  27. package/lib/constants/abis/crvUSD/LeverageZap.json +312 -0
  28. package/lib/constants/abis/crvUSD/MonetaryPolicy.json +294 -0
  29. package/lib/constants/abis/crvUSD/MonetaryPolicy2.json +299 -0
  30. package/lib/constants/abis/crvUSD/PegKeeper.json +411 -0
  31. package/lib/constants/abis/crvUSD/controller.json +991 -0
  32. package/lib/constants/abis/crvUSD/llamma.json +984 -0
  33. package/lib/constants/abis/gas_oracle_optimism.json +149 -0
  34. package/lib/constants/abis/gas_oracle_optimism_blob.json +203 -0
  35. package/lib/constants/aliases.d.ts +16 -0
  36. package/lib/constants/aliases.js +124 -0
  37. package/lib/constants/coins.d.ts +16 -0
  38. package/lib/constants/coins.js +24 -0
  39. package/lib/constants/llammas.d.ts +2 -0
  40. package/lib/constants/llammas.js +96 -0
  41. package/lib/constants/utils.d.ts +4 -0
  42. package/lib/constants/utils.js +27 -0
  43. package/lib/external-api.d.ts +13 -0
  44. package/lib/external-api.js +436 -0
  45. package/lib/index.d.ts +104 -0
  46. package/lib/index.js +123 -0
  47. package/lib/interfaces.d.ts +228 -0
  48. package/lib/interfaces.js +1 -0
  49. package/lib/lendMarkets/LendMarketTemplate.d.ts +510 -0
  50. package/lib/lendMarkets/LendMarketTemplate.js +4682 -0
  51. package/lib/lendMarkets/index.d.ts +3 -0
  52. package/lib/lendMarkets/index.js +3 -0
  53. package/lib/lendMarkets/lendMarketConstructor.d.ts +2 -0
  54. package/lib/lendMarkets/lendMarketConstructor.js +6 -0
  55. package/lib/llamalend.d.ts +80 -0
  56. package/lib/llamalend.js +878 -0
  57. package/lib/mintMarkets/MintMarketTemplate.d.ts +308 -0
  58. package/lib/mintMarkets/MintMarketTemplate.js +2998 -0
  59. package/lib/mintMarkets/index.d.ts +3 -0
  60. package/lib/mintMarkets/index.js +3 -0
  61. package/lib/mintMarkets/mintMarketConstructor.d.ts +2 -0
  62. package/lib/mintMarkets/mintMarketConstructor.js +4 -0
  63. package/lib/st-crvUSD.d.ts +35 -0
  64. package/lib/st-crvUSD.js +505 -0
  65. package/lib/utils.d.ts +58 -0
  66. package/lib/utils.js +661 -0
  67. package/package.json +42 -0
  68. package/src/cache/index.ts +41 -0
  69. package/src/constants/L2Networks.ts +1 -0
  70. package/src/constants/abis/Controller.json +1027 -0
  71. package/src/constants/abis/ERC20.json +222 -0
  72. package/src/constants/abis/ERC4626.json +1674 -0
  73. package/src/constants/abis/GaugeController.json +794 -0
  74. package/src/constants/abis/GaugeFactoryMainnet.json +1 -0
  75. package/src/constants/abis/GaugeFactorySidechain.json +475 -0
  76. package/src/constants/abis/GaugeV5.json +958 -0
  77. package/src/constants/abis/LeverageZap.json +35 -0
  78. package/src/constants/abis/Llamma.json +984 -0
  79. package/src/constants/abis/Minter.json +1 -0
  80. package/src/constants/abis/MonetaryPolicy.json +221 -0
  81. package/src/constants/abis/OneWayLendingFactoryABI.json +899 -0
  82. package/src/constants/abis/SidechainGauge.json +939 -0
  83. package/src/constants/abis/Vault.json +721 -0
  84. package/src/constants/abis/crvUSD/DeleverageZap.json +248 -0
  85. package/src/constants/abis/crvUSD/ERC20.json +222 -0
  86. package/src/constants/abis/crvUSD/Factory.json +514 -0
  87. package/src/constants/abis/crvUSD/HealthCalculatorZap.json +54 -0
  88. package/src/constants/abis/crvUSD/LeverageZap.json +312 -0
  89. package/src/constants/abis/crvUSD/MonetaryPolicy.json +294 -0
  90. package/src/constants/abis/crvUSD/MonetaryPolicy2.json +299 -0
  91. package/src/constants/abis/crvUSD/PegKeeper.json +411 -0
  92. package/src/constants/abis/crvUSD/controller.json +991 -0
  93. package/src/constants/abis/crvUSD/llamma.json +984 -0
  94. package/src/constants/abis/gas_oracle_optimism.json +149 -0
  95. package/src/constants/abis/gas_oracle_optimism_blob.json +203 -0
  96. package/src/constants/aliases.ts +141 -0
  97. package/src/constants/coins.ts +41 -0
  98. package/src/constants/llammas.ts +99 -0
  99. package/src/constants/utils.ts +33 -0
  100. package/src/external-api.ts +325 -0
  101. package/src/index.ts +128 -0
  102. package/src/interfaces.ts +237 -0
  103. package/src/lendMarkets/LendMarketTemplate.ts +3022 -0
  104. package/src/lendMarkets/index.ts +7 -0
  105. package/src/lendMarkets/lendMarketConstructor.ts +7 -0
  106. package/src/llamalend.ts +785 -0
  107. package/src/mintMarkets/MintMarketTemplate.ts +1781 -0
  108. package/src/mintMarkets/index.ts +7 -0
  109. package/src/mintMarkets/mintMarketConstructor.ts +5 -0
  110. package/src/st-crvUSD.ts +244 -0
  111. package/src/utils.ts +497 -0
  112. package/test/fetch.test.ts +152 -0
  113. package/test/general.test.ts +216 -0
  114. package/test/leverageBorrowMore.test.ts +245 -0
  115. package/test/leverageCreateLoan.test.ts +236 -0
  116. package/test/leverageRepay.test.ts +240 -0
  117. package/test/readme.test.ts +475 -0
  118. package/test/selfLiquidate.test.ts +57 -0
  119. package/test/selfLiquidateCrvUSD.test.ts +54 -0
  120. package/test/st_crvUSD.test.ts +68 -0
  121. package/test/swap.test.ts +62 -0
  122. package/test/swapCrvUSD.test.ts +56 -0
  123. package/test/vault.test.ts +112 -0
  124. package/tsconfig.build.json +10 -0
  125. 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,141 @@
1
+ import { lowerCaseValues } from "./utils.js";
2
+
3
+
4
+ export const ALIASES_ETHEREUM = lowerCaseValues({
5
+ "crv": "0xD533a949740bb3306d119CC777fa900bA034cd52",
6
+ "one_way_factory": "0xeA6876DDE9e3467564acBeE1Ed5bac88783205E0",
7
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
8
+ "minter": '0xd061D61a4d941c39E5453435B6345Dc261C2fcE0',
9
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
10
+ // "leverage_zap": "0x3294514B78Df4Bb90132567fcf8E5e99f390B687", // 1inch
11
+ "leverage_zap": "0xC5898606BdB494a994578453B92e7910a90aA873", // odos
12
+ "leverage_markets_start_id": "9",
13
+ "crvUSD": "0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E",
14
+ "st_crvUSD": "0x0655977FEb2f289A4aB78af67BAB0d17aAb84367",
15
+ });
16
+
17
+ export const ALIASES_POLYGON = lowerCaseValues({
18
+ "crv": "0x172370d5cd63279efa6d502dab29171933a610af",
19
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
20
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
21
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
22
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
23
+ });
24
+
25
+ export const ALIASES_FANTOM = lowerCaseValues({
26
+ "crv": "0x1E4F97b9f9F913c46F1632781732927B9019C68b",
27
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
28
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
29
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
30
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
31
+ });
32
+
33
+ export const ALIASES_AVALANCHE = lowerCaseValues({
34
+ "crv": "0x47536F17F4fF30e64A96a7555826b8f9e66ec468",
35
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
36
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
37
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
38
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
39
+ });
40
+
41
+ export const ALIASES_ARBITRUM = lowerCaseValues({
42
+ "crv": "0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978",
43
+ "one_way_factory": "0xcaEC110C784c9DF37240a8Ce096D352A75922DeA",
44
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
45
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
46
+ // "leverage_zap": "0x61C404B60ee9c5fB09F70F9A645DD38fE5b3A956", // 1inch
47
+ "leverage_zap": "0xb7b240CFa985306563A301bC417Bc9715059a117", // odos
48
+ "leverage_markets_start_id": "9",
49
+ });
50
+
51
+ export const ALIASES_OPTIMISM = lowerCaseValues({
52
+ "crv": "0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53",
53
+ "one_way_factory": "0x5EA8f3D674C70b020586933A0a5b250734798BeF",
54
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
55
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
56
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
57
+ "gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f',
58
+ "gas_oracle_blob": '0x420000000000000000000000000000000000000f',
59
+ });
60
+
61
+ export const ALIASES_XDAI = lowerCaseValues({
62
+ "crv": "0x712b3d230f3c1c19db860d80619288b1f0bdd0bd",
63
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
64
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
65
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
66
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
67
+ });
68
+
69
+ export const ALIASES_MOONBEAM = lowerCaseValues({
70
+ "crv": "0x7C598c96D02398d89FbCb9d41Eab3DF0C16F227D",
71
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
72
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
73
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
74
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
75
+ });
76
+
77
+ export const ALIASES_AURORA = lowerCaseValues({
78
+ "crv": "0x64D5BaF5ac030e2b7c435aDD967f787ae94D0205",
79
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
80
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
81
+ "gauge_factory": "0x0000000000000000000000000000000000000000",
82
+ });
83
+
84
+ export const ALIASES_KAVA = lowerCaseValues({
85
+ "crv": "0x64D5BaF5ac030e2b7c435aDD967f787ae94D0205", // <--- TODO CHANGE
86
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
87
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
88
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
89
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
90
+ });
91
+
92
+ export const ALIASES_CELO = lowerCaseValues({
93
+ "crv": "0x0a7432cF27F1aE3825c313F3C81e7D3efD7639aB", // <--- TODO CHANGE
94
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
95
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
96
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
97
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
98
+ });
99
+
100
+ export const ALIASES_ZKSYNC = lowerCaseValues({
101
+ "crv": "0x0a7432cF27F1aE3825c313F3C81e7D3efD7639aB", // <--- TODO CHANGE
102
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
103
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB", // <--- TODO CHANGE
104
+ "gauge_factory": "0x0000000000000000000000000000000000000000",
105
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
106
+ });
107
+
108
+ export const ALIASES_BASE = lowerCaseValues({
109
+ "crv": "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415",
110
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
111
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB", // <--- TODO CHANGE
112
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
113
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
114
+ });
115
+
116
+ export const ALIASES_BSC = lowerCaseValues({
117
+ "crv": "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415", // <--- TODO CHANGE
118
+ "one_way_factory": "0x0000000000000000000000000000000000000000",
119
+ "gauge_controller": "0x0000000000000000000000000000000000000000", // <--- TODO CHANGE
120
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
121
+ "leverage_zap": "0x0000000000000000000000000000000000000000",
122
+ });
123
+
124
+ export const ALIASES_FRAXTAL = lowerCaseValues({
125
+ "crv": "0x331B9182088e2A7d6D3Fe4742AbA1fB231aEcc56",
126
+ "one_way_factory": "0xf3c9bdAB17B7016fBE3B77D17b1602A7db93ac66",
127
+ "gauge_controller": "0x0000000000000000000000000000000000000000", // <--- TODO CHANGE
128
+ "gauge_factory": "0xeF672bD94913CB6f1d2812a6e18c1fFdEd8eFf5c",
129
+ "leverage_zap": "0x37c5ab57AF7100Bdc9B668d766e193CCbF6614FD", // odos
130
+ "leverage_markets_start_id": "0",
131
+ });
132
+
133
+ export const ALIASES_SONIC = lowerCaseValues({
134
+ "crv": "0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978",
135
+ "one_way_factory": "0xcaEC110C784c9DF37240a8Ce096D352A75922DeA",
136
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
137
+ "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
138
+ // "leverage_zap": "0x0000000000000000000000000000000000000000", // 1inch
139
+ "leverage_zap": "0xb7b240CFa985306563A301bC417Bc9715059a117", // odos
140
+ "leverage_markets_start_id": "9",
141
+ });
@@ -0,0 +1,41 @@
1
+ import { lowerCaseValues } from "./utils.js";
2
+
3
+
4
+ export const COINS_ETHEREUM = lowerCaseValues({
5
+ 'eth': '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
6
+ 'sfrxeth': '0xac3E018457B222d93114458476f3E3416Abbe38F',
7
+ 'crvusd': '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
8
+ });
9
+
10
+ export const COINS_POLYGON = lowerCaseValues({
11
+ 'sdt': '0x361a5a4993493ce00f61c32d4ecca5512b82ce90',
12
+ 'weth': '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619',
13
+ });
14
+
15
+ export const COINS_FANTOM = lowerCaseValues({});
16
+
17
+ export const COINS_AVALANCHE = lowerCaseValues({});
18
+
19
+ export const COINS_ARBITRUM = lowerCaseValues({});
20
+
21
+ export const COINS_OPTIMISM = lowerCaseValues({});
22
+
23
+ export const COINS_XDAI = lowerCaseValues({});
24
+
25
+ export const COINS_MOONBEAM = lowerCaseValues({});
26
+
27
+ export const COINS_AURORA = lowerCaseValues({});
28
+
29
+ export const COINS_KAVA = lowerCaseValues({});
30
+
31
+ export const COINS_CELO = lowerCaseValues({});
32
+
33
+ export const COINS_ZKSYNC = lowerCaseValues({});
34
+
35
+ export const COINS_BASE = lowerCaseValues({});
36
+
37
+ export const COINS_BSC = lowerCaseValues({});
38
+
39
+ export const COINS_FRAXTAL = lowerCaseValues({});
40
+
41
+ export const COINS_SONIC = lowerCaseValues({});
@@ -0,0 +1,99 @@
1
+ import { IDict, ILlamma } from "../interfaces";
2
+ import MonetaryPolicyABI from './abis/crvUSD/MonetaryPolicy.json' assert { type: 'json'};
3
+ import MonetaryPolicy2ABI from './abis/crvUSD/MonetaryPolicy2.json' assert { type: 'json'};
4
+ import { lowerCaseLlammasAddresses } from "./utils";
5
+
6
+
7
+ export const LLAMMAS: IDict<ILlamma> = lowerCaseLlammasAddresses({
8
+ sfrxeth: {
9
+ amm_address: '0x136e783846ef68C8Bd00a3369F787dF8d683a696',
10
+ controller_address: '0x8472A9A7632b173c8Cf3a86D3afec50c35548e76',
11
+ monetary_policy_address: '0xc684432FD6322c6D58b6bC5d28B18569aA0AD0A1',
12
+ collateral_address: '0xac3E018457B222d93114458476f3E3416Abbe38F',
13
+ leverage_zap: '0xb556FA4C4752321B3154f08DfBDFCF34847f2eac',
14
+ deleverage_zap: '0xF113929F69FAbE165A2280CaC00c5f77196Aa34C',
15
+ collateral_symbol: 'sfrxETH',
16
+ collateral_decimals: 18,
17
+ min_bands: 4,
18
+ max_bands: 50,
19
+ default_bands: 10,
20
+ A: 100,
21
+ monetary_policy_abi: MonetaryPolicyABI,
22
+ },
23
+ wsteth: {
24
+ amm_address: '0x37417b2238aa52d0dd2d6252d989e728e8f706e4',
25
+ controller_address: '0x100daa78fc509db39ef7d04de0c1abd299f4c6ce',
26
+ monetary_policy_address: '0x1E7d3bf98d3f8D8CE193236c3e0eC4b00e32DaaE',
27
+ collateral_address: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',
28
+ leverage_zap: '0x293436d4e4a15FBc6cCC400c14a01735E5FC74fd',
29
+ deleverage_zap: '0x600E571106C31c4Ca1bF4177bA808E37146A4A0C',
30
+ collateral_symbol: 'wstETH',
31
+ collateral_decimals: 18,
32
+ min_bands: 4,
33
+ max_bands: 50,
34
+ default_bands: 10,
35
+ A: 100,
36
+ monetary_policy_abi: MonetaryPolicy2ABI,
37
+ },
38
+ wbtc: {
39
+ amm_address: '0xe0438eb3703bf871e31ce639bd351109c88666ea',
40
+ controller_address: '0x4e59541306910ad6dc1dac0ac9dfb29bd9f15c67',
41
+ monetary_policy_address: '0x1E7d3bf98d3f8D8CE193236c3e0eC4b00e32DaaE',
42
+ collateral_address: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
43
+ leverage_zap: '0xA2518b71ee64E910741f5Cf480b19E8e402de4d7',
44
+ deleverage_zap: '0xb911D7e59BA82FDF477a2Ab22Ff25125072C9282',
45
+ health_calculator_zap: "0xCF61Ee62b136e3553fB545bd8fEc11fb7f830d6A",
46
+ collateral_symbol: 'WBTC',
47
+ collateral_decimals: 8,
48
+ min_bands: 4,
49
+ max_bands: 50,
50
+ default_bands: 10,
51
+ A: 100,
52
+ monetary_policy_abi: MonetaryPolicy2ABI,
53
+ },
54
+ eth: {
55
+ amm_address: '0x1681195c176239ac5e72d9aebacf5b2492e0c4ee',
56
+ controller_address: '0xa920de414ea4ab66b97da1bfe9e6eca7d4219635',
57
+ monetary_policy_address: '0x1E7d3bf98d3f8D8CE193236c3e0eC4b00e32DaaE',
58
+ collateral_address: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
59
+ leverage_zap: '0xd3e576B5DcDe3580420A5Ef78F3639BA9cd1B967',
60
+ deleverage_zap: '0x9bE82CdDB5c266E010C97e4B1B5B2DF53C16384d',
61
+ collateral_symbol: 'ETH',
62
+ collateral_decimals: 18,
63
+ min_bands: 4,
64
+ max_bands: 50,
65
+ default_bands: 10,
66
+ A: 100,
67
+ monetary_policy_abi: MonetaryPolicy2ABI,
68
+ },
69
+ sfrxeth2: {
70
+ amm_address: '0xfa96ad0a9e64261db86950e2da362f5572c5c6fd',
71
+ controller_address: '0xec0820efafc41d8943ee8de495fc9ba8495b15cf',
72
+ monetary_policy_address: '0x1e7d3bf98d3f8d8ce193236c3e0ec4b00e32daae',
73
+ collateral_address: '0xac3e018457b222d93114458476f3e3416abbe38f',
74
+ leverage_zap: '0x43eCFfe6c6C1b9F24AeB5C180E659c2a6FCe11Bc',
75
+ deleverage_zap: '0x2bc706B83aB08d0437b8A397242C3284B5f81D74',
76
+ collateral_symbol: 'sfrxETH',
77
+ collateral_decimals: 18,
78
+ min_bands: 4,
79
+ max_bands: 50,
80
+ default_bands: 10,
81
+ A: 100,
82
+ monetary_policy_abi: MonetaryPolicy2ABI,
83
+ },
84
+ tbtc: {
85
+ amm_address: '0xf9bd9da2427a50908c4c6d1599d8e62837c2bcb0',
86
+ controller_address: '0x1c91da0223c763d2e0173243eadaa0a2ea47e704',
87
+ monetary_policy_address: '0xb8687d7dc9d8fa32fabde63e19b2dbc9bb8b2138',
88
+ collateral_address: '0x18084fba666a33d37592fa2633fd49a74dd93a88',
89
+ leverage_zap: '0xD79964C70Cb06224FdA4c48387B53E9819bcB71c',
90
+ deleverage_zap: '0xAA25a6Fa9e4dADaE0d3EE59bEA19fbcf0284830C',
91
+ collateral_symbol: 'tBTC',
92
+ collateral_decimals: 18,
93
+ min_bands: 4,
94
+ max_bands: 50,
95
+ default_bands: 10,
96
+ A: 100,
97
+ monetary_policy_abi: MonetaryPolicy2ABI,
98
+ },
99
+ });
@@ -0,0 +1,33 @@
1
+ import {IDict, ILlamma} from "../interfaces";
2
+
3
+ export const lowerCaseValues = (dict: IDict<string>): IDict<string> =>
4
+ Object.fromEntries(Object.entries(dict).map((entry) => [entry[0], entry[1].toLowerCase()]))
5
+
6
+
7
+ export const lowerCaseLlammasAddresses = (llammas: IDict<ILlamma>): IDict<ILlamma> => {
8
+ for (const llammaId in llammas) {
9
+ if (!Object.prototype.hasOwnProperty.call(llammas, llammaId)) continue;
10
+ const llamma = llammas[llammaId];
11
+ llamma.amm_address = llamma.amm_address.toLowerCase();
12
+ llamma.controller_address = llamma.controller_address.toLowerCase();
13
+ llamma.collateral_address = llamma.collateral_address.toLowerCase();
14
+ llamma.monetary_policy_address = llamma.monetary_policy_address.toLowerCase();
15
+ llamma.leverage_zap = llamma.leverage_zap.toLowerCase();
16
+ }
17
+
18
+ return llammas
19
+ }
20
+
21
+ export const extractDecimals = (llammas: IDict<ILlamma>): IDict<number> => {
22
+ const DECIMALS: IDict<number> = {};
23
+ for (const llammaId in llammas) {
24
+ if (!Object.prototype.hasOwnProperty.call(llammas, llammaId)) continue;
25
+ const llamma = llammas[llammaId];
26
+
27
+ // Collateral
28
+ DECIMALS[llamma.collateral_address] = llamma.collateral_decimals;
29
+ }
30
+
31
+ return DECIMALS
32
+ }
33
+