@strkfarm/sdk 1.1.34 → 1.1.35

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.
@@ -28689,6 +28689,7 @@ ${r2}}` : "}", l2;
28689
28689
  VesuRebalanceStrategies: () => VesuRebalanceStrategies,
28690
28690
  Web3Number: () => Web3Number,
28691
28691
  ZkLend: () => ZkLend,
28692
+ extensionMap: () => extensionMap,
28692
28693
  getContractDetails: () => getContractDetails,
28693
28694
  getMainnetConfig: () => getMainnetConfig,
28694
28695
  getNoRiskTags: () => getNoRiskTags,
@@ -53727,6 +53728,7 @@ ${JSON.stringify(data, null, 2)}`;
53727
53728
  }
53728
53729
  throw new Error("no quotes found");
53729
53730
  }
53731
+ logger2.verbose(`${_AvnuWrapper.name}: getQuotes => filteredQuotes: ${JSON.stringify(filteredQuotes)}`);
53730
53732
  return filteredQuotes[0];
53731
53733
  }
53732
53734
  async getSwapInfo(quote, taker, integratorFeeBps, integratorFeeRecipient, minAmount, options) {
@@ -87832,6 +87834,2451 @@ spurious results.`);
87832
87834
  }
87833
87835
  ];
87834
87836
 
87837
+ // src/data/vesu-extension.abi.json
87838
+ var vesu_extension_abi_default = [
87839
+ {
87840
+ type: "impl",
87841
+ name: "DefaultExtensionPOV2Impl",
87842
+ interface_name: "vesu::v2::default_extension_po_v2::IDefaultExtensionPOV2"
87843
+ },
87844
+ {
87845
+ type: "enum",
87846
+ name: "vesu::vendor::pragma::AggregationMode",
87847
+ variants: [
87848
+ {
87849
+ name: "Median",
87850
+ type: "()"
87851
+ },
87852
+ {
87853
+ name: "Mean",
87854
+ type: "()"
87855
+ },
87856
+ {
87857
+ name: "Error",
87858
+ type: "()"
87859
+ }
87860
+ ]
87861
+ },
87862
+ {
87863
+ type: "struct",
87864
+ name: "vesu::extension::components::pragma_oracle::OracleConfig",
87865
+ members: [
87866
+ {
87867
+ name: "pragma_key",
87868
+ type: "core::felt252"
87869
+ },
87870
+ {
87871
+ name: "timeout",
87872
+ type: "core::integer::u64"
87873
+ },
87874
+ {
87875
+ name: "number_of_sources",
87876
+ type: "core::integer::u32"
87877
+ },
87878
+ {
87879
+ name: "start_time_offset",
87880
+ type: "core::integer::u64"
87881
+ },
87882
+ {
87883
+ name: "time_window",
87884
+ type: "core::integer::u64"
87885
+ },
87886
+ {
87887
+ name: "aggregation_mode",
87888
+ type: "vesu::vendor::pragma::AggregationMode"
87889
+ }
87890
+ ]
87891
+ },
87892
+ {
87893
+ type: "struct",
87894
+ name: "vesu::extension::components::fee_model::FeeConfig",
87895
+ members: [
87896
+ {
87897
+ name: "fee_recipient",
87898
+ type: "core::starknet::contract_address::ContractAddress"
87899
+ }
87900
+ ]
87901
+ },
87902
+ {
87903
+ type: "struct",
87904
+ name: "core::integer::u256",
87905
+ members: [
87906
+ {
87907
+ name: "low",
87908
+ type: "core::integer::u128"
87909
+ },
87910
+ {
87911
+ name: "high",
87912
+ type: "core::integer::u128"
87913
+ }
87914
+ ]
87915
+ },
87916
+ {
87917
+ type: "struct",
87918
+ name: "vesu::extension::components::interest_rate_model::InterestRateConfig",
87919
+ members: [
87920
+ {
87921
+ name: "min_target_utilization",
87922
+ type: "core::integer::u256"
87923
+ },
87924
+ {
87925
+ name: "max_target_utilization",
87926
+ type: "core::integer::u256"
87927
+ },
87928
+ {
87929
+ name: "target_utilization",
87930
+ type: "core::integer::u256"
87931
+ },
87932
+ {
87933
+ name: "min_full_utilization_rate",
87934
+ type: "core::integer::u256"
87935
+ },
87936
+ {
87937
+ name: "max_full_utilization_rate",
87938
+ type: "core::integer::u256"
87939
+ },
87940
+ {
87941
+ name: "zero_utilization_rate",
87942
+ type: "core::integer::u256"
87943
+ },
87944
+ {
87945
+ name: "rate_half_life",
87946
+ type: "core::integer::u256"
87947
+ },
87948
+ {
87949
+ name: "target_rate_percent",
87950
+ type: "core::integer::u256"
87951
+ }
87952
+ ]
87953
+ },
87954
+ {
87955
+ type: "struct",
87956
+ name: "vesu::extension::components::position_hooks::LiquidationConfig",
87957
+ members: [
87958
+ {
87959
+ name: "liquidation_factor",
87960
+ type: "core::integer::u64"
87961
+ }
87962
+ ]
87963
+ },
87964
+ {
87965
+ type: "struct",
87966
+ name: "vesu::extension::components::position_hooks::ShutdownConfig",
87967
+ members: [
87968
+ {
87969
+ name: "recovery_period",
87970
+ type: "core::integer::u64"
87971
+ },
87972
+ {
87973
+ name: "subscription_period",
87974
+ type: "core::integer::u64"
87975
+ }
87976
+ ]
87977
+ },
87978
+ {
87979
+ type: "struct",
87980
+ name: "vesu::data_model::LTVConfig",
87981
+ members: [
87982
+ {
87983
+ name: "max_ltv",
87984
+ type: "core::integer::u64"
87985
+ }
87986
+ ]
87987
+ },
87988
+ {
87989
+ type: "enum",
87990
+ name: "vesu::extension::components::position_hooks::ShutdownMode",
87991
+ variants: [
87992
+ {
87993
+ name: "None",
87994
+ type: "()"
87995
+ },
87996
+ {
87997
+ name: "Recovery",
87998
+ type: "()"
87999
+ },
88000
+ {
88001
+ name: "Subscription",
88002
+ type: "()"
88003
+ },
88004
+ {
88005
+ name: "Redemption",
88006
+ type: "()"
88007
+ }
88008
+ ]
88009
+ },
88010
+ {
88011
+ type: "enum",
88012
+ name: "core::bool",
88013
+ variants: [
88014
+ {
88015
+ name: "False",
88016
+ type: "()"
88017
+ },
88018
+ {
88019
+ name: "True",
88020
+ type: "()"
88021
+ }
88022
+ ]
88023
+ },
88024
+ {
88025
+ type: "struct",
88026
+ name: "vesu::extension::components::position_hooks::ShutdownStatus",
88027
+ members: [
88028
+ {
88029
+ name: "shutdown_mode",
88030
+ type: "vesu::extension::components::position_hooks::ShutdownMode"
88031
+ },
88032
+ {
88033
+ name: "violating",
88034
+ type: "core::bool"
88035
+ },
88036
+ {
88037
+ name: "previous_violation_timestamp",
88038
+ type: "core::integer::u64"
88039
+ },
88040
+ {
88041
+ name: "count_at_violation_timestamp",
88042
+ type: "core::integer::u128"
88043
+ }
88044
+ ]
88045
+ },
88046
+ {
88047
+ type: "struct",
88048
+ name: "vesu::extension::components::position_hooks::Pair",
88049
+ members: [
88050
+ {
88051
+ name: "total_collateral_shares",
88052
+ type: "core::integer::u256"
88053
+ },
88054
+ {
88055
+ name: "total_nominal_debt",
88056
+ type: "core::integer::u256"
88057
+ }
88058
+ ]
88059
+ },
88060
+ {
88061
+ type: "struct",
88062
+ name: "vesu::data_model::AssetParams",
88063
+ members: [
88064
+ {
88065
+ name: "asset",
88066
+ type: "core::starknet::contract_address::ContractAddress"
88067
+ },
88068
+ {
88069
+ name: "floor",
88070
+ type: "core::integer::u256"
88071
+ },
88072
+ {
88073
+ name: "initial_rate_accumulator",
88074
+ type: "core::integer::u256"
88075
+ },
88076
+ {
88077
+ name: "initial_full_utilization_rate",
88078
+ type: "core::integer::u256"
88079
+ },
88080
+ {
88081
+ name: "max_utilization",
88082
+ type: "core::integer::u256"
88083
+ },
88084
+ {
88085
+ name: "is_legacy",
88086
+ type: "core::bool"
88087
+ },
88088
+ {
88089
+ name: "fee_rate",
88090
+ type: "core::integer::u256"
88091
+ }
88092
+ ]
88093
+ },
88094
+ {
88095
+ type: "struct",
88096
+ name: "core::array::Span::<vesu::data_model::AssetParams>",
88097
+ members: [
88098
+ {
88099
+ name: "snapshot",
88100
+ type: "@core::array::Array::<vesu::data_model::AssetParams>"
88101
+ }
88102
+ ]
88103
+ },
88104
+ {
88105
+ type: "struct",
88106
+ name: "vesu::extension::default_extension_po::VTokenParams",
88107
+ members: [
88108
+ {
88109
+ name: "v_token_name",
88110
+ type: "core::felt252"
88111
+ },
88112
+ {
88113
+ name: "v_token_symbol",
88114
+ type: "core::felt252"
88115
+ }
88116
+ ]
88117
+ },
88118
+ {
88119
+ type: "struct",
88120
+ name: "core::array::Span::<vesu::extension::default_extension_po::VTokenParams>",
88121
+ members: [
88122
+ {
88123
+ name: "snapshot",
88124
+ type: "@core::array::Array::<vesu::extension::default_extension_po::VTokenParams>"
88125
+ }
88126
+ ]
88127
+ },
88128
+ {
88129
+ type: "struct",
88130
+ name: "vesu::data_model::LTVParams",
88131
+ members: [
88132
+ {
88133
+ name: "collateral_asset_index",
88134
+ type: "core::integer::u32"
88135
+ },
88136
+ {
88137
+ name: "debt_asset_index",
88138
+ type: "core::integer::u32"
88139
+ },
88140
+ {
88141
+ name: "max_ltv",
88142
+ type: "core::integer::u64"
88143
+ }
88144
+ ]
88145
+ },
88146
+ {
88147
+ type: "struct",
88148
+ name: "core::array::Span::<vesu::data_model::LTVParams>",
88149
+ members: [
88150
+ {
88151
+ name: "snapshot",
88152
+ type: "@core::array::Array::<vesu::data_model::LTVParams>"
88153
+ }
88154
+ ]
88155
+ },
88156
+ {
88157
+ type: "struct",
88158
+ name: "core::array::Span::<vesu::extension::components::interest_rate_model::InterestRateConfig>",
88159
+ members: [
88160
+ {
88161
+ name: "snapshot",
88162
+ type: "@core::array::Array::<vesu::extension::components::interest_rate_model::InterestRateConfig>"
88163
+ }
88164
+ ]
88165
+ },
88166
+ {
88167
+ type: "struct",
88168
+ name: "vesu::extension::default_extension_po::PragmaOracleParams",
88169
+ members: [
88170
+ {
88171
+ name: "pragma_key",
88172
+ type: "core::felt252"
88173
+ },
88174
+ {
88175
+ name: "timeout",
88176
+ type: "core::integer::u64"
88177
+ },
88178
+ {
88179
+ name: "number_of_sources",
88180
+ type: "core::integer::u32"
88181
+ },
88182
+ {
88183
+ name: "start_time_offset",
88184
+ type: "core::integer::u64"
88185
+ },
88186
+ {
88187
+ name: "time_window",
88188
+ type: "core::integer::u64"
88189
+ },
88190
+ {
88191
+ name: "aggregation_mode",
88192
+ type: "vesu::vendor::pragma::AggregationMode"
88193
+ }
88194
+ ]
88195
+ },
88196
+ {
88197
+ type: "struct",
88198
+ name: "core::array::Span::<vesu::extension::default_extension_po::PragmaOracleParams>",
88199
+ members: [
88200
+ {
88201
+ name: "snapshot",
88202
+ type: "@core::array::Array::<vesu::extension::default_extension_po::PragmaOracleParams>"
88203
+ }
88204
+ ]
88205
+ },
88206
+ {
88207
+ type: "struct",
88208
+ name: "vesu::extension::default_extension_po::LiquidationParams",
88209
+ members: [
88210
+ {
88211
+ name: "collateral_asset_index",
88212
+ type: "core::integer::u32"
88213
+ },
88214
+ {
88215
+ name: "debt_asset_index",
88216
+ type: "core::integer::u32"
88217
+ },
88218
+ {
88219
+ name: "liquidation_factor",
88220
+ type: "core::integer::u64"
88221
+ }
88222
+ ]
88223
+ },
88224
+ {
88225
+ type: "struct",
88226
+ name: "core::array::Span::<vesu::extension::default_extension_po::LiquidationParams>",
88227
+ members: [
88228
+ {
88229
+ name: "snapshot",
88230
+ type: "@core::array::Array::<vesu::extension::default_extension_po::LiquidationParams>"
88231
+ }
88232
+ ]
88233
+ },
88234
+ {
88235
+ type: "struct",
88236
+ name: "vesu::data_model::DebtCapParams",
88237
+ members: [
88238
+ {
88239
+ name: "collateral_asset_index",
88240
+ type: "core::integer::u32"
88241
+ },
88242
+ {
88243
+ name: "debt_asset_index",
88244
+ type: "core::integer::u32"
88245
+ },
88246
+ {
88247
+ name: "debt_cap",
88248
+ type: "core::integer::u256"
88249
+ }
88250
+ ]
88251
+ },
88252
+ {
88253
+ type: "struct",
88254
+ name: "core::array::Span::<vesu::data_model::DebtCapParams>",
88255
+ members: [
88256
+ {
88257
+ name: "snapshot",
88258
+ type: "@core::array::Array::<vesu::data_model::DebtCapParams>"
88259
+ }
88260
+ ]
88261
+ },
88262
+ {
88263
+ type: "struct",
88264
+ name: "vesu::extension::default_extension_po::ShutdownParams",
88265
+ members: [
88266
+ {
88267
+ name: "recovery_period",
88268
+ type: "core::integer::u64"
88269
+ },
88270
+ {
88271
+ name: "subscription_period",
88272
+ type: "core::integer::u64"
88273
+ },
88274
+ {
88275
+ name: "ltv_params",
88276
+ type: "core::array::Span::<vesu::data_model::LTVParams>"
88277
+ }
88278
+ ]
88279
+ },
88280
+ {
88281
+ type: "struct",
88282
+ name: "vesu::extension::default_extension_po::FeeParams",
88283
+ members: [
88284
+ {
88285
+ name: "fee_recipient",
88286
+ type: "core::starknet::contract_address::ContractAddress"
88287
+ }
88288
+ ]
88289
+ },
88290
+ {
88291
+ type: "struct",
88292
+ name: "core::array::Span::<(core::felt252, core::felt252, core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress)>",
88293
+ members: [
88294
+ {
88295
+ name: "snapshot",
88296
+ type: "@core::array::Array::<(core::felt252, core::felt252, core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress)>"
88297
+ }
88298
+ ]
88299
+ },
88300
+ {
88301
+ type: "struct",
88302
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::interest_rate_model::InterestRateConfig)>",
88303
+ members: [
88304
+ {
88305
+ name: "snapshot",
88306
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::interest_rate_model::InterestRateConfig)>"
88307
+ }
88308
+ ]
88309
+ },
88310
+ {
88311
+ type: "struct",
88312
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::pragma_oracle::OracleConfig)>",
88313
+ members: [
88314
+ {
88315
+ name: "snapshot",
88316
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::pragma_oracle::OracleConfig)>"
88317
+ }
88318
+ ]
88319
+ },
88320
+ {
88321
+ type: "struct",
88322
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::LiquidationConfig)>",
88323
+ members: [
88324
+ {
88325
+ name: "snapshot",
88326
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::LiquidationConfig)>"
88327
+ }
88328
+ ]
88329
+ },
88330
+ {
88331
+ type: "struct",
88332
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::Pair)>",
88333
+ members: [
88334
+ {
88335
+ name: "snapshot",
88336
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::Pair)>"
88337
+ }
88338
+ ]
88339
+ },
88340
+ {
88341
+ type: "struct",
88342
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, core::integer::u256)>",
88343
+ members: [
88344
+ {
88345
+ name: "snapshot",
88346
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, core::integer::u256)>"
88347
+ }
88348
+ ]
88349
+ },
88350
+ {
88351
+ type: "struct",
88352
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::data_model::LTVConfig)>",
88353
+ members: [
88354
+ {
88355
+ name: "snapshot",
88356
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::data_model::LTVConfig)>"
88357
+ }
88358
+ ]
88359
+ },
88360
+ {
88361
+ type: "interface",
88362
+ name: "vesu::v2::default_extension_po_v2::IDefaultExtensionPOV2",
88363
+ items: [
88364
+ {
88365
+ type: "function",
88366
+ name: "pool_name",
88367
+ inputs: [
88368
+ {
88369
+ name: "pool_id",
88370
+ type: "core::felt252"
88371
+ }
88372
+ ],
88373
+ outputs: [
88374
+ {
88375
+ type: "core::felt252"
88376
+ }
88377
+ ],
88378
+ state_mutability: "view"
88379
+ },
88380
+ {
88381
+ type: "function",
88382
+ name: "pool_owner",
88383
+ inputs: [
88384
+ {
88385
+ name: "pool_id",
88386
+ type: "core::felt252"
88387
+ }
88388
+ ],
88389
+ outputs: [
88390
+ {
88391
+ type: "core::starknet::contract_address::ContractAddress"
88392
+ }
88393
+ ],
88394
+ state_mutability: "view"
88395
+ },
88396
+ {
88397
+ type: "function",
88398
+ name: "shutdown_mode_agent",
88399
+ inputs: [
88400
+ {
88401
+ name: "pool_id",
88402
+ type: "core::felt252"
88403
+ }
88404
+ ],
88405
+ outputs: [
88406
+ {
88407
+ type: "core::starknet::contract_address::ContractAddress"
88408
+ }
88409
+ ],
88410
+ state_mutability: "view"
88411
+ },
88412
+ {
88413
+ type: "function",
88414
+ name: "pragma_oracle",
88415
+ inputs: [],
88416
+ outputs: [
88417
+ {
88418
+ type: "core::starknet::contract_address::ContractAddress"
88419
+ }
88420
+ ],
88421
+ state_mutability: "view"
88422
+ },
88423
+ {
88424
+ type: "function",
88425
+ name: "pragma_summary",
88426
+ inputs: [],
88427
+ outputs: [
88428
+ {
88429
+ type: "core::starknet::contract_address::ContractAddress"
88430
+ }
88431
+ ],
88432
+ state_mutability: "view"
88433
+ },
88434
+ {
88435
+ type: "function",
88436
+ name: "oracle_config",
88437
+ inputs: [
88438
+ {
88439
+ name: "pool_id",
88440
+ type: "core::felt252"
88441
+ },
88442
+ {
88443
+ name: "asset",
88444
+ type: "core::starknet::contract_address::ContractAddress"
88445
+ }
88446
+ ],
88447
+ outputs: [
88448
+ {
88449
+ type: "vesu::extension::components::pragma_oracle::OracleConfig"
88450
+ }
88451
+ ],
88452
+ state_mutability: "view"
88453
+ },
88454
+ {
88455
+ type: "function",
88456
+ name: "fee_config",
88457
+ inputs: [
88458
+ {
88459
+ name: "pool_id",
88460
+ type: "core::felt252"
88461
+ }
88462
+ ],
88463
+ outputs: [
88464
+ {
88465
+ type: "vesu::extension::components::fee_model::FeeConfig"
88466
+ }
88467
+ ],
88468
+ state_mutability: "view"
88469
+ },
88470
+ {
88471
+ type: "function",
88472
+ name: "debt_caps",
88473
+ inputs: [
88474
+ {
88475
+ name: "pool_id",
88476
+ type: "core::felt252"
88477
+ },
88478
+ {
88479
+ name: "collateral_asset",
88480
+ type: "core::starknet::contract_address::ContractAddress"
88481
+ },
88482
+ {
88483
+ name: "debt_asset",
88484
+ type: "core::starknet::contract_address::ContractAddress"
88485
+ }
88486
+ ],
88487
+ outputs: [
88488
+ {
88489
+ type: "core::integer::u256"
88490
+ }
88491
+ ],
88492
+ state_mutability: "view"
88493
+ },
88494
+ {
88495
+ type: "function",
88496
+ name: "interest_rate_config",
88497
+ inputs: [
88498
+ {
88499
+ name: "pool_id",
88500
+ type: "core::felt252"
88501
+ },
88502
+ {
88503
+ name: "asset",
88504
+ type: "core::starknet::contract_address::ContractAddress"
88505
+ }
88506
+ ],
88507
+ outputs: [
88508
+ {
88509
+ type: "vesu::extension::components::interest_rate_model::InterestRateConfig"
88510
+ }
88511
+ ],
88512
+ state_mutability: "view"
88513
+ },
88514
+ {
88515
+ type: "function",
88516
+ name: "liquidation_config",
88517
+ inputs: [
88518
+ {
88519
+ name: "pool_id",
88520
+ type: "core::felt252"
88521
+ },
88522
+ {
88523
+ name: "collateral_asset",
88524
+ type: "core::starknet::contract_address::ContractAddress"
88525
+ },
88526
+ {
88527
+ name: "debt_asset",
88528
+ type: "core::starknet::contract_address::ContractAddress"
88529
+ }
88530
+ ],
88531
+ outputs: [
88532
+ {
88533
+ type: "vesu::extension::components::position_hooks::LiquidationConfig"
88534
+ }
88535
+ ],
88536
+ state_mutability: "view"
88537
+ },
88538
+ {
88539
+ type: "function",
88540
+ name: "shutdown_config",
88541
+ inputs: [
88542
+ {
88543
+ name: "pool_id",
88544
+ type: "core::felt252"
88545
+ }
88546
+ ],
88547
+ outputs: [
88548
+ {
88549
+ type: "vesu::extension::components::position_hooks::ShutdownConfig"
88550
+ }
88551
+ ],
88552
+ state_mutability: "view"
88553
+ },
88554
+ {
88555
+ type: "function",
88556
+ name: "shutdown_ltv_config",
88557
+ inputs: [
88558
+ {
88559
+ name: "pool_id",
88560
+ type: "core::felt252"
88561
+ },
88562
+ {
88563
+ name: "collateral_asset",
88564
+ type: "core::starknet::contract_address::ContractAddress"
88565
+ },
88566
+ {
88567
+ name: "debt_asset",
88568
+ type: "core::starknet::contract_address::ContractAddress"
88569
+ }
88570
+ ],
88571
+ outputs: [
88572
+ {
88573
+ type: "vesu::data_model::LTVConfig"
88574
+ }
88575
+ ],
88576
+ state_mutability: "view"
88577
+ },
88578
+ {
88579
+ type: "function",
88580
+ name: "shutdown_status",
88581
+ inputs: [
88582
+ {
88583
+ name: "pool_id",
88584
+ type: "core::felt252"
88585
+ },
88586
+ {
88587
+ name: "collateral_asset",
88588
+ type: "core::starknet::contract_address::ContractAddress"
88589
+ },
88590
+ {
88591
+ name: "debt_asset",
88592
+ type: "core::starknet::contract_address::ContractAddress"
88593
+ }
88594
+ ],
88595
+ outputs: [
88596
+ {
88597
+ type: "vesu::extension::components::position_hooks::ShutdownStatus"
88598
+ }
88599
+ ],
88600
+ state_mutability: "view"
88601
+ },
88602
+ {
88603
+ type: "function",
88604
+ name: "pairs",
88605
+ inputs: [
88606
+ {
88607
+ name: "pool_id",
88608
+ type: "core::felt252"
88609
+ },
88610
+ {
88611
+ name: "collateral_asset",
88612
+ type: "core::starknet::contract_address::ContractAddress"
88613
+ },
88614
+ {
88615
+ name: "debt_asset",
88616
+ type: "core::starknet::contract_address::ContractAddress"
88617
+ }
88618
+ ],
88619
+ outputs: [
88620
+ {
88621
+ type: "vesu::extension::components::position_hooks::Pair"
88622
+ }
88623
+ ],
88624
+ state_mutability: "view"
88625
+ },
88626
+ {
88627
+ type: "function",
88628
+ name: "violation_timestamp_for_pair",
88629
+ inputs: [
88630
+ {
88631
+ name: "pool_id",
88632
+ type: "core::felt252"
88633
+ },
88634
+ {
88635
+ name: "collateral_asset",
88636
+ type: "core::starknet::contract_address::ContractAddress"
88637
+ },
88638
+ {
88639
+ name: "debt_asset",
88640
+ type: "core::starknet::contract_address::ContractAddress"
88641
+ }
88642
+ ],
88643
+ outputs: [
88644
+ {
88645
+ type: "core::integer::u64"
88646
+ }
88647
+ ],
88648
+ state_mutability: "view"
88649
+ },
88650
+ {
88651
+ type: "function",
88652
+ name: "violation_timestamp_count",
88653
+ inputs: [
88654
+ {
88655
+ name: "pool_id",
88656
+ type: "core::felt252"
88657
+ },
88658
+ {
88659
+ name: "violation_timestamp",
88660
+ type: "core::integer::u64"
88661
+ }
88662
+ ],
88663
+ outputs: [
88664
+ {
88665
+ type: "core::integer::u128"
88666
+ }
88667
+ ],
88668
+ state_mutability: "view"
88669
+ },
88670
+ {
88671
+ type: "function",
88672
+ name: "oldest_violation_timestamp",
88673
+ inputs: [
88674
+ {
88675
+ name: "pool_id",
88676
+ type: "core::felt252"
88677
+ }
88678
+ ],
88679
+ outputs: [
88680
+ {
88681
+ type: "core::integer::u64"
88682
+ }
88683
+ ],
88684
+ state_mutability: "view"
88685
+ },
88686
+ {
88687
+ type: "function",
88688
+ name: "next_violation_timestamp",
88689
+ inputs: [
88690
+ {
88691
+ name: "pool_id",
88692
+ type: "core::felt252"
88693
+ },
88694
+ {
88695
+ name: "violation_timestamp",
88696
+ type: "core::integer::u64"
88697
+ }
88698
+ ],
88699
+ outputs: [
88700
+ {
88701
+ type: "core::integer::u64"
88702
+ }
88703
+ ],
88704
+ state_mutability: "view"
88705
+ },
88706
+ {
88707
+ type: "function",
88708
+ name: "v_token_for_collateral_asset",
88709
+ inputs: [
88710
+ {
88711
+ name: "pool_id",
88712
+ type: "core::felt252"
88713
+ },
88714
+ {
88715
+ name: "collateral_asset",
88716
+ type: "core::starknet::contract_address::ContractAddress"
88717
+ }
88718
+ ],
88719
+ outputs: [
88720
+ {
88721
+ type: "core::starknet::contract_address::ContractAddress"
88722
+ }
88723
+ ],
88724
+ state_mutability: "view"
88725
+ },
88726
+ {
88727
+ type: "function",
88728
+ name: "collateral_asset_for_v_token",
88729
+ inputs: [
88730
+ {
88731
+ name: "pool_id",
88732
+ type: "core::felt252"
88733
+ },
88734
+ {
88735
+ name: "v_token",
88736
+ type: "core::starknet::contract_address::ContractAddress"
88737
+ }
88738
+ ],
88739
+ outputs: [
88740
+ {
88741
+ type: "core::starknet::contract_address::ContractAddress"
88742
+ }
88743
+ ],
88744
+ state_mutability: "view"
88745
+ },
88746
+ {
88747
+ type: "function",
88748
+ name: "create_pool",
88749
+ inputs: [
88750
+ {
88751
+ name: "name",
88752
+ type: "core::felt252"
88753
+ },
88754
+ {
88755
+ name: "asset_params",
88756
+ type: "core::array::Span::<vesu::data_model::AssetParams>"
88757
+ },
88758
+ {
88759
+ name: "v_token_params",
88760
+ type: "core::array::Span::<vesu::extension::default_extension_po::VTokenParams>"
88761
+ },
88762
+ {
88763
+ name: "ltv_params",
88764
+ type: "core::array::Span::<vesu::data_model::LTVParams>"
88765
+ },
88766
+ {
88767
+ name: "interest_rate_configs",
88768
+ type: "core::array::Span::<vesu::extension::components::interest_rate_model::InterestRateConfig>"
88769
+ },
88770
+ {
88771
+ name: "pragma_oracle_params",
88772
+ type: "core::array::Span::<vesu::extension::default_extension_po::PragmaOracleParams>"
88773
+ },
88774
+ {
88775
+ name: "liquidation_params",
88776
+ type: "core::array::Span::<vesu::extension::default_extension_po::LiquidationParams>"
88777
+ },
88778
+ {
88779
+ name: "debt_caps",
88780
+ type: "core::array::Span::<vesu::data_model::DebtCapParams>"
88781
+ },
88782
+ {
88783
+ name: "shutdown_params",
88784
+ type: "vesu::extension::default_extension_po::ShutdownParams"
88785
+ },
88786
+ {
88787
+ name: "fee_params",
88788
+ type: "vesu::extension::default_extension_po::FeeParams"
88789
+ },
88790
+ {
88791
+ name: "owner",
88792
+ type: "core::starknet::contract_address::ContractAddress"
88793
+ }
88794
+ ],
88795
+ outputs: [
88796
+ {
88797
+ type: "core::felt252"
88798
+ }
88799
+ ],
88800
+ state_mutability: "external"
88801
+ },
88802
+ {
88803
+ type: "function",
88804
+ name: "add_asset",
88805
+ inputs: [
88806
+ {
88807
+ name: "pool_id",
88808
+ type: "core::felt252"
88809
+ },
88810
+ {
88811
+ name: "asset_params",
88812
+ type: "vesu::data_model::AssetParams"
88813
+ },
88814
+ {
88815
+ name: "v_token_params",
88816
+ type: "vesu::extension::default_extension_po::VTokenParams"
88817
+ },
88818
+ {
88819
+ name: "interest_rate_config",
88820
+ type: "vesu::extension::components::interest_rate_model::InterestRateConfig"
88821
+ },
88822
+ {
88823
+ name: "pragma_oracle_params",
88824
+ type: "vesu::extension::default_extension_po::PragmaOracleParams"
88825
+ }
88826
+ ],
88827
+ outputs: [],
88828
+ state_mutability: "external"
88829
+ },
88830
+ {
88831
+ type: "function",
88832
+ name: "set_asset_parameter",
88833
+ inputs: [
88834
+ {
88835
+ name: "pool_id",
88836
+ type: "core::felt252"
88837
+ },
88838
+ {
88839
+ name: "asset",
88840
+ type: "core::starknet::contract_address::ContractAddress"
88841
+ },
88842
+ {
88843
+ name: "parameter",
88844
+ type: "core::felt252"
88845
+ },
88846
+ {
88847
+ name: "value",
88848
+ type: "core::integer::u256"
88849
+ }
88850
+ ],
88851
+ outputs: [],
88852
+ state_mutability: "external"
88853
+ },
88854
+ {
88855
+ type: "function",
88856
+ name: "set_debt_cap",
88857
+ inputs: [
88858
+ {
88859
+ name: "pool_id",
88860
+ type: "core::felt252"
88861
+ },
88862
+ {
88863
+ name: "collateral_asset",
88864
+ type: "core::starknet::contract_address::ContractAddress"
88865
+ },
88866
+ {
88867
+ name: "debt_asset",
88868
+ type: "core::starknet::contract_address::ContractAddress"
88869
+ },
88870
+ {
88871
+ name: "debt_cap",
88872
+ type: "core::integer::u256"
88873
+ }
88874
+ ],
88875
+ outputs: [],
88876
+ state_mutability: "external"
88877
+ },
88878
+ {
88879
+ type: "function",
88880
+ name: "set_interest_rate_parameter",
88881
+ inputs: [
88882
+ {
88883
+ name: "pool_id",
88884
+ type: "core::felt252"
88885
+ },
88886
+ {
88887
+ name: "asset",
88888
+ type: "core::starknet::contract_address::ContractAddress"
88889
+ },
88890
+ {
88891
+ name: "parameter",
88892
+ type: "core::felt252"
88893
+ },
88894
+ {
88895
+ name: "value",
88896
+ type: "core::integer::u256"
88897
+ }
88898
+ ],
88899
+ outputs: [],
88900
+ state_mutability: "external"
88901
+ },
88902
+ {
88903
+ type: "function",
88904
+ name: "set_oracle_parameter",
88905
+ inputs: [
88906
+ {
88907
+ name: "pool_id",
88908
+ type: "core::felt252"
88909
+ },
88910
+ {
88911
+ name: "asset",
88912
+ type: "core::starknet::contract_address::ContractAddress"
88913
+ },
88914
+ {
88915
+ name: "parameter",
88916
+ type: "core::felt252"
88917
+ },
88918
+ {
88919
+ name: "value",
88920
+ type: "core::felt252"
88921
+ }
88922
+ ],
88923
+ outputs: [],
88924
+ state_mutability: "external"
88925
+ },
88926
+ {
88927
+ type: "function",
88928
+ name: "set_liquidation_config",
88929
+ inputs: [
88930
+ {
88931
+ name: "pool_id",
88932
+ type: "core::felt252"
88933
+ },
88934
+ {
88935
+ name: "collateral_asset",
88936
+ type: "core::starknet::contract_address::ContractAddress"
88937
+ },
88938
+ {
88939
+ name: "debt_asset",
88940
+ type: "core::starknet::contract_address::ContractAddress"
88941
+ },
88942
+ {
88943
+ name: "liquidation_config",
88944
+ type: "vesu::extension::components::position_hooks::LiquidationConfig"
88945
+ }
88946
+ ],
88947
+ outputs: [],
88948
+ state_mutability: "external"
88949
+ },
88950
+ {
88951
+ type: "function",
88952
+ name: "set_ltv_config",
88953
+ inputs: [
88954
+ {
88955
+ name: "pool_id",
88956
+ type: "core::felt252"
88957
+ },
88958
+ {
88959
+ name: "collateral_asset",
88960
+ type: "core::starknet::contract_address::ContractAddress"
88961
+ },
88962
+ {
88963
+ name: "debt_asset",
88964
+ type: "core::starknet::contract_address::ContractAddress"
88965
+ },
88966
+ {
88967
+ name: "ltv_config",
88968
+ type: "vesu::data_model::LTVConfig"
88969
+ }
88970
+ ],
88971
+ outputs: [],
88972
+ state_mutability: "external"
88973
+ },
88974
+ {
88975
+ type: "function",
88976
+ name: "set_shutdown_config",
88977
+ inputs: [
88978
+ {
88979
+ name: "pool_id",
88980
+ type: "core::felt252"
88981
+ },
88982
+ {
88983
+ name: "shutdown_config",
88984
+ type: "vesu::extension::components::position_hooks::ShutdownConfig"
88985
+ }
88986
+ ],
88987
+ outputs: [],
88988
+ state_mutability: "external"
88989
+ },
88990
+ {
88991
+ type: "function",
88992
+ name: "set_shutdown_ltv_config",
88993
+ inputs: [
88994
+ {
88995
+ name: "pool_id",
88996
+ type: "core::felt252"
88997
+ },
88998
+ {
88999
+ name: "collateral_asset",
89000
+ type: "core::starknet::contract_address::ContractAddress"
89001
+ },
89002
+ {
89003
+ name: "debt_asset",
89004
+ type: "core::starknet::contract_address::ContractAddress"
89005
+ },
89006
+ {
89007
+ name: "shutdown_ltv_config",
89008
+ type: "vesu::data_model::LTVConfig"
89009
+ }
89010
+ ],
89011
+ outputs: [],
89012
+ state_mutability: "external"
89013
+ },
89014
+ {
89015
+ type: "function",
89016
+ name: "set_shutdown_mode",
89017
+ inputs: [
89018
+ {
89019
+ name: "pool_id",
89020
+ type: "core::felt252"
89021
+ },
89022
+ {
89023
+ name: "shutdown_mode",
89024
+ type: "vesu::extension::components::position_hooks::ShutdownMode"
89025
+ }
89026
+ ],
89027
+ outputs: [],
89028
+ state_mutability: "external"
89029
+ },
89030
+ {
89031
+ type: "function",
89032
+ name: "set_pool_owner",
89033
+ inputs: [
89034
+ {
89035
+ name: "pool_id",
89036
+ type: "core::felt252"
89037
+ },
89038
+ {
89039
+ name: "owner",
89040
+ type: "core::starknet::contract_address::ContractAddress"
89041
+ }
89042
+ ],
89043
+ outputs: [],
89044
+ state_mutability: "external"
89045
+ },
89046
+ {
89047
+ type: "function",
89048
+ name: "set_shutdown_mode_agent",
89049
+ inputs: [
89050
+ {
89051
+ name: "pool_id",
89052
+ type: "core::felt252"
89053
+ },
89054
+ {
89055
+ name: "shutdown_mode_agent",
89056
+ type: "core::starknet::contract_address::ContractAddress"
89057
+ }
89058
+ ],
89059
+ outputs: [],
89060
+ state_mutability: "external"
89061
+ },
89062
+ {
89063
+ type: "function",
89064
+ name: "update_shutdown_status",
89065
+ inputs: [
89066
+ {
89067
+ name: "pool_id",
89068
+ type: "core::felt252"
89069
+ },
89070
+ {
89071
+ name: "collateral_asset",
89072
+ type: "core::starknet::contract_address::ContractAddress"
89073
+ },
89074
+ {
89075
+ name: "debt_asset",
89076
+ type: "core::starknet::contract_address::ContractAddress"
89077
+ }
89078
+ ],
89079
+ outputs: [
89080
+ {
89081
+ type: "vesu::extension::components::position_hooks::ShutdownMode"
89082
+ }
89083
+ ],
89084
+ state_mutability: "external"
89085
+ },
89086
+ {
89087
+ type: "function",
89088
+ name: "set_fee_config",
89089
+ inputs: [
89090
+ {
89091
+ name: "pool_id",
89092
+ type: "core::felt252"
89093
+ },
89094
+ {
89095
+ name: "fee_config",
89096
+ type: "vesu::extension::components::fee_model::FeeConfig"
89097
+ }
89098
+ ],
89099
+ outputs: [],
89100
+ state_mutability: "external"
89101
+ },
89102
+ {
89103
+ type: "function",
89104
+ name: "claim_fees",
89105
+ inputs: [
89106
+ {
89107
+ name: "pool_id",
89108
+ type: "core::felt252"
89109
+ },
89110
+ {
89111
+ name: "collateral_asset",
89112
+ type: "core::starknet::contract_address::ContractAddress"
89113
+ }
89114
+ ],
89115
+ outputs: [],
89116
+ state_mutability: "external"
89117
+ },
89118
+ {
89119
+ type: "function",
89120
+ name: "migrate_pool",
89121
+ inputs: [
89122
+ {
89123
+ name: "pool_id",
89124
+ type: "core::felt252"
89125
+ },
89126
+ {
89127
+ name: "name",
89128
+ type: "core::felt252"
89129
+ },
89130
+ {
89131
+ name: "v_token_configs",
89132
+ type: "core::array::Span::<(core::felt252, core::felt252, core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress)>"
89133
+ },
89134
+ {
89135
+ name: "interest_rate_configs",
89136
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::interest_rate_model::InterestRateConfig)>"
89137
+ },
89138
+ {
89139
+ name: "pragma_oracle_configs",
89140
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::pragma_oracle::OracleConfig)>"
89141
+ },
89142
+ {
89143
+ name: "liquidation_configs",
89144
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::LiquidationConfig)>"
89145
+ },
89146
+ {
89147
+ name: "pairs",
89148
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::Pair)>"
89149
+ },
89150
+ {
89151
+ name: "debt_caps",
89152
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, core::integer::u256)>"
89153
+ },
89154
+ {
89155
+ name: "shutdown_ltv_configs",
89156
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::data_model::LTVConfig)>"
89157
+ },
89158
+ {
89159
+ name: "shutdown_config",
89160
+ type: "vesu::extension::components::position_hooks::ShutdownConfig"
89161
+ },
89162
+ {
89163
+ name: "fee_config",
89164
+ type: "vesu::extension::components::fee_model::FeeConfig"
89165
+ },
89166
+ {
89167
+ name: "owner",
89168
+ type: "core::starknet::contract_address::ContractAddress"
89169
+ }
89170
+ ],
89171
+ outputs: [],
89172
+ state_mutability: "external"
89173
+ },
89174
+ {
89175
+ type: "function",
89176
+ name: "set_migrator",
89177
+ inputs: [
89178
+ {
89179
+ name: "migrator",
89180
+ type: "core::starknet::contract_address::ContractAddress"
89181
+ }
89182
+ ],
89183
+ outputs: [],
89184
+ state_mutability: "external"
89185
+ },
89186
+ {
89187
+ type: "function",
89188
+ name: "set_extension_utils_class_hash",
89189
+ inputs: [
89190
+ {
89191
+ name: "extension",
89192
+ type: "core::felt252"
89193
+ }
89194
+ ],
89195
+ outputs: [],
89196
+ state_mutability: "external"
89197
+ },
89198
+ {
89199
+ type: "function",
89200
+ name: "upgrade_name",
89201
+ inputs: [],
89202
+ outputs: [
89203
+ {
89204
+ type: "core::felt252"
89205
+ }
89206
+ ],
89207
+ state_mutability: "view"
89208
+ },
89209
+ {
89210
+ type: "function",
89211
+ name: "upgrade",
89212
+ inputs: [
89213
+ {
89214
+ name: "new_implementation",
89215
+ type: "core::starknet::class_hash::ClassHash"
89216
+ }
89217
+ ],
89218
+ outputs: [],
89219
+ state_mutability: "external"
89220
+ }
89221
+ ]
89222
+ },
89223
+ {
89224
+ type: "impl",
89225
+ name: "ExtensionImpl",
89226
+ interface_name: "vesu::extension::interface::IExtension"
89227
+ },
89228
+ {
89229
+ type: "struct",
89230
+ name: "vesu::data_model::AssetPrice",
89231
+ members: [
89232
+ {
89233
+ name: "value",
89234
+ type: "core::integer::u256"
89235
+ },
89236
+ {
89237
+ name: "is_valid",
89238
+ type: "core::bool"
89239
+ }
89240
+ ]
89241
+ },
89242
+ {
89243
+ type: "struct",
89244
+ name: "vesu::data_model::AssetConfig",
89245
+ members: [
89246
+ {
89247
+ name: "total_collateral_shares",
89248
+ type: "core::integer::u256"
89249
+ },
89250
+ {
89251
+ name: "total_nominal_debt",
89252
+ type: "core::integer::u256"
89253
+ },
89254
+ {
89255
+ name: "reserve",
89256
+ type: "core::integer::u256"
89257
+ },
89258
+ {
89259
+ name: "max_utilization",
89260
+ type: "core::integer::u256"
89261
+ },
89262
+ {
89263
+ name: "floor",
89264
+ type: "core::integer::u256"
89265
+ },
89266
+ {
89267
+ name: "scale",
89268
+ type: "core::integer::u256"
89269
+ },
89270
+ {
89271
+ name: "is_legacy",
89272
+ type: "core::bool"
89273
+ },
89274
+ {
89275
+ name: "last_updated",
89276
+ type: "core::integer::u64"
89277
+ },
89278
+ {
89279
+ name: "last_rate_accumulator",
89280
+ type: "core::integer::u256"
89281
+ },
89282
+ {
89283
+ name: "last_full_utilization_rate",
89284
+ type: "core::integer::u256"
89285
+ },
89286
+ {
89287
+ name: "fee_rate",
89288
+ type: "core::integer::u256"
89289
+ }
89290
+ ]
89291
+ },
89292
+ {
89293
+ type: "struct",
89294
+ name: "vesu::data_model::Position",
89295
+ members: [
89296
+ {
89297
+ name: "collateral_shares",
89298
+ type: "core::integer::u256"
89299
+ },
89300
+ {
89301
+ name: "nominal_debt",
89302
+ type: "core::integer::u256"
89303
+ }
89304
+ ]
89305
+ },
89306
+ {
89307
+ type: "struct",
89308
+ name: "vesu::data_model::Context",
89309
+ members: [
89310
+ {
89311
+ name: "pool_id",
89312
+ type: "core::felt252"
89313
+ },
89314
+ {
89315
+ name: "extension",
89316
+ type: "core::starknet::contract_address::ContractAddress"
89317
+ },
89318
+ {
89319
+ name: "collateral_asset",
89320
+ type: "core::starknet::contract_address::ContractAddress"
89321
+ },
89322
+ {
89323
+ name: "debt_asset",
89324
+ type: "core::starknet::contract_address::ContractAddress"
89325
+ },
89326
+ {
89327
+ name: "collateral_asset_config",
89328
+ type: "vesu::data_model::AssetConfig"
89329
+ },
89330
+ {
89331
+ name: "debt_asset_config",
89332
+ type: "vesu::data_model::AssetConfig"
89333
+ },
89334
+ {
89335
+ name: "collateral_asset_price",
89336
+ type: "vesu::data_model::AssetPrice"
89337
+ },
89338
+ {
89339
+ name: "debt_asset_price",
89340
+ type: "vesu::data_model::AssetPrice"
89341
+ },
89342
+ {
89343
+ name: "collateral_asset_fee_shares",
89344
+ type: "core::integer::u256"
89345
+ },
89346
+ {
89347
+ name: "debt_asset_fee_shares",
89348
+ type: "core::integer::u256"
89349
+ },
89350
+ {
89351
+ name: "max_ltv",
89352
+ type: "core::integer::u64"
89353
+ },
89354
+ {
89355
+ name: "user",
89356
+ type: "core::starknet::contract_address::ContractAddress"
89357
+ },
89358
+ {
89359
+ name: "position",
89360
+ type: "vesu::data_model::Position"
89361
+ }
89362
+ ]
89363
+ },
89364
+ {
89365
+ type: "enum",
89366
+ name: "vesu::data_model::AmountType",
89367
+ variants: [
89368
+ {
89369
+ name: "Delta",
89370
+ type: "()"
89371
+ },
89372
+ {
89373
+ name: "Target",
89374
+ type: "()"
89375
+ }
89376
+ ]
89377
+ },
89378
+ {
89379
+ type: "enum",
89380
+ name: "vesu::data_model::AmountDenomination",
89381
+ variants: [
89382
+ {
89383
+ name: "Native",
89384
+ type: "()"
89385
+ },
89386
+ {
89387
+ name: "Assets",
89388
+ type: "()"
89389
+ }
89390
+ ]
89391
+ },
89392
+ {
89393
+ type: "struct",
89394
+ name: "alexandria_math::i257::i257",
89395
+ members: [
89396
+ {
89397
+ name: "abs",
89398
+ type: "core::integer::u256"
89399
+ },
89400
+ {
89401
+ name: "is_negative",
89402
+ type: "core::bool"
89403
+ }
89404
+ ]
89405
+ },
89406
+ {
89407
+ type: "struct",
89408
+ name: "vesu::data_model::Amount",
89409
+ members: [
89410
+ {
89411
+ name: "amount_type",
89412
+ type: "vesu::data_model::AmountType"
89413
+ },
89414
+ {
89415
+ name: "denomination",
89416
+ type: "vesu::data_model::AmountDenomination"
89417
+ },
89418
+ {
89419
+ name: "value",
89420
+ type: "alexandria_math::i257::i257"
89421
+ }
89422
+ ]
89423
+ },
89424
+ {
89425
+ type: "struct",
89426
+ name: "core::array::Span::<core::felt252>",
89427
+ members: [
89428
+ {
89429
+ name: "snapshot",
89430
+ type: "@core::array::Array::<core::felt252>"
89431
+ }
89432
+ ]
89433
+ },
89434
+ {
89435
+ type: "struct",
89436
+ name: "vesu::data_model::UnsignedAmount",
89437
+ members: [
89438
+ {
89439
+ name: "amount_type",
89440
+ type: "vesu::data_model::AmountType"
89441
+ },
89442
+ {
89443
+ name: "denomination",
89444
+ type: "vesu::data_model::AmountDenomination"
89445
+ },
89446
+ {
89447
+ name: "value",
89448
+ type: "core::integer::u256"
89449
+ }
89450
+ ]
89451
+ },
89452
+ {
89453
+ type: "interface",
89454
+ name: "vesu::extension::interface::IExtension",
89455
+ items: [
89456
+ {
89457
+ type: "function",
89458
+ name: "singleton",
89459
+ inputs: [],
89460
+ outputs: [
89461
+ {
89462
+ type: "core::starknet::contract_address::ContractAddress"
89463
+ }
89464
+ ],
89465
+ state_mutability: "view"
89466
+ },
89467
+ {
89468
+ type: "function",
89469
+ name: "price",
89470
+ inputs: [
89471
+ {
89472
+ name: "pool_id",
89473
+ type: "core::felt252"
89474
+ },
89475
+ {
89476
+ name: "asset",
89477
+ type: "core::starknet::contract_address::ContractAddress"
89478
+ }
89479
+ ],
89480
+ outputs: [
89481
+ {
89482
+ type: "vesu::data_model::AssetPrice"
89483
+ }
89484
+ ],
89485
+ state_mutability: "view"
89486
+ },
89487
+ {
89488
+ type: "function",
89489
+ name: "interest_rate",
89490
+ inputs: [
89491
+ {
89492
+ name: "pool_id",
89493
+ type: "core::felt252"
89494
+ },
89495
+ {
89496
+ name: "asset",
89497
+ type: "core::starknet::contract_address::ContractAddress"
89498
+ },
89499
+ {
89500
+ name: "utilization",
89501
+ type: "core::integer::u256"
89502
+ },
89503
+ {
89504
+ name: "last_updated",
89505
+ type: "core::integer::u64"
89506
+ },
89507
+ {
89508
+ name: "last_full_utilization_rate",
89509
+ type: "core::integer::u256"
89510
+ }
89511
+ ],
89512
+ outputs: [
89513
+ {
89514
+ type: "core::integer::u256"
89515
+ }
89516
+ ],
89517
+ state_mutability: "view"
89518
+ },
89519
+ {
89520
+ type: "function",
89521
+ name: "rate_accumulator",
89522
+ inputs: [
89523
+ {
89524
+ name: "pool_id",
89525
+ type: "core::felt252"
89526
+ },
89527
+ {
89528
+ name: "asset",
89529
+ type: "core::starknet::contract_address::ContractAddress"
89530
+ },
89531
+ {
89532
+ name: "utilization",
89533
+ type: "core::integer::u256"
89534
+ },
89535
+ {
89536
+ name: "last_updated",
89537
+ type: "core::integer::u64"
89538
+ },
89539
+ {
89540
+ name: "last_rate_accumulator",
89541
+ type: "core::integer::u256"
89542
+ },
89543
+ {
89544
+ name: "last_full_utilization_rate",
89545
+ type: "core::integer::u256"
89546
+ }
89547
+ ],
89548
+ outputs: [
89549
+ {
89550
+ type: "(core::integer::u256, core::integer::u256)"
89551
+ }
89552
+ ],
89553
+ state_mutability: "view"
89554
+ },
89555
+ {
89556
+ type: "function",
89557
+ name: "before_modify_position",
89558
+ inputs: [
89559
+ {
89560
+ name: "context",
89561
+ type: "vesu::data_model::Context"
89562
+ },
89563
+ {
89564
+ name: "collateral",
89565
+ type: "vesu::data_model::Amount"
89566
+ },
89567
+ {
89568
+ name: "debt",
89569
+ type: "vesu::data_model::Amount"
89570
+ },
89571
+ {
89572
+ name: "data",
89573
+ type: "core::array::Span::<core::felt252>"
89574
+ },
89575
+ {
89576
+ name: "caller",
89577
+ type: "core::starknet::contract_address::ContractAddress"
89578
+ }
89579
+ ],
89580
+ outputs: [
89581
+ {
89582
+ type: "(vesu::data_model::Amount, vesu::data_model::Amount)"
89583
+ }
89584
+ ],
89585
+ state_mutability: "external"
89586
+ },
89587
+ {
89588
+ type: "function",
89589
+ name: "after_modify_position",
89590
+ inputs: [
89591
+ {
89592
+ name: "context",
89593
+ type: "vesu::data_model::Context"
89594
+ },
89595
+ {
89596
+ name: "collateral_delta",
89597
+ type: "alexandria_math::i257::i257"
89598
+ },
89599
+ {
89600
+ name: "collateral_shares_delta",
89601
+ type: "alexandria_math::i257::i257"
89602
+ },
89603
+ {
89604
+ name: "debt_delta",
89605
+ type: "alexandria_math::i257::i257"
89606
+ },
89607
+ {
89608
+ name: "nominal_debt_delta",
89609
+ type: "alexandria_math::i257::i257"
89610
+ },
89611
+ {
89612
+ name: "data",
89613
+ type: "core::array::Span::<core::felt252>"
89614
+ },
89615
+ {
89616
+ name: "caller",
89617
+ type: "core::starknet::contract_address::ContractAddress"
89618
+ }
89619
+ ],
89620
+ outputs: [
89621
+ {
89622
+ type: "core::bool"
89623
+ }
89624
+ ],
89625
+ state_mutability: "external"
89626
+ },
89627
+ {
89628
+ type: "function",
89629
+ name: "before_transfer_position",
89630
+ inputs: [
89631
+ {
89632
+ name: "from_context",
89633
+ type: "vesu::data_model::Context"
89634
+ },
89635
+ {
89636
+ name: "to_context",
89637
+ type: "vesu::data_model::Context"
89638
+ },
89639
+ {
89640
+ name: "collateral",
89641
+ type: "vesu::data_model::UnsignedAmount"
89642
+ },
89643
+ {
89644
+ name: "debt",
89645
+ type: "vesu::data_model::UnsignedAmount"
89646
+ },
89647
+ {
89648
+ name: "data",
89649
+ type: "core::array::Span::<core::felt252>"
89650
+ },
89651
+ {
89652
+ name: "caller",
89653
+ type: "core::starknet::contract_address::ContractAddress"
89654
+ }
89655
+ ],
89656
+ outputs: [
89657
+ {
89658
+ type: "(vesu::data_model::UnsignedAmount, vesu::data_model::UnsignedAmount)"
89659
+ }
89660
+ ],
89661
+ state_mutability: "external"
89662
+ },
89663
+ {
89664
+ type: "function",
89665
+ name: "after_transfer_position",
89666
+ inputs: [
89667
+ {
89668
+ name: "from_context",
89669
+ type: "vesu::data_model::Context"
89670
+ },
89671
+ {
89672
+ name: "to_context",
89673
+ type: "vesu::data_model::Context"
89674
+ },
89675
+ {
89676
+ name: "collateral_delta",
89677
+ type: "core::integer::u256"
89678
+ },
89679
+ {
89680
+ name: "collateral_shares_delta",
89681
+ type: "core::integer::u256"
89682
+ },
89683
+ {
89684
+ name: "debt_delta",
89685
+ type: "core::integer::u256"
89686
+ },
89687
+ {
89688
+ name: "nominal_debt_delta",
89689
+ type: "core::integer::u256"
89690
+ },
89691
+ {
89692
+ name: "data",
89693
+ type: "core::array::Span::<core::felt252>"
89694
+ },
89695
+ {
89696
+ name: "caller",
89697
+ type: "core::starknet::contract_address::ContractAddress"
89698
+ }
89699
+ ],
89700
+ outputs: [
89701
+ {
89702
+ type: "core::bool"
89703
+ }
89704
+ ],
89705
+ state_mutability: "external"
89706
+ },
89707
+ {
89708
+ type: "function",
89709
+ name: "before_liquidate_position",
89710
+ inputs: [
89711
+ {
89712
+ name: "context",
89713
+ type: "vesu::data_model::Context"
89714
+ },
89715
+ {
89716
+ name: "data",
89717
+ type: "core::array::Span::<core::felt252>"
89718
+ },
89719
+ {
89720
+ name: "caller",
89721
+ type: "core::starknet::contract_address::ContractAddress"
89722
+ }
89723
+ ],
89724
+ outputs: [
89725
+ {
89726
+ type: "(core::integer::u256, core::integer::u256, core::integer::u256)"
89727
+ }
89728
+ ],
89729
+ state_mutability: "external"
89730
+ },
89731
+ {
89732
+ type: "function",
89733
+ name: "after_liquidate_position",
89734
+ inputs: [
89735
+ {
89736
+ name: "context",
89737
+ type: "vesu::data_model::Context"
89738
+ },
89739
+ {
89740
+ name: "collateral_delta",
89741
+ type: "alexandria_math::i257::i257"
89742
+ },
89743
+ {
89744
+ name: "collateral_shares_delta",
89745
+ type: "alexandria_math::i257::i257"
89746
+ },
89747
+ {
89748
+ name: "debt_delta",
89749
+ type: "alexandria_math::i257::i257"
89750
+ },
89751
+ {
89752
+ name: "nominal_debt_delta",
89753
+ type: "alexandria_math::i257::i257"
89754
+ },
89755
+ {
89756
+ name: "bad_debt",
89757
+ type: "core::integer::u256"
89758
+ },
89759
+ {
89760
+ name: "data",
89761
+ type: "core::array::Span::<core::felt252>"
89762
+ },
89763
+ {
89764
+ name: "caller",
89765
+ type: "core::starknet::contract_address::ContractAddress"
89766
+ }
89767
+ ],
89768
+ outputs: [
89769
+ {
89770
+ type: "core::bool"
89771
+ }
89772
+ ],
89773
+ state_mutability: "external"
89774
+ }
89775
+ ]
89776
+ },
89777
+ {
89778
+ type: "constructor",
89779
+ name: "constructor",
89780
+ inputs: [
89781
+ {
89782
+ name: "singleton",
89783
+ type: "core::starknet::contract_address::ContractAddress"
89784
+ },
89785
+ {
89786
+ name: "oracle_address",
89787
+ type: "core::starknet::contract_address::ContractAddress"
89788
+ },
89789
+ {
89790
+ name: "summary_address",
89791
+ type: "core::starknet::contract_address::ContractAddress"
89792
+ },
89793
+ {
89794
+ name: "v_token_class_hash",
89795
+ type: "core::felt252"
89796
+ },
89797
+ {
89798
+ name: "v_token_v2_class_hash",
89799
+ type: "core::felt252"
89800
+ },
89801
+ {
89802
+ name: "migrator",
89803
+ type: "core::starknet::contract_address::ContractAddress"
89804
+ },
89805
+ {
89806
+ name: "extension_utils_class_hash",
89807
+ type: "core::felt252"
89808
+ }
89809
+ ]
89810
+ },
89811
+ {
89812
+ type: "event",
89813
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetLiquidationConfig",
89814
+ kind: "struct",
89815
+ members: [
89816
+ {
89817
+ name: "pool_id",
89818
+ type: "core::felt252",
89819
+ kind: "key"
89820
+ },
89821
+ {
89822
+ name: "collateral_asset",
89823
+ type: "core::starknet::contract_address::ContractAddress",
89824
+ kind: "key"
89825
+ },
89826
+ {
89827
+ name: "debt_asset",
89828
+ type: "core::starknet::contract_address::ContractAddress",
89829
+ kind: "key"
89830
+ },
89831
+ {
89832
+ name: "liquidation_config",
89833
+ type: "vesu::extension::components::position_hooks::LiquidationConfig",
89834
+ kind: "data"
89835
+ }
89836
+ ]
89837
+ },
89838
+ {
89839
+ type: "event",
89840
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownConfig",
89841
+ kind: "struct",
89842
+ members: [
89843
+ {
89844
+ name: "pool_id",
89845
+ type: "core::felt252",
89846
+ kind: "key"
89847
+ },
89848
+ {
89849
+ name: "shutdown_config",
89850
+ type: "vesu::extension::components::position_hooks::ShutdownConfig",
89851
+ kind: "data"
89852
+ }
89853
+ ]
89854
+ },
89855
+ {
89856
+ type: "event",
89857
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownLTVConfig",
89858
+ kind: "struct",
89859
+ members: [
89860
+ {
89861
+ name: "pool_id",
89862
+ type: "core::felt252",
89863
+ kind: "key"
89864
+ },
89865
+ {
89866
+ name: "collateral_asset",
89867
+ type: "core::starknet::contract_address::ContractAddress",
89868
+ kind: "key"
89869
+ },
89870
+ {
89871
+ name: "debt_asset",
89872
+ type: "core::starknet::contract_address::ContractAddress",
89873
+ kind: "key"
89874
+ },
89875
+ {
89876
+ name: "shutdown_ltv_config",
89877
+ type: "vesu::data_model::LTVConfig",
89878
+ kind: "data"
89879
+ }
89880
+ ]
89881
+ },
89882
+ {
89883
+ type: "event",
89884
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetDebtCap",
89885
+ kind: "struct",
89886
+ members: [
89887
+ {
89888
+ name: "pool_id",
89889
+ type: "core::felt252",
89890
+ kind: "key"
89891
+ },
89892
+ {
89893
+ name: "collateral_asset",
89894
+ type: "core::starknet::contract_address::ContractAddress",
89895
+ kind: "key"
89896
+ },
89897
+ {
89898
+ name: "debt_asset",
89899
+ type: "core::starknet::contract_address::ContractAddress",
89900
+ kind: "key"
89901
+ },
89902
+ {
89903
+ name: "debt_cap",
89904
+ type: "core::integer::u256",
89905
+ kind: "data"
89906
+ }
89907
+ ]
89908
+ },
89909
+ {
89910
+ type: "event",
89911
+ name: "vesu::extension::components::position_hooks::position_hooks_component::Event",
89912
+ kind: "enum",
89913
+ variants: [
89914
+ {
89915
+ name: "SetLiquidationConfig",
89916
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetLiquidationConfig",
89917
+ kind: "nested"
89918
+ },
89919
+ {
89920
+ name: "SetShutdownConfig",
89921
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownConfig",
89922
+ kind: "nested"
89923
+ },
89924
+ {
89925
+ name: "SetShutdownLTVConfig",
89926
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownLTVConfig",
89927
+ kind: "nested"
89928
+ },
89929
+ {
89930
+ name: "SetDebtCap",
89931
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetDebtCap",
89932
+ kind: "nested"
89933
+ }
89934
+ ]
89935
+ },
89936
+ {
89937
+ type: "event",
89938
+ name: "vesu::extension::components::interest_rate_model::interest_rate_model_component::SetInterestRateConfig",
89939
+ kind: "struct",
89940
+ members: [
89941
+ {
89942
+ name: "pool_id",
89943
+ type: "core::felt252",
89944
+ kind: "data"
89945
+ },
89946
+ {
89947
+ name: "asset",
89948
+ type: "core::starknet::contract_address::ContractAddress",
89949
+ kind: "data"
89950
+ },
89951
+ {
89952
+ name: "interest_rate_config",
89953
+ type: "vesu::extension::components::interest_rate_model::InterestRateConfig",
89954
+ kind: "data"
89955
+ }
89956
+ ]
89957
+ },
89958
+ {
89959
+ type: "event",
89960
+ name: "vesu::extension::components::interest_rate_model::interest_rate_model_component::Event",
89961
+ kind: "enum",
89962
+ variants: [
89963
+ {
89964
+ name: "SetInterestRateConfig",
89965
+ type: "vesu::extension::components::interest_rate_model::interest_rate_model_component::SetInterestRateConfig",
89966
+ kind: "nested"
89967
+ }
89968
+ ]
89969
+ },
89970
+ {
89971
+ type: "event",
89972
+ name: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleConfig",
89973
+ kind: "struct",
89974
+ members: [
89975
+ {
89976
+ name: "pool_id",
89977
+ type: "core::felt252",
89978
+ kind: "data"
89979
+ },
89980
+ {
89981
+ name: "asset",
89982
+ type: "core::starknet::contract_address::ContractAddress",
89983
+ kind: "data"
89984
+ },
89985
+ {
89986
+ name: "oracle_config",
89987
+ type: "vesu::extension::components::pragma_oracle::OracleConfig",
89988
+ kind: "data"
89989
+ }
89990
+ ]
89991
+ },
89992
+ {
89993
+ type: "event",
89994
+ name: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleParameter",
89995
+ kind: "struct",
89996
+ members: [
89997
+ {
89998
+ name: "pool_id",
89999
+ type: "core::felt252",
90000
+ kind: "data"
90001
+ },
90002
+ {
90003
+ name: "asset",
90004
+ type: "core::starknet::contract_address::ContractAddress",
90005
+ kind: "data"
90006
+ },
90007
+ {
90008
+ name: "parameter",
90009
+ type: "core::felt252",
90010
+ kind: "data"
90011
+ },
90012
+ {
90013
+ name: "value",
90014
+ type: "core::felt252",
90015
+ kind: "data"
90016
+ }
90017
+ ]
90018
+ },
90019
+ {
90020
+ type: "event",
90021
+ name: "vesu::extension::components::pragma_oracle::pragma_oracle_component::Event",
90022
+ kind: "enum",
90023
+ variants: [
90024
+ {
90025
+ name: "SetOracleConfig",
90026
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleConfig",
90027
+ kind: "nested"
90028
+ },
90029
+ {
90030
+ name: "SetOracleParameter",
90031
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleParameter",
90032
+ kind: "nested"
90033
+ }
90034
+ ]
90035
+ },
90036
+ {
90037
+ type: "event",
90038
+ name: "vesu::map_list::map_list_component::Event",
90039
+ kind: "enum",
90040
+ variants: []
90041
+ },
90042
+ {
90043
+ type: "event",
90044
+ name: "vesu::extension::components::fee_model::fee_model_component::SetFeeConfig",
90045
+ kind: "struct",
90046
+ members: [
90047
+ {
90048
+ name: "pool_id",
90049
+ type: "core::felt252",
90050
+ kind: "key"
90051
+ },
90052
+ {
90053
+ name: "fee_config",
90054
+ type: "vesu::extension::components::fee_model::FeeConfig",
90055
+ kind: "key"
90056
+ }
90057
+ ]
90058
+ },
90059
+ {
90060
+ type: "event",
90061
+ name: "vesu::extension::components::fee_model::fee_model_component::ClaimFees",
90062
+ kind: "struct",
90063
+ members: [
90064
+ {
90065
+ name: "pool_id",
90066
+ type: "core::felt252",
90067
+ kind: "key"
90068
+ },
90069
+ {
90070
+ name: "collateral_asset",
90071
+ type: "core::starknet::contract_address::ContractAddress",
90072
+ kind: "data"
90073
+ },
90074
+ {
90075
+ name: "debt_asset",
90076
+ type: "core::starknet::contract_address::ContractAddress",
90077
+ kind: "data"
90078
+ },
90079
+ {
90080
+ name: "recipient",
90081
+ type: "core::starknet::contract_address::ContractAddress",
90082
+ kind: "data"
90083
+ },
90084
+ {
90085
+ name: "amount",
90086
+ type: "core::integer::u256",
90087
+ kind: "data"
90088
+ }
90089
+ ]
90090
+ },
90091
+ {
90092
+ type: "event",
90093
+ name: "vesu::extension::components::fee_model::fee_model_component::Event",
90094
+ kind: "enum",
90095
+ variants: [
90096
+ {
90097
+ name: "SetFeeConfig",
90098
+ type: "vesu::extension::components::fee_model::fee_model_component::SetFeeConfig",
90099
+ kind: "nested"
90100
+ },
90101
+ {
90102
+ name: "ClaimFees",
90103
+ type: "vesu::extension::components::fee_model::fee_model_component::ClaimFees",
90104
+ kind: "nested"
90105
+ }
90106
+ ]
90107
+ },
90108
+ {
90109
+ type: "event",
90110
+ name: "vesu::extension::components::tokenization::tokenization_component::CreateVToken",
90111
+ kind: "struct",
90112
+ members: [
90113
+ {
90114
+ name: "v_token",
90115
+ type: "core::starknet::contract_address::ContractAddress",
90116
+ kind: "key"
90117
+ },
90118
+ {
90119
+ name: "pool_id",
90120
+ type: "core::felt252",
90121
+ kind: "key"
90122
+ },
90123
+ {
90124
+ name: "collateral_asset",
90125
+ type: "core::starknet::contract_address::ContractAddress",
90126
+ kind: "key"
90127
+ }
90128
+ ]
90129
+ },
90130
+ {
90131
+ type: "event",
90132
+ name: "vesu::extension::components::tokenization::tokenization_component::Event",
90133
+ kind: "enum",
90134
+ variants: [
90135
+ {
90136
+ name: "CreateVToken",
90137
+ type: "vesu::extension::components::tokenization::tokenization_component::CreateVToken",
90138
+ kind: "nested"
90139
+ }
90140
+ ]
90141
+ },
90142
+ {
90143
+ type: "event",
90144
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetAssetParameter",
90145
+ kind: "struct",
90146
+ members: [
90147
+ {
90148
+ name: "pool_id",
90149
+ type: "core::felt252",
90150
+ kind: "key"
90151
+ },
90152
+ {
90153
+ name: "asset",
90154
+ type: "core::starknet::contract_address::ContractAddress",
90155
+ kind: "key"
90156
+ },
90157
+ {
90158
+ name: "parameter",
90159
+ type: "core::felt252",
90160
+ kind: "key"
90161
+ },
90162
+ {
90163
+ name: "value",
90164
+ type: "core::integer::u256",
90165
+ kind: "data"
90166
+ }
90167
+ ]
90168
+ },
90169
+ {
90170
+ type: "event",
90171
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetPoolOwner",
90172
+ kind: "struct",
90173
+ members: [
90174
+ {
90175
+ name: "pool_id",
90176
+ type: "core::felt252",
90177
+ kind: "key"
90178
+ },
90179
+ {
90180
+ name: "owner",
90181
+ type: "core::starknet::contract_address::ContractAddress",
90182
+ kind: "key"
90183
+ }
90184
+ ]
90185
+ },
90186
+ {
90187
+ type: "event",
90188
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::ContractUpgraded",
90189
+ kind: "struct",
90190
+ members: [
90191
+ {
90192
+ name: "new_implementation",
90193
+ type: "core::starknet::class_hash::ClassHash",
90194
+ kind: "data"
90195
+ }
90196
+ ]
90197
+ },
90198
+ {
90199
+ type: "event",
90200
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::Event",
90201
+ kind: "enum",
90202
+ variants: [
90203
+ {
90204
+ name: "PositionHooksEvents",
90205
+ type: "vesu::extension::components::position_hooks::position_hooks_component::Event",
90206
+ kind: "nested"
90207
+ },
90208
+ {
90209
+ name: "InterestRateModelEvents",
90210
+ type: "vesu::extension::components::interest_rate_model::interest_rate_model_component::Event",
90211
+ kind: "nested"
90212
+ },
90213
+ {
90214
+ name: "PragmaOracleEvents",
90215
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::Event",
90216
+ kind: "nested"
90217
+ },
90218
+ {
90219
+ name: "MapListEvents",
90220
+ type: "vesu::map_list::map_list_component::Event",
90221
+ kind: "nested"
90222
+ },
90223
+ {
90224
+ name: "FeeModelEvents",
90225
+ type: "vesu::extension::components::fee_model::fee_model_component::Event",
90226
+ kind: "nested"
90227
+ },
90228
+ {
90229
+ name: "TokenizationEvents",
90230
+ type: "vesu::extension::components::tokenization::tokenization_component::Event",
90231
+ kind: "nested"
90232
+ },
90233
+ {
90234
+ name: "SetAssetParameter",
90235
+ type: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetAssetParameter",
90236
+ kind: "nested"
90237
+ },
90238
+ {
90239
+ name: "SetPoolOwner",
90240
+ type: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetPoolOwner",
90241
+ kind: "nested"
90242
+ },
90243
+ {
90244
+ name: "CreateVToken",
90245
+ type: "vesu::extension::components::tokenization::tokenization_component::CreateVToken",
90246
+ kind: "nested"
90247
+ },
90248
+ {
90249
+ name: "SetInterestRateConfig",
90250
+ type: "vesu::extension::components::interest_rate_model::interest_rate_model_component::SetInterestRateConfig",
90251
+ kind: "nested"
90252
+ },
90253
+ {
90254
+ name: "SetOracleConfig",
90255
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleConfig",
90256
+ kind: "nested"
90257
+ },
90258
+ {
90259
+ name: "SetLiquidationConfig",
90260
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetLiquidationConfig",
90261
+ kind: "nested"
90262
+ },
90263
+ {
90264
+ name: "SetDebtCap",
90265
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetDebtCap",
90266
+ kind: "nested"
90267
+ },
90268
+ {
90269
+ name: "SetShutdownLTVConfig",
90270
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownLTVConfig",
90271
+ kind: "nested"
90272
+ },
90273
+ {
90274
+ name: "ContractUpgraded",
90275
+ type: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::ContractUpgraded",
90276
+ kind: "nested"
90277
+ }
90278
+ ]
90279
+ }
90280
+ ];
90281
+
87835
90282
  // src/strategies/universal-adapters/vesu-adapter.ts
87836
90283
  var VesuAmountType = /* @__PURE__ */ ((VesuAmountType2) => {
87837
90284
  VesuAmountType2[VesuAmountType2["Delta"] = 0] = "Delta";
@@ -87843,6 +90290,9 @@ spurious results.`);
87843
90290
  VesuAmountDenomination2[VesuAmountDenomination2["Assets"] = 1] = "Assets";
