@strkfarm/sdk 1.1.34 → 1.1.36

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