@strkfarm/sdk 1.2.1 → 2.0.0-dca.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/dist/cli.js +9 -5
- package/dist/cli.mjs +9 -5
- package/dist/index.browser.global.js +67035 -40458
- package/dist/index.browser.mjs +5218 -1908
- package/dist/index.d.ts +478 -33
- package/dist/index.js +5500 -2157
- package/dist/index.mjs +5441 -2129
- package/package.json +4 -1
- package/src/data/ekubo-price-fethcer.abi.json +265 -0
- package/src/data/yoloVault.abi.json +777 -0
- package/src/dataTypes/_bignumber.ts +5 -0
- package/src/dataTypes/bignumber.browser.ts +5 -0
- package/src/dataTypes/bignumber.node.ts +5 -0
- package/src/dataTypes/index.ts +3 -2
- package/src/dataTypes/mynumber.ts +141 -0
- package/src/global.ts +42 -0
- package/src/index.browser.ts +2 -1
- package/src/interfaces/common.tsx +168 -2
- package/src/modules/apollo-client-config.ts +28 -0
- package/src/modules/avnu.ts +1 -1
- package/src/modules/ekubo-pricer.ts +79 -0
- package/src/modules/erc20.ts +18 -2
- package/src/modules/pragma.ts +23 -8
- package/src/modules/pricer-from-api.ts +150 -14
- package/src/modules/pricer.ts +2 -1
- package/src/modules/pricerBase.ts +2 -1
- package/src/node/pricer-redis.ts +2 -1
- package/src/strategies/base-strategy.ts +81 -2
- package/src/strategies/ekubo-cl-vault.tsx +686 -316
- package/src/strategies/factory.ts +159 -0
- package/src/strategies/index.ts +5 -1
- package/src/strategies/registry.ts +239 -0
- package/src/strategies/sensei.ts +361 -13
- package/src/strategies/types.ts +4 -0
- package/src/strategies/universal-adapters/vesu-adapter.ts +48 -27
- package/src/strategies/universal-lst-muliplier-strategy.tsx +1396 -463
- package/src/strategies/universal-strategy.tsx +287 -129
- package/src/strategies/vesu-rebalance.tsx +242 -146
- package/src/strategies/yoloVault.ts +463 -0
- package/src/utils/index.ts +1 -1
- package/src/utils/logger.node.ts +11 -4
- package/src/utils/strategy-utils.ts +61 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strkfarm/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-dca.02",
|
|
4
4
|
"description": "STRKFarm TS SDK (Meant for our internal use, but feel free to use it)",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
"dist",
|
|
26
26
|
"src"
|
|
27
27
|
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"tag": "dca"
|
|
30
|
+
},
|
|
28
31
|
"scripts": {
|
|
29
32
|
"test": "jest",
|
|
30
33
|
"build": "tsup --clean && pnpm run build:esm && npm run build:dts && npm run build:iife && npm run build-cli && pnpm run build:iife-esm",
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "impl",
|
|
4
|
+
"name": "PriceFetcherImpl",
|
|
5
|
+
"interface_name": "ekubo_oracle_extension::price_fetcher::IPriceFetcher"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"type": "struct",
|
|
9
|
+
"name": "core::array::Span::<core::starknet::contract_address::ContractAddress>",
|
|
10
|
+
"members": [
|
|
11
|
+
{
|
|
12
|
+
"name": "snapshot",
|
|
13
|
+
"type": "@core::array::Array::<core::starknet::contract_address::ContractAddress>"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "struct",
|
|
19
|
+
"name": "core::integer::u256",
|
|
20
|
+
"members": [
|
|
21
|
+
{
|
|
22
|
+
"name": "low",
|
|
23
|
+
"type": "core::integer::u128"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "high",
|
|
27
|
+
"type": "core::integer::u128"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "enum",
|
|
33
|
+
"name": "ekubo_oracle_extension::price_fetcher::PriceResult",
|
|
34
|
+
"variants": [
|
|
35
|
+
{
|
|
36
|
+
"name": "NotInitialized",
|
|
37
|
+
"type": "()"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "InsufficientLiquidity",
|
|
41
|
+
"type": "()"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "PeriodTooLong",
|
|
45
|
+
"type": "()"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "Price",
|
|
49
|
+
"type": "core::integer::u256"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "struct",
|
|
55
|
+
"name": "core::array::Span::<ekubo_oracle_extension::price_fetcher::PriceResult>",
|
|
56
|
+
"members": [
|
|
57
|
+
{
|
|
58
|
+
"name": "snapshot",
|
|
59
|
+
"type": "@core::array::Array::<ekubo_oracle_extension::price_fetcher::PriceResult>"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"type": "struct",
|
|
65
|
+
"name": "ekubo_oracle_extension::price_fetcher::CandlestickPoint",
|
|
66
|
+
"members": [
|
|
67
|
+
{
|
|
68
|
+
"name": "time",
|
|
69
|
+
"type": "core::integer::u64"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "low",
|
|
73
|
+
"type": "core::integer::u256"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "high",
|
|
77
|
+
"type": "core::integer::u256"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "open",
|
|
81
|
+
"type": "core::integer::u256"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "close",
|
|
85
|
+
"type": "core::integer::u256"
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "struct",
|
|
91
|
+
"name": "core::array::Span::<ekubo_oracle_extension::price_fetcher::CandlestickPoint>",
|
|
92
|
+
"members": [
|
|
93
|
+
{
|
|
94
|
+
"name": "snapshot",
|
|
95
|
+
"type": "@core::array::Array::<ekubo_oracle_extension::price_fetcher::CandlestickPoint>"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"type": "interface",
|
|
101
|
+
"name": "ekubo_oracle_extension::price_fetcher::IPriceFetcher",
|
|
102
|
+
"items": [
|
|
103
|
+
{
|
|
104
|
+
"type": "function",
|
|
105
|
+
"name": "get_prices",
|
|
106
|
+
"inputs": [
|
|
107
|
+
{
|
|
108
|
+
"name": "quote_token",
|
|
109
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "base_tokens",
|
|
113
|
+
"type": "core::array::Span::<core::starknet::contract_address::ContractAddress>"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "period",
|
|
117
|
+
"type": "core::integer::u64"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "min_token",
|
|
121
|
+
"type": "core::integer::u128"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"outputs": [
|
|
125
|
+
{
|
|
126
|
+
"type": "core::array::Span::<ekubo_oracle_extension::price_fetcher::PriceResult>"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"state_mutability": "view"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"type": "function",
|
|
133
|
+
"name": "get_prices_in_oracle_tokens",
|
|
134
|
+
"inputs": [
|
|
135
|
+
{
|
|
136
|
+
"name": "base_tokens",
|
|
137
|
+
"type": "core::array::Span::<core::starknet::contract_address::ContractAddress>"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "period",
|
|
141
|
+
"type": "core::integer::u64"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "min_token",
|
|
145
|
+
"type": "core::integer::u128"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"outputs": [
|
|
149
|
+
{
|
|
150
|
+
"type": "(core::starknet::contract_address::ContractAddress, core::array::Span::<ekubo_oracle_extension::price_fetcher::PriceResult>)"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"state_mutability": "view"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"type": "function",
|
|
157
|
+
"name": "get_candlestick_chart_data",
|
|
158
|
+
"inputs": [
|
|
159
|
+
{
|
|
160
|
+
"name": "base_token",
|
|
161
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "quote_token",
|
|
165
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "interval_seconds",
|
|
169
|
+
"type": "core::integer::u32"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "num_intervals",
|
|
173
|
+
"type": "core::integer::u32"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "max_resolution",
|
|
177
|
+
"type": "core::integer::u8"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "end_time",
|
|
181
|
+
"type": "core::integer::u64"
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"outputs": [
|
|
185
|
+
{
|
|
186
|
+
"type": "core::array::Span::<ekubo_oracle_extension::price_fetcher::CandlestickPoint>"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"state_mutability": "view"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"type": "function",
|
|
193
|
+
"name": "get_candlestick_chart_data_now",
|
|
194
|
+
"inputs": [
|
|
195
|
+
{
|
|
196
|
+
"name": "base_token",
|
|
197
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "quote_token",
|
|
201
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "interval_seconds",
|
|
205
|
+
"type": "core::integer::u32"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"name": "num_intervals",
|
|
209
|
+
"type": "core::integer::u32"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"name": "max_resolution",
|
|
213
|
+
"type": "core::integer::u8"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"outputs": [
|
|
217
|
+
{
|
|
218
|
+
"type": "(core::integer::u64, core::array::Span::<ekubo_oracle_extension::price_fetcher::CandlestickPoint>)"
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
"state_mutability": "view"
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"type": "struct",
|
|
227
|
+
"name": "ekubo::interfaces::core::ICoreDispatcher",
|
|
228
|
+
"members": [
|
|
229
|
+
{
|
|
230
|
+
"name": "contract_address",
|
|
231
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"type": "struct",
|
|
237
|
+
"name": "ekubo_oracle_extension::oracle::IOracleDispatcher",
|
|
238
|
+
"members": [
|
|
239
|
+
{
|
|
240
|
+
"name": "contract_address",
|
|
241
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"type": "constructor",
|
|
247
|
+
"name": "constructor",
|
|
248
|
+
"inputs": [
|
|
249
|
+
{
|
|
250
|
+
"name": "core",
|
|
251
|
+
"type": "ekubo::interfaces::core::ICoreDispatcher"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "oracle",
|
|
255
|
+
"type": "ekubo_oracle_extension::oracle::IOracleDispatcher"
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"type": "event",
|
|
261
|
+
"name": "ekubo_oracle_extension::price_fetcher::PriceFetcher::Event",
|
|
262
|
+
"kind": "enum",
|
|
263
|
+
"variants": []
|
|
264
|
+
}
|
|
265
|
+
]
|