87844
90291
  return VesuAmountDenomination2;
87845
90292
  })(VesuAmountDenomination || {});
90293
+ var SCALE = BigInt(1e18);
90294
+ var UTILIZATION_SCALE = 100000n;
90295
+ var UTILIZATION_SCALE_TO_SCALE = BigInt(1e13);
87846
90296
  function getVesuMultiplyParams(isIncrease, params) {
87847
90297
  if (isIncrease) {
87848
90298
  const _params2 = params;
@@ -87948,6 +90398,8 @@ spurious results.`);
87948
90398
  Re7xSTRK: ContractAddr.from("0x052fb52363939c3aa848f8f4ac28f0a51379f8d1b971d8444de25fbd77d8f161"),
87949
90399
  Re7xBTC: ContractAddr.from("0x3a8416bf20d036df5b1cf3447630a2e1cb04685f6b0c3a70ed7fb1473548ecf")
87950
90400
  };
90401
+ var extensionMap = {};
90402
+ extensionMap[VesuPools.Re7xSTRK.address] = ContractAddr.from("0x04e06e04b8d624d039aa1c3ca8e0aa9e21dc1ccba1d88d0d650837159e0ee054");
87951
90403
  function getVesuSingletonAddress(vesuPool) {
87952
90404
  if (vesuPool.eq(VesuPools.Genesis) || vesuPool.eq(VesuPools.Re7xSTRK)) {
87953
90405
  return { addr: VESU_SINGLETON, isV2: false };
@@ -88211,6 +90663,61 @@ spurious results.`);
88211
90663
  isV2
88212
90664
  };
88213
90665
  }
90666
+ async getDebtCap(config3) {
90667
+ const { contract, isV2 } = await this.getVesuSingletonContract(config3, this.config.poolId);
90668
+ if (!isV2) {
90669
+ const extensionAddr = extensionMap[this.config.poolId.address];
90670
+ if (!extensionAddr) {
90671
+ throw new Error("Extension address not found");
90672
+ }
90673
+ const extensionContract = new Contract({ abi: vesu_extension_abi_default, address: extensionAddr.address, providerOrAccount: config3.provider });
90674
+ const output2 = await extensionContract.call("debt_caps", [this.config.poolId.address, this.config.collateral.address.address, this.config.debt.address.address]);
90675
+ logger2.verbose(`${this.config.debt.symbol}::VesuAdapter::getDebtCap debt_cap: ${output2.toString()}`);
90676
+ return Web3Number.fromWei(output2.toString(), this.config.debt.decimals);
90677
+ }
90678
+ const output = await contract.call("pair_config", [this.config.collateral.address.address, this.config.debt.address.address]);
90679
+ logger2.verbose(`${this.config.debt.symbol}::VesuAdapter::getDebtCap debt_cap: ${output.debt_cap.toString()}`);
90680
+ return Web3Number.fromWei(output.debt_cap.toString(), this.config.debt.decimals);
90681
+ }
90682
+ async getMaxBorrowableByInterestRate(config3, asset, maxBorrowAPY) {
90683
+ const { contract, isV2 } = await this.getVesuSingletonContract(config3, this.config.poolId);
90684
+ let interestRateConfigContract = contract;
90685
+ if (!isV2) {
90686
+ const extensionAddr = extensionMap[this.config.poolId.address];
90687
+ if (!extensionAddr) {
90688
+ throw new Error("Extension address not found");
90689
+ }
90690
+ interestRateConfigContract = new Contract({ abi: vesu_extension_abi_default, address: extensionAddr.address, providerOrAccount: config3.provider });
90691
+ }
90692
+ const _interestRateConfig = await interestRateConfigContract.call(
90693
+ "interest_rate_config",
90694
+ isV2 ? [this.config.debt.address.address] : [this.config.poolId.address, this.config.debt.address.address]
90695
+ );
90696
+ const interestRateConfig = {
90697
+ target_utilization: _interestRateConfig.target_utilization,
90698
+ zero_utilization_rate: _interestRateConfig.zero_utilization_rate,
90699
+ target_rate_percent: _interestRateConfig.target_rate_percent,
90700
+ min_target_utilization: _interestRateConfig.min_target_utilization,
90701
+ max_target_utilization: _interestRateConfig.max_target_utilization,
90702
+ rate_half_life: _interestRateConfig.rate_half_life,
90703
+ min_full_utilization_rate: _interestRateConfig.min_full_utilization_rate,
90704
+ max_full_utilization_rate: _interestRateConfig.max_full_utilization_rate
90705
+ };
90706
+ const _assetConfig = await contract.call(
90707
+ isV2 ? "asset_config" : "asset_config_unsafe",
90708
+ isV2 ? [asset.address.address] : [this.config.poolId.address, asset.address.address]
90709
+ );
90710
+ const assetConfig = isV2 ? _assetConfig : _assetConfig["0"];
90711
+ const timeDelta = assetConfig.last_updated;
90712
+ const lastFullUtilizationRate = assetConfig.last_full_utilization_rate;
90713
+ const totalSupply = new Web3Number((Number(assetConfig.total_nominal_debt) / 1e18).toFixed(9), asset.decimals).plus(Web3Number.fromWei(assetConfig.reserve, asset.decimals));
90714
+ const ratePerSecond = BigInt(Math.round(maxBorrowAPY / 365 / 24 / 60 / 60 * Number(SCALE)));
90715
+ const maxUtilisation = this.getMaxUtilizationGivenRatePerSecond(interestRateConfig, ratePerSecond, timeDelta, lastFullUtilizationRate);
90716
+ logger2.verbose(`${asset.symbol}::VesuAdapter::getMaxBorrowableByInterestRate maxUtilisation: ${Number(maxUtilisation) / 1e18}, totalSupply: ${totalSupply.toString()}`);
90717
+ const maxDebtToHave = totalSupply.multipliedBy(Number(maxUtilisation) / 1e18);
90718
+ const currentDebt = new Web3Number((Number(assetConfig.total_nominal_debt) / 1e18).toFixed(9), asset.decimals);
90719
+ return maxDebtToHave.minus(currentDebt);
90720
+ }
88214
90721
  async getLTVConfig(config3) {
88215
90722
  const CACHE_KEY = "ltv_config";
88216
90723
  const cacheData = this.getCache(CACHE_KEY);
@@ -88226,6 +90733,9 @@ spurious results.`);
88226
90733
  const output = await contract.call("ltv_config", [this.config.poolId.address, this.config.collateral.address.address, this.config.debt.address.address]);
88227
90734
  ltv = Number(output.max_ltv) / 1e18;
88228
90735
  }
90736
+ if (ltv == 0) {
90737
+ throw new Error("LTV is 0");
90738
+ }
88229
90739
  this.setCache(CACHE_KEY, ltv, 3e5);
88230
90740
  return this.getCache(CACHE_KEY);
88231
90741
  }
@@ -88360,6 +90870,78 @@ spurious results.`);
88360
90870
  Global.setGlobalCache(CACHE_KEY, { pools, isErrorPoolsAPI }, 3e5);
88361
90871
  return { pools, isErrorPoolsAPI };
88362
90872
  }
90873
+ fullUtilizationRate(interestRateConfig, timeDelta, utilization, fullUtilizationRate) {
90874
+ const {
90875
+ min_target_utilization,
90876
+ max_target_utilization,
90877
+ rate_half_life,
90878
+ min_full_utilization_rate,
90879
+ max_full_utilization_rate
90880
+ } = interestRateConfig;
90881
+ const halfLifeScaled = rate_half_life * SCALE;
90882
+ let nextFullUtilizationRate;
90883
+ if (utilization < min_target_utilization) {
90884
+ const utilizationDelta = (min_target_utilization - utilization) * SCALE / min_target_utilization;
90885
+ const decay = halfLifeScaled + utilizationDelta * timeDelta;
90886
+ nextFullUtilizationRate = fullUtilizationRate * halfLifeScaled / decay;
90887
+ } else if (utilization > max_target_utilization) {
90888
+ const utilizationDelta = (utilization - max_target_utilization) * SCALE / (UTILIZATION_SCALE - max_target_utilization);
90889
+ const growth = halfLifeScaled + utilizationDelta * timeDelta;
90890
+ nextFullUtilizationRate = fullUtilizationRate * growth / halfLifeScaled;
90891
+ } else {
90892
+ nextFullUtilizationRate = fullUtilizationRate;
90893
+ }
90894
+ if (nextFullUtilizationRate > max_full_utilization_rate) {
90895
+ return max_full_utilization_rate;
90896
+ } else if (nextFullUtilizationRate < min_full_utilization_rate) {
90897
+ return min_full_utilization_rate;
90898
+ } else {
90899
+ return nextFullUtilizationRate;
90900
+ }
90901
+ }
90902
+ /**
90903
+ * Calculates new interest rate per second and next full utilization rate.
90904
+ */
90905
+ calculateInterestRate(interestRateConfig, utilization, timeDelta, lastFullUtilizationRate) {
90906
+ const scaledUtilization = utilization / UTILIZATION_SCALE_TO_SCALE;
90907
+ const {
90908
+ target_utilization,
90909
+ zero_utilization_rate,
90910
+ target_rate_percent
90911
+ } = interestRateConfig;
90912
+ const nextFullUtilizationRate = this.fullUtilizationRate(
90913
+ interestRateConfig,
90914
+ timeDelta,
90915
+ scaledUtilization,
90916
+ lastFullUtilizationRate
90917
+ );
90918
+ const targetRate = (nextFullUtilizationRate - zero_utilization_rate) * target_rate_percent / SCALE + zero_utilization_rate;
90919
+ let newRatePerSecond;
90920
+ if (scaledUtilization < target_utilization) {
90921
+ newRatePerSecond = zero_utilization_rate + scaledUtilization * (targetRate - zero_utilization_rate) / target_utilization;
90922
+ } else {
90923
+ newRatePerSecond = targetRate + (scaledUtilization - target_utilization) * (nextFullUtilizationRate - targetRate) / (UTILIZATION_SCALE - target_utilization);
90924
+ }
90925
+ return { newRatePerSecond, nextFullUtilizationRate };
90926
+ }
90927
+ /**
90928
+ * Calculates utilization given a specific rate per second.
90929
+ * This is an inverse function of the piecewise interest rate formula above.
90930
+ */
90931
+ getMaxUtilizationGivenRatePerSecond(interestRateConfig, ratePerSecond, timeDelta, last_full_utilization_rate) {
90932
+ logger2.verbose(`VesuAdapter::getMaxUtilizationGivenRatePerSecond ratePerSecond: ${Number(ratePerSecond) / 1e18}, timeDelta: ${Number(timeDelta) / 1e18}, last_full_utilization_rate: ${Number(last_full_utilization_rate) / 1e18}`);
90933
+ let utilization = 0n;
90934
+ let nextUtilization = SCALE / 100n;
90935
+ while (utilization <= SCALE) {
90936
+ logger2.verbose(`VesuAdapter::getMaxUtilizationGivenRatePerSecond utilization: ${Number(utilization) / 1e18}, nextUtilization: ${Number(nextUtilization) / 1e18}`);
90937
+ const { newRatePerSecond } = this.calculateInterestRate(interestRateConfig, utilization, timeDelta, last_full_utilization_rate);
90938
+ if (newRatePerSecond > ratePerSecond) {
90939
+ return utilization;
90940
+ }
90941
+ utilization += nextUtilization;
90942
+ }
90943
+ throw new Error("Max utilization not found");
90944
+ }
88363
90945
  };
88364
90946
 
88365
90947
  // src/data/universal-vault.abi.json
@@ -90693,21 +93275,7 @@ spurious results.`);
90693
93275
  usdValue
90694
93276
  };
90695
93277
  }
90696
- /**
90697
- * Calculates the weighted average APY across all pools based on USD value.
90698
- * @returns {Promise<number>} The weighted average APY across all pools
90699
- */
90700
- async netAPY() {
90701
- if (this.metadata.isPreview) {
90702
- return { net: 0, splits: [{
90703
- apy: 0,
90704
- id: "base"
90705
- }, {
90706
- apy: 0,
90707
- id: "defispring"
90708
- }] };
90709
- }
90710
- const prevAUM = await this.getPrevAUM();
93278
+ async getVesuAPYs() {
90711
93279
  const vesuAdapters = this.getVesuAdapters();
90712
93280
  const allVesuPools = await VesuAdapter.getVesuPools();
90713
93281
  const pools = vesuAdapters.map((vesuAdapter) => {
@@ -90735,7 +93303,18 @@ spurious results.`);
90735
93303
  logger2.verbose(`${this.metadata.name}::netAPY: baseAPYs: ${JSON.stringify(baseAPYs)}`);
90736
93304
  logger2.verbose(`${this.metadata.name}::netAPY: rewardAPYs: ${JSON.stringify(rewardAPYs)}`);
90737
93305
  assert3(baseAPYs.length == positions.length, "APYs and positions length mismatch");
90738
- if (positions.every((p) => p.amount.isZero())) {
93306
+ return {
93307
+ baseAPYs,
93308
+ rewardAPYs,
93309
+ positions
93310
+ };
93311
+ }
93312
+ /**
93313
+ * Calculates the weighted average APY across all pools based on USD value.
93314
+ * @returns {Promise<number>} The weighted average APY across all pools
93315
+ */
93316
+ async netAPY() {
93317
+ if (this.metadata.isPreview) {
90739
93318
  return { net: 0, splits: [{
90740
93319
  apy: 0,
90741
93320
  id: "base"
@@ -90744,11 +93323,25 @@ spurious results.`);
90744
93323
  id: "defispring"
90745
93324
  }] };
90746
93325
  }
93326
+ const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
90747
93327
  const unusedBalanceAPY = await this.getUnusedBalanceAPY();
90748
93328
  baseAPYs.push(...[unusedBalanceAPY.apy]);
90749
93329
  rewardAPYs.push(0);
90750
93330
  const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
90751
93331
  weights.push(unusedBalanceAPY.weight);
93332
+ return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
93333
+ }
93334
+ async returnNetAPY(baseAPYs, rewardAPYs, weights) {
93335
+ if (weights.every((p) => p == 0)) {
93336
+ return { net: 0, splits: [{
93337
+ apy: 0,
93338
+ id: "base"
93339
+ }, {
93340
+ apy: 0,
93341
+ id: "defispring"
93342
+ }] };
93343
+ }
93344
+ const prevAUM = await this.getPrevAUM();
90752
93345
  const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
90753
93346
  const prevAUMUSD = prevAUM.multipliedBy(price.price);
90754
93347
  const baseAPY = this.computeAPY(baseAPYs, weights, prevAUMUSD);
@@ -91585,13 +94178,31 @@ spurious results.`);
91585
94178
  getTag() {
91586
94179
  return `${_UniversalLstMultiplierStrategy.name}:${this.metadata.name}`;
91587
94180
  }
94181
+ // Vesu adapter with LST and base token match
94182
+ getVesuSameTokenAdapter() {
94183
+ const baseAdapter = this.getAdapter("vesu_leg1_adapter" /* VESU_LEG1 */);
94184
+ baseAdapter.networkConfig = this.config;
94185
+ baseAdapter.pricer = this.pricer;
94186
+ return baseAdapter;
94187
+ }
91588
94188
  // only one leg is used
91589
94189
  // todo support lending assets of underlying as well (like if xSTRK looping is not viable, simply supply STRK)
91590
94190
  getVesuAdapters() {
91591
- const vesuAdapter1 = this.getAdapter("vesu_leg1_adapter" /* VESU_LEG1 */);
91592
- vesuAdapter1.pricer = this.pricer;
91593
- vesuAdapter1.networkConfig = this.config;
91594
- return [vesuAdapter1];
94191
+ const adapters = [];
94192
+ const baseAdapter = this.getVesuSameTokenAdapter();
94193
+ for (const asset of this.metadata.additionalInfo.borrowable_assets) {
94194
+ const vesuAdapter1 = new VesuAdapter({
94195
+ poolId: baseAdapter.config.poolId,
94196
+ collateral: this.asset(),
94197
+ debt: asset,
94198
+ vaultAllocator: this.metadata.additionalInfo.vaultAllocator,
94199
+ id: ""
94200
+ });
94201
+ vesuAdapter1.pricer = this.pricer;
94202
+ vesuAdapter1.networkConfig = this.config;
94203
+ adapters.push(vesuAdapter1);
94204
+ }
94205
+ return adapters;
91595
94206
  }
91596
94207
  // not applicable for this strategy
91597
94208
  // No rewards on collateral or borrowing of LST assets
@@ -91619,7 +94230,8 @@ spurious results.`);
91619
94230
  async getAvnuSwapMultiplyCall(params) {
91620
94231
  return this._getAvnuDepositSwapLegCall({
91621
94232
  ...params,
91622
- minHF: 1.02
94233
+ minHF: 1.1
94234
+ // undo
91623
94235
  });
91624
94236
  }
91625
94237
  async _getAvnuDepositSwapLegCall(params) {
@@ -91642,6 +94254,7 @@ spurious results.`);
91642
94254
  const totalDebtAmount = totalCollateral.multipliedBy(collateralPrice).multipliedBy(legLTV).dividedBy(debtPrice).dividedBy(params.minHF);
91643
94255
  logger2.verbose(`${this.getTag()}::_getAvnuDepositSwapLegCall totalDebtAmount: ${totalDebtAmount}`);
91644
94256
  const debtAmount = totalDebtAmount.minus(existingDebtInfo.amount);
94257
+ logger2.verbose(`${this.getTag()}::_getAvnuDepositSwapLegCall debtAmount: ${debtAmount}`);
91645
94258
  if (debtAmount.lt(0)) {
91646
94259
  const lstDEXPrice = await this.getLSTDexPrice();
91647
94260
  const debtAmountInLST = debtAmount.abs().dividedBy(lstDEXPrice);
@@ -91649,10 +94262,9 @@ spurious results.`);
91649
94262
  isDeposit: false,
91650
94263
  leg1DepositAmount: debtAmountInLST
91651
94264
  });
91652
- assert3(calls.length == 1, "Expected 1 call for unwind");
94265
+ assert3(calls.length == 1, `Expected 1 call for unwind, got ${calls.length}`);
91653
94266
  return calls[0];
91654
94267
  }
91655
- logger2.verbose(`${this.getTag()}::_getAvnuDepositSwapLegCall debtAmount: ${debtAmount}`);
91656
94268
  const STEP0 = "approve_token1" /* APPROVE_TOKEN1 */;
91657
94269
  const manage0Info = this.getProofs(STEP0);
91658
94270
  const manageCall0 = manage0Info.callConstructor({
@@ -91757,10 +94369,32 @@ spurious results.`);
91757
94369
  return { shouldRebalance: false, manageCall: void 0 };
91758
94370
  }
91759
94371
  }
94372
+ async getVesuAUM(adapter) {
94373
+ const legAUM = await adapter.getPositions(this.config);
94374
+ const underlying = this.asset();
94375
+ assert3(underlying.symbol.startsWith("x"), "Underlying is not an LST of Endur");
94376
+ let vesuAum = Web3Number.fromWei("0", underlying.decimals);
94377
+ let tokenUnderlyingPrice = await this.getLSTExchangeRate();
94378
+ tokenUnderlyingPrice = tokenUnderlyingPrice * 0.998;
94379
+ logger2.verbose(`${this.getTag()} tokenUnderlyingPrice: ${tokenUnderlyingPrice}`);
94380
+ if (legAUM[0].token.address.eq(underlying.address)) {
94381
+ vesuAum = vesuAum.plus(legAUM[0].amount);
94382
+ } else {
94383
+ vesuAum = vesuAum.plus(legAUM[0].amount.dividedBy(tokenUnderlyingPrice));
94384
+ }
94385
+ if (legAUM[1].token.address.eq(underlying.address)) {
94386
+ vesuAum = vesuAum.minus(legAUM[1].amount);
94387
+ } else {
94388
+ vesuAum = vesuAum.minus(legAUM[1].amount.dividedBy(tokenUnderlyingPrice));
94389
+ }
94390
+ ;
94391
+ logger2.verbose(`${this.getTag()} Vesu AUM: ${vesuAum}, legCollateral: ${legAUM[0].amount.toNumber()}, legDebt: ${legAUM[1].amount.toNumber()}`);
94392
+ return vesuAum;
94393
+ }
91760
94394
  //
91761
94395
  async _getMinOutputAmountLSTBuy(amountInUnderlying) {
91762
94396
  const lstTruePrice = await this.getLSTExchangeRate();
91763
- const minOutputAmount = amountInUnderlying.dividedBy(lstTruePrice);
94397
+ const minOutputAmount = amountInUnderlying.dividedBy(lstTruePrice).multipliedBy(0.99979);
91764
94398
  return minOutputAmount;
91765
94399
  }
91766
94400
  async _getMinOutputAmountLSTSell(amountInLST) {
@@ -91779,6 +94413,10 @@ spurious results.`);
91779
94413
  const [vesuAdapter1] = this.getVesuAdapters();
91780
94414
  const legLTV = await vesuAdapter1.getLTVConfig(this.config);
91781
94415
  logger2.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
94416
+ if (!params.isDeposit) {
94417
+ const unusedBalance = await this.getUnusedBalance();
94418
+ logger2.verbose(`${this.getTag()}::getVesuMultiplyCall unusedBalance: ${unusedBalance.amount.toString()}, required: ${params.leg1DepositAmount.toString()}`);
94419
+ }
91782
94420
  const existingPositions = await vesuAdapter1.getPositions(this.config);
91783
94421
  const collateralisation = await vesuAdapter1.getCollateralization(this.config);
91784
94422
  const existingCollateralInfo = existingPositions[0];
@@ -91811,16 +94449,34 @@ spurious results.`);
91811
94449
  });
91812
94450
  }
91813
94451
  getLSTUnderlyingTokenInfo() {
91814
- const [vesuAdapter1] = this.getVesuAdapters();
94452
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
91815
94453
  return vesuAdapter1.config.debt;
91816
94454
  }
94455
+ async getMaxBorrowableAmount() {
94456
+ const vesuAdapters = this.getVesuAdapters();
94457
+ let netMaxBorrowableAmount = Web3Number.fromWei("0", this.getLSTUnderlyingTokenInfo().decimals);
94458
+ const maxBorrowables = [];
94459
+ const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
94460
+ const maxInterestRate = lstAPY * 0.8;
94461
+ for (const vesuAdapter of vesuAdapters) {
94462
+ const maxBorrowableAmount = await vesuAdapter.getMaxBorrowableByInterestRate(this.config, vesuAdapter.config.debt, maxInterestRate);
94463
+ const debtCap = await vesuAdapter.getDebtCap(this.config);
94464
+ maxBorrowables.push({ amount: maxBorrowableAmount.minimum(debtCap), borrowableAsset: vesuAdapter.config.debt });
94465
+ }
94466
+ maxBorrowables.sort((a, b) => b.amount.toNumber() - a.amount.toNumber());
94467
+ netMaxBorrowableAmount = maxBorrowables.reduce((acc, curr) => acc.plus(curr.amount), Web3Number.fromWei("0", this.getLSTUnderlyingTokenInfo().decimals));
94468
+ return { netMaxBorrowableAmount, maxBorrowables };
94469
+ }
94470
+ // todo how much to unwind to get back healthy APY zone again
94471
+ // if net APY < LST APR + 0.5%, we need to unwind to get back to LST APR + 1% atleast or 0 vesu position
94472
+ // For xSTRK, simply deposit in Vesu if looping is not viable
91817
94473
  /**
91818
94474
  * Gets LST APR for the strategy's underlying asset from Endur API
91819
94475
  * @returns Promise<number> The LST APR (not divided by 1e18)
91820
94476
  */
91821
94477
  async getLSTAPR(_address) {
91822
94478
  try {
91823
- const vesuAdapter1 = this.getVesuAdapters()[0];
94479
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
91824
94480
  const apr = await LSTAPRService.getLSTAPR(vesuAdapter1.config.debt.address);
91825
94481
  if (!apr) {
91826
94482
  throw new Error("Failed to get LST APR");
@@ -91833,21 +94489,41 @@ spurious results.`);
91833
94489
  }
91834
94490
  // todo undo this
91835
94491
  async netAPY() {
91836
- const { net, splits } = await super.netAPY();
91837
- let _net = net;
91838
- if (this.asset().symbol == "xWBTC") {
91839
- const debtToken = this.getVesuAdapters()[0].config.debt;
91840
- const lstAPY = await this.getLSTAPR(debtToken.address);
91841
- _net = lstAPY * 5;
94492
+ const unusedBalance = await this.getUnusedBalance();
94493
+ const maxNewDeposits = await this.maxNewDeposits();
94494
+ if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
94495
+ return super.netAPY();
94496
+ } else {
94497
+ const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
94498
+ const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
94499
+ return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
91842
94500
  }
91843
- return {
91844
- net: _net,
91845
- splits
91846
- };
91847
94501
  }
94502
+ async maxNewDeposits() {
94503
+ const maxBorrowableAmounts = await this.getMaxBorrowableAmount();
94504
+ let ltv = void 0;
94505
+ for (let adapter of this.getVesuAdapters()) {
94506
+ const maxBorrowableAmount = maxBorrowableAmounts.maxBorrowables.find((b) => b.borrowableAsset.address.eq(adapter.config.debt.address))?.amount;
94507
+ if (!maxBorrowableAmount) {
94508
+ throw new Error(`Max borrowable amount not found for adapter: ${adapter.config.debt.symbol}`);
94509
+ }
94510
+ const maxLTV = await adapter.getLTVConfig(this.config);
94511
+ if (!ltv) {
94512
+ ltv = maxLTV;
94513
+ } else if (ltv != maxLTV) {
94514
+ throw new Error(`LTV mismatch for adapter: ${adapter.config.debt.symbol}`);
94515
+ }
94516
+ }
94517
+ if (!ltv) {
94518
+ throw new Error("LTV not found");
94519
+ }
94520
+ const numerator = this.metadata.additionalInfo.targetHealthFactor * maxBorrowableAmounts.netMaxBorrowableAmount.toNumber() / ltv;
94521
+ return numerator - maxBorrowableAmounts.netMaxBorrowableAmount.toNumber();
94522
+ }
94523
+ // todo revisit cases where 0th adapters is used
91848
94524
  async getUnusedBalanceAPY() {
91849
94525
  const unusedBalance = await this.getUnusedBalance();
91850
- const vesuAdapter = this.getVesuAdapters()[0];
94526
+ const vesuAdapter = this.getVesuSameTokenAdapter();
91851
94527
  const underlying = vesuAdapter.config.debt;
91852
94528
  const lstAPY = await this.getLSTAPR(underlying.address);
91853
94529
  return {
@@ -91856,7 +94532,7 @@ spurious results.`);
91856
94532
  };
91857
94533
  }
91858
94534
  async getLSTExchangeRate() {
91859
- const [vesuAdapter1] = this.getVesuAdapters();
94535
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
91860
94536
  const lstTokenInfo = vesuAdapter1.config.collateral;
91861
94537
  const lstABI = new Contract({
91862
94538
  abi: erc4626_abi_default,
@@ -91875,7 +94551,7 @@ spurious results.`);
91875
94551
  async getModifyLeverCall(params) {
91876
94552
  logger2.verbose(`${this.getTag()}::getModifyLeverCall marginAmount: ${params.marginAmount}, debtAmount: ${params.debtAmount}, lstDexPriceInUnderlying: ${params.lstDexPriceInUnderlying}, isIncrease: ${params.isIncrease}`);
91877
94553
  assert3(!params.marginAmount.isZero() || !params.debtAmount.isZero(), "Deposit/debt must be non-0");
91878
- const [vesuAdapter1] = this.getVesuAdapters();
94554
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
91879
94555
  const lstTokenInfo = this.asset();
91880
94556
  const lstUnderlyingTokenInfo = vesuAdapter1.config.debt;
91881
94557
  const maxAmounts = lstTokenInfo.symbol == "xSTRK" ? 5e5 : 0.5;
@@ -92112,6 +94788,12 @@ spurious results.`);
92112
94788
  { type: "Technical Risk" /* TECHNICAL_RISK */, value: 1 /* STABLE_INFRASTRUCTURE */, weight: 25, reason: "Liquidation can only happen if vault is left un-monitored for weeks, which is highly unlikely. We actively monitor all services on a daily basis." },
92113
94789
  { type: "Depeg Risk" /* DEPEG_RISK */, value: 2 /* GENERALLY_STABLE */, weight: 25, reason: "Generally stable pegged assets" }
92114
94790
  ];
94791
+ var borrowableAssets = [
94792
+ "WBTC",
94793
+ "tBTC",
94794
+ "LBTC",
94795
+ "solvBTC"
94796
+ ];
92115
94797
  var hyperxSTRK = {
92116
94798
  vaultAddress: ContractAddr.from("0x46c7a54c82b1fe374353859f554a40b8bd31d3e30f742901579e7b57b1b5960"),
92117
94799
  manager: ContractAddr.from("0x5d499cd333757f461a0bedaca3dfc4d77320c773037e0aa299f22a6dbfdc03a"),
@@ -92121,7 +94803,8 @@ spurious results.`);
92121
94803
  leafAdapters: [],
92122
94804
  adapters: [],
92123
94805
  targetHealthFactor: 1.1,
92124
- minHealthFactor: 1.05
94806
+ minHealthFactor: 1.05,
94807
+ borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "STRK")
92125
94808
  };
92126
94809
  var hyperxWBTC = {
92127
94810
  vaultAddress: ContractAddr.from("0x2da9d0f96a46b453f55604313785dc866424240b1c6811d13bef594343db818"),
@@ -92132,7 +94815,8 @@ spurious results.`);
92132
94815
  leafAdapters: [],
92133
94816
  adapters: [],
92134
94817
  targetHealthFactor: 1.1,
92135
- minHealthFactor: 1.05
94818
+ minHealthFactor: 1.05,
94819
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
92136
94820
  };
92137
94821
  var hyperxtBTC = {
92138
94822
  vaultAddress: ContractAddr.from("0x47d5f68477e5637ce0e56436c6b5eee5a354e6828995dae106b11a48679328"),
@@ -92143,7 +94827,8 @@ spurious results.`);
92143
94827
  leafAdapters: [],
92144
94828
  adapters: [],
92145
94829
  targetHealthFactor: 1.1,
92146
- minHealthFactor: 1.05
94830
+ minHealthFactor: 1.05,
94831
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
92147
94832
  };
92148
94833
  var hyperxsBTC = {
92149
94834
  vaultAddress: ContractAddr.from("0x437ef1e7d0f100b2e070b7a65cafec0b2be31b0290776da8b4112f5473d8d9"),
@@ -92154,7 +94839,8 @@ spurious results.`);
92154
94839
  leafAdapters: [],
92155
94840
  adapters: [],
92156
94841
  targetHealthFactor: 1.1,
92157
- minHealthFactor: 1.05
94842
+ minHealthFactor: 1.05,
94843
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
92158
94844
  };
92159
94845
  var hyperxLBTC = {
92160
94846
  vaultAddress: ContractAddr.from("0x64cf24d4883fe569926419a0569ab34497c6956a1a308fa883257f7486d7030"),
@@ -92165,7 +94851,8 @@ spurious results.`);
92165
94851
  leafAdapters: [],
92166
94852
  adapters: [],
92167
94853
  targetHealthFactor: 1.1,
92168
- minHealthFactor: 1.05
94854
+ minHealthFactor: 1.05,
94855
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
92169
94856
  };
92170
94857
  function getInvestmentSteps(lstSymbol, underlyingSymbol) {
92171
94858
  return [
@@ -92196,7 +94883,8 @@ spurious results.`);
92196
94883
  contractDetails: getContractDetails(addresses),
92197
94884
  faqs: getFAQs2(lstSymbol, underlyingSymbol),
92198
94885
  investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
92199
- isPreview
94886
+ isPreview,
94887
+ apyMethodology: "Current annualized APY in terms of base asset of the LST"
92200
94888
  };
92201
94889
  }
92202
94890
  var HyperLSTStrategies = [