@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.
package/dist/index.mjs CHANGED
@@ -23821,6 +23821,2451 @@ var vesu_pool_v2_abi_default = [
23821
23821
  }
23822
23822
  ];
23823
23823
 
23824
+ // src/data/vesu-extension.abi.json
23825
+ var vesu_extension_abi_default = [
23826
+ {
23827
+ type: "impl",
23828
+ name: "DefaultExtensionPOV2Impl",
23829
+ interface_name: "vesu::v2::default_extension_po_v2::IDefaultExtensionPOV2"
23830
+ },
23831
+ {
23832
+ type: "enum",
23833
+ name: "vesu::vendor::pragma::AggregationMode",
23834
+ variants: [
23835
+ {
23836
+ name: "Median",
23837
+ type: "()"
23838
+ },
23839
+ {
23840
+ name: "Mean",
23841
+ type: "()"
23842
+ },
23843
+ {
23844
+ name: "Error",
23845
+ type: "()"
23846
+ }
23847
+ ]
23848
+ },
23849
+ {
23850
+ type: "struct",
23851
+ name: "vesu::extension::components::pragma_oracle::OracleConfig",
23852
+ members: [
23853
+ {
23854
+ name: "pragma_key",
23855
+ type: "core::felt252"
23856
+ },
23857
+ {
23858
+ name: "timeout",
23859
+ type: "core::integer::u64"
23860
+ },
23861
+ {
23862
+ name: "number_of_sources",
23863
+ type: "core::integer::u32"
23864
+ },
23865
+ {
23866
+ name: "start_time_offset",
23867
+ type: "core::integer::u64"
23868
+ },
23869
+ {
23870
+ name: "time_window",
23871
+ type: "core::integer::u64"
23872
+ },
23873
+ {
23874
+ name: "aggregation_mode",
23875
+ type: "vesu::vendor::pragma::AggregationMode"
23876
+ }
23877
+ ]
23878
+ },
23879
+ {
23880
+ type: "struct",
23881
+ name: "vesu::extension::components::fee_model::FeeConfig",
23882
+ members: [
23883
+ {
23884
+ name: "fee_recipient",
23885
+ type: "core::starknet::contract_address::ContractAddress"
23886
+ }
23887
+ ]
23888
+ },
23889
+ {
23890
+ type: "struct",
23891
+ name: "core::integer::u256",
23892
+ members: [
23893
+ {
23894
+ name: "low",
23895
+ type: "core::integer::u128"
23896
+ },
23897
+ {
23898
+ name: "high",
23899
+ type: "core::integer::u128"
23900
+ }
23901
+ ]
23902
+ },
23903
+ {
23904
+ type: "struct",
23905
+ name: "vesu::extension::components::interest_rate_model::InterestRateConfig",
23906
+ members: [
23907
+ {
23908
+ name: "min_target_utilization",
23909
+ type: "core::integer::u256"
23910
+ },
23911
+ {
23912
+ name: "max_target_utilization",
23913
+ type: "core::integer::u256"
23914
+ },
23915
+ {
23916
+ name: "target_utilization",
23917
+ type: "core::integer::u256"
23918
+ },
23919
+ {
23920
+ name: "min_full_utilization_rate",
23921
+ type: "core::integer::u256"
23922
+ },
23923
+ {
23924
+ name: "max_full_utilization_rate",
23925
+ type: "core::integer::u256"
23926
+ },
23927
+ {
23928
+ name: "zero_utilization_rate",
23929
+ type: "core::integer::u256"
23930
+ },
23931
+ {
23932
+ name: "rate_half_life",
23933
+ type: "core::integer::u256"
23934
+ },
23935
+ {
23936
+ name: "target_rate_percent",
23937
+ type: "core::integer::u256"
23938
+ }
23939
+ ]
23940
+ },
23941
+ {
23942
+ type: "struct",
23943
+ name: "vesu::extension::components::position_hooks::LiquidationConfig",
23944
+ members: [
23945
+ {
23946
+ name: "liquidation_factor",
23947
+ type: "core::integer::u64"
23948
+ }
23949
+ ]
23950
+ },
23951
+ {
23952
+ type: "struct",
23953
+ name: "vesu::extension::components::position_hooks::ShutdownConfig",
23954
+ members: [
23955
+ {
23956
+ name: "recovery_period",
23957
+ type: "core::integer::u64"
23958
+ },
23959
+ {
23960
+ name: "subscription_period",
23961
+ type: "core::integer::u64"
23962
+ }
23963
+ ]
23964
+ },
23965
+ {
23966
+ type: "struct",
23967
+ name: "vesu::data_model::LTVConfig",
23968
+ members: [
23969
+ {
23970
+ name: "max_ltv",
23971
+ type: "core::integer::u64"
23972
+ }
23973
+ ]
23974
+ },
23975
+ {
23976
+ type: "enum",
23977
+ name: "vesu::extension::components::position_hooks::ShutdownMode",
23978
+ variants: [
23979
+ {
23980
+ name: "None",
23981
+ type: "()"
23982
+ },
23983
+ {
23984
+ name: "Recovery",
23985
+ type: "()"
23986
+ },
23987
+ {
23988
+ name: "Subscription",
23989
+ type: "()"
23990
+ },
23991
+ {
23992
+ name: "Redemption",
23993
+ type: "()"
23994
+ }
23995
+ ]
23996
+ },
23997
+ {
23998
+ type: "enum",
23999
+ name: "core::bool",
24000
+ variants: [
24001
+ {
24002
+ name: "False",
24003
+ type: "()"
24004
+ },
24005
+ {
24006
+ name: "True",
24007
+ type: "()"
24008
+ }
24009
+ ]
24010
+ },
24011
+ {
24012
+ type: "struct",
24013
+ name: "vesu::extension::components::position_hooks::ShutdownStatus",
24014
+ members: [
24015
+ {
24016
+ name: "shutdown_mode",
24017
+ type: "vesu::extension::components::position_hooks::ShutdownMode"
24018
+ },
24019
+ {
24020
+ name: "violating",
24021
+ type: "core::bool"
24022
+ },
24023
+ {
24024
+ name: "previous_violation_timestamp",
24025
+ type: "core::integer::u64"
24026
+ },
24027
+ {
24028
+ name: "count_at_violation_timestamp",
24029
+ type: "core::integer::u128"
24030
+ }
24031
+ ]
24032
+ },
24033
+ {
24034
+ type: "struct",
24035
+ name: "vesu::extension::components::position_hooks::Pair",
24036
+ members: [
24037
+ {
24038
+ name: "total_collateral_shares",
24039
+ type: "core::integer::u256"
24040
+ },
24041
+ {
24042
+ name: "total_nominal_debt",
24043
+ type: "core::integer::u256"
24044
+ }
24045
+ ]
24046
+ },
24047
+ {
24048
+ type: "struct",
24049
+ name: "vesu::data_model::AssetParams",
24050
+ members: [
24051
+ {
24052
+ name: "asset",
24053
+ type: "core::starknet::contract_address::ContractAddress"
24054
+ },
24055
+ {
24056
+ name: "floor",
24057
+ type: "core::integer::u256"
24058
+ },
24059
+ {
24060
+ name: "initial_rate_accumulator",
24061
+ type: "core::integer::u256"
24062
+ },
24063
+ {
24064
+ name: "initial_full_utilization_rate",
24065
+ type: "core::integer::u256"
24066
+ },
24067
+ {
24068
+ name: "max_utilization",
24069
+ type: "core::integer::u256"
24070
+ },
24071
+ {
24072
+ name: "is_legacy",
24073
+ type: "core::bool"
24074
+ },
24075
+ {
24076
+ name: "fee_rate",
24077
+ type: "core::integer::u256"
24078
+ }
24079
+ ]
24080
+ },
24081
+ {
24082
+ type: "struct",
24083
+ name: "core::array::Span::<vesu::data_model::AssetParams>",
24084
+ members: [
24085
+ {
24086
+ name: "snapshot",
24087
+ type: "@core::array::Array::<vesu::data_model::AssetParams>"
24088
+ }
24089
+ ]
24090
+ },
24091
+ {
24092
+ type: "struct",
24093
+ name: "vesu::extension::default_extension_po::VTokenParams",
24094
+ members: [
24095
+ {
24096
+ name: "v_token_name",
24097
+ type: "core::felt252"
24098
+ },
24099
+ {
24100
+ name: "v_token_symbol",
24101
+ type: "core::felt252"
24102
+ }
24103
+ ]
24104
+ },
24105
+ {
24106
+ type: "struct",
24107
+ name: "core::array::Span::<vesu::extension::default_extension_po::VTokenParams>",
24108
+ members: [
24109
+ {
24110
+ name: "snapshot",
24111
+ type: "@core::array::Array::<vesu::extension::default_extension_po::VTokenParams>"
24112
+ }
24113
+ ]
24114
+ },
24115
+ {
24116
+ type: "struct",
24117
+ name: "vesu::data_model::LTVParams",
24118
+ members: [
24119
+ {
24120
+ name: "collateral_asset_index",
24121
+ type: "core::integer::u32"
24122
+ },
24123
+ {
24124
+ name: "debt_asset_index",
24125
+ type: "core::integer::u32"
24126
+ },
24127
+ {
24128
+ name: "max_ltv",
24129
+ type: "core::integer::u64"
24130
+ }
24131
+ ]
24132
+ },
24133
+ {
24134
+ type: "struct",
24135
+ name: "core::array::Span::<vesu::data_model::LTVParams>",
24136
+ members: [
24137
+ {
24138
+ name: "snapshot",
24139
+ type: "@core::array::Array::<vesu::data_model::LTVParams>"
24140
+ }
24141
+ ]
24142
+ },
24143
+ {
24144
+ type: "struct",
24145
+ name: "core::array::Span::<vesu::extension::components::interest_rate_model::InterestRateConfig>",
24146
+ members: [
24147
+ {
24148
+ name: "snapshot",
24149
+ type: "@core::array::Array::<vesu::extension::components::interest_rate_model::InterestRateConfig>"
24150
+ }
24151
+ ]
24152
+ },
24153
+ {
24154
+ type: "struct",
24155
+ name: "vesu::extension::default_extension_po::PragmaOracleParams",
24156
+ members: [
24157
+ {
24158
+ name: "pragma_key",
24159
+ type: "core::felt252"
24160
+ },
24161
+ {
24162
+ name: "timeout",
24163
+ type: "core::integer::u64"
24164
+ },
24165
+ {
24166
+ name: "number_of_sources",
24167
+ type: "core::integer::u32"
24168
+ },
24169
+ {
24170
+ name: "start_time_offset",
24171
+ type: "core::integer::u64"
24172
+ },
24173
+ {
24174
+ name: "time_window",
24175
+ type: "core::integer::u64"
24176
+ },
24177
+ {
24178
+ name: "aggregation_mode",
24179
+ type: "vesu::vendor::pragma::AggregationMode"
24180
+ }
24181
+ ]
24182
+ },
24183
+ {
24184
+ type: "struct",
24185
+ name: "core::array::Span::<vesu::extension::default_extension_po::PragmaOracleParams>",
24186
+ members: [
24187
+ {
24188
+ name: "snapshot",
24189
+ type: "@core::array::Array::<vesu::extension::default_extension_po::PragmaOracleParams>"
24190
+ }
24191
+ ]
24192
+ },
24193
+ {
24194
+ type: "struct",
24195
+ name: "vesu::extension::default_extension_po::LiquidationParams",
24196
+ members: [
24197
+ {
24198
+ name: "collateral_asset_index",
24199
+ type: "core::integer::u32"
24200
+ },
24201
+ {
24202
+ name: "debt_asset_index",
24203
+ type: "core::integer::u32"
24204
+ },
24205
+ {
24206
+ name: "liquidation_factor",
24207
+ type: "core::integer::u64"
24208
+ }
24209
+ ]
24210
+ },
24211
+ {
24212
+ type: "struct",
24213
+ name: "core::array::Span::<vesu::extension::default_extension_po::LiquidationParams>",
24214
+ members: [
24215
+ {
24216
+ name: "snapshot",
24217
+ type: "@core::array::Array::<vesu::extension::default_extension_po::LiquidationParams>"
24218
+ }
24219
+ ]
24220
+ },
24221
+ {
24222
+ type: "struct",
24223
+ name: "vesu::data_model::DebtCapParams",
24224
+ members: [
24225
+ {
24226
+ name: "collateral_asset_index",
24227
+ type: "core::integer::u32"
24228
+ },
24229
+ {
24230
+ name: "debt_asset_index",
24231
+ type: "core::integer::u32"
24232
+ },
24233
+ {
24234
+ name: "debt_cap",
24235
+ type: "core::integer::u256"
24236
+ }
24237
+ ]
24238
+ },
24239
+ {
24240
+ type: "struct",
24241
+ name: "core::array::Span::<vesu::data_model::DebtCapParams>",
24242
+ members: [
24243
+ {
24244
+ name: "snapshot",
24245
+ type: "@core::array::Array::<vesu::data_model::DebtCapParams>"
24246
+ }
24247
+ ]
24248
+ },
24249
+ {
24250
+ type: "struct",
24251
+ name: "vesu::extension::default_extension_po::ShutdownParams",
24252
+ members: [
24253
+ {
24254
+ name: "recovery_period",
24255
+ type: "core::integer::u64"
24256
+ },
24257
+ {
24258
+ name: "subscription_period",
24259
+ type: "core::integer::u64"
24260
+ },
24261
+ {
24262
+ name: "ltv_params",
24263
+ type: "core::array::Span::<vesu::data_model::LTVParams>"
24264
+ }
24265
+ ]
24266
+ },
24267
+ {
24268
+ type: "struct",
24269
+ name: "vesu::extension::default_extension_po::FeeParams",
24270
+ members: [
24271
+ {
24272
+ name: "fee_recipient",
24273
+ type: "core::starknet::contract_address::ContractAddress"
24274
+ }
24275
+ ]
24276
+ },
24277
+ {
24278
+ type: "struct",
24279
+ name: "core::array::Span::<(core::felt252, core::felt252, core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress)>",
24280
+ members: [
24281
+ {
24282
+ name: "snapshot",
24283
+ type: "@core::array::Array::<(core::felt252, core::felt252, core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress)>"
24284
+ }
24285
+ ]
24286
+ },
24287
+ {
24288
+ type: "struct",
24289
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::interest_rate_model::InterestRateConfig)>",
24290
+ members: [
24291
+ {
24292
+ name: "snapshot",
24293
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::interest_rate_model::InterestRateConfig)>"
24294
+ }
24295
+ ]
24296
+ },
24297
+ {
24298
+ type: "struct",
24299
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::pragma_oracle::OracleConfig)>",
24300
+ members: [
24301
+ {
24302
+ name: "snapshot",
24303
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::pragma_oracle::OracleConfig)>"
24304
+ }
24305
+ ]
24306
+ },
24307
+ {
24308
+ type: "struct",
24309
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::LiquidationConfig)>",
24310
+ members: [
24311
+ {
24312
+ name: "snapshot",
24313
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::LiquidationConfig)>"
24314
+ }
24315
+ ]
24316
+ },
24317
+ {
24318
+ type: "struct",
24319
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::Pair)>",
24320
+ members: [
24321
+ {
24322
+ name: "snapshot",
24323
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::Pair)>"
24324
+ }
24325
+ ]
24326
+ },
24327
+ {
24328
+ type: "struct",
24329
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, core::integer::u256)>",
24330
+ members: [
24331
+ {
24332
+ name: "snapshot",
24333
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, core::integer::u256)>"
24334
+ }
24335
+ ]
24336
+ },
24337
+ {
24338
+ type: "struct",
24339
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::data_model::LTVConfig)>",
24340
+ members: [
24341
+ {
24342
+ name: "snapshot",
24343
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::data_model::LTVConfig)>"
24344
+ }
24345
+ ]
24346
+ },
24347
+ {
24348
+ type: "interface",
24349
+ name: "vesu::v2::default_extension_po_v2::IDefaultExtensionPOV2",
24350
+ items: [
24351
+ {
24352
+ type: "function",
24353
+ name: "pool_name",
24354
+ inputs: [
24355
+ {
24356
+ name: "pool_id",
24357
+ type: "core::felt252"
24358
+ }
24359
+ ],
24360
+ outputs: [
24361
+ {
24362
+ type: "core::felt252"
24363
+ }
24364
+ ],
24365
+ state_mutability: "view"
24366
+ },
24367
+ {
24368
+ type: "function",
24369
+ name: "pool_owner",
24370
+ inputs: [
24371
+ {
24372
+ name: "pool_id",
24373
+ type: "core::felt252"
24374
+ }
24375
+ ],
24376
+ outputs: [
24377
+ {
24378
+ type: "core::starknet::contract_address::ContractAddress"
24379
+ }
24380
+ ],
24381
+ state_mutability: "view"
24382
+ },
24383
+ {
24384
+ type: "function",
24385
+ name: "shutdown_mode_agent",
24386
+ inputs: [
24387
+ {
24388
+ name: "pool_id",
24389
+ type: "core::felt252"
24390
+ }
24391
+ ],
24392
+ outputs: [
24393
+ {
24394
+ type: "core::starknet::contract_address::ContractAddress"
24395
+ }
24396
+ ],
24397
+ state_mutability: "view"
24398
+ },
24399
+ {
24400
+ type: "function",
24401
+ name: "pragma_oracle",
24402
+ inputs: [],
24403
+ outputs: [
24404
+ {
24405
+ type: "core::starknet::contract_address::ContractAddress"
24406
+ }
24407
+ ],
24408
+ state_mutability: "view"
24409
+ },
24410
+ {
24411
+ type: "function",
24412
+ name: "pragma_summary",
24413
+ inputs: [],
24414
+ outputs: [
24415
+ {
24416
+ type: "core::starknet::contract_address::ContractAddress"
24417
+ }
24418
+ ],
24419
+ state_mutability: "view"
24420
+ },
24421
+ {
24422
+ type: "function",
24423
+ name: "oracle_config",
24424
+ inputs: [
24425
+ {
24426
+ name: "pool_id",
24427
+ type: "core::felt252"
24428
+ },
24429
+ {
24430
+ name: "asset",
24431
+ type: "core::starknet::contract_address::ContractAddress"
24432
+ }
24433
+ ],
24434
+ outputs: [
24435
+ {
24436
+ type: "vesu::extension::components::pragma_oracle::OracleConfig"
24437
+ }
24438
+ ],
24439
+ state_mutability: "view"
24440
+ },
24441
+ {
24442
+ type: "function",
24443
+ name: "fee_config",
24444
+ inputs: [
24445
+ {
24446
+ name: "pool_id",
24447
+ type: "core::felt252"
24448
+ }
24449
+ ],
24450
+ outputs: [
24451
+ {
24452
+ type: "vesu::extension::components::fee_model::FeeConfig"
24453
+ }
24454
+ ],
24455
+ state_mutability: "view"
24456
+ },
24457
+ {
24458
+ type: "function",
24459
+ name: "debt_caps",
24460
+ inputs: [
24461
+ {
24462
+ name: "pool_id",
24463
+ type: "core::felt252"
24464
+ },
24465
+ {
24466
+ name: "collateral_asset",
24467
+ type: "core::starknet::contract_address::ContractAddress"
24468
+ },
24469
+ {
24470
+ name: "debt_asset",
24471
+ type: "core::starknet::contract_address::ContractAddress"
24472
+ }
24473
+ ],
24474
+ outputs: [
24475
+ {
24476
+ type: "core::integer::u256"
24477
+ }
24478
+ ],
24479
+ state_mutability: "view"
24480
+ },
24481
+ {
24482
+ type: "function",
24483
+ name: "interest_rate_config",
24484
+ inputs: [
24485
+ {
24486
+ name: "pool_id",
24487
+ type: "core::felt252"
24488
+ },
24489
+ {
24490
+ name: "asset",
24491
+ type: "core::starknet::contract_address::ContractAddress"
24492
+ }
24493
+ ],
24494
+ outputs: [
24495
+ {
24496
+ type: "vesu::extension::components::interest_rate_model::InterestRateConfig"
24497
+ }
24498
+ ],
24499
+ state_mutability: "view"
24500
+ },
24501
+ {
24502
+ type: "function",
24503
+ name: "liquidation_config",
24504
+ inputs: [
24505
+ {
24506
+ name: "pool_id",
24507
+ type: "core::felt252"
24508
+ },
24509
+ {
24510
+ name: "collateral_asset",
24511
+ type: "core::starknet::contract_address::ContractAddress"
24512
+ },
24513
+ {
24514
+ name: "debt_asset",
24515
+ type: "core::starknet::contract_address::ContractAddress"
24516
+ }
24517
+ ],
24518
+ outputs: [
24519
+ {
24520
+ type: "vesu::extension::components::position_hooks::LiquidationConfig"
24521
+ }
24522
+ ],
24523
+ state_mutability: "view"
24524
+ },
24525
+ {
24526
+ type: "function",
24527
+ name: "shutdown_config",
24528
+ inputs: [
24529
+ {
24530
+ name: "pool_id",
24531
+ type: "core::felt252"
24532
+ }
24533
+ ],
24534
+ outputs: [
24535
+ {
24536
+ type: "vesu::extension::components::position_hooks::ShutdownConfig"
24537
+ }
24538
+ ],
24539
+ state_mutability: "view"
24540
+ },
24541
+ {
24542
+ type: "function",
24543
+ name: "shutdown_ltv_config",
24544
+ inputs: [
24545
+ {
24546
+ name: "pool_id",
24547
+ type: "core::felt252"
24548
+ },
24549
+ {
24550
+ name: "collateral_asset",
24551
+ type: "core::starknet::contract_address::ContractAddress"
24552
+ },
24553
+ {
24554
+ name: "debt_asset",
24555
+ type: "core::starknet::contract_address::ContractAddress"
24556
+ }
24557
+ ],
24558
+ outputs: [
24559
+ {
24560
+ type: "vesu::data_model::LTVConfig"
24561
+ }
24562
+ ],
24563
+ state_mutability: "view"
24564
+ },
24565
+ {
24566
+ type: "function",
24567
+ name: "shutdown_status",
24568
+ inputs: [
24569
+ {
24570
+ name: "pool_id",
24571
+ type: "core::felt252"
24572
+ },
24573
+ {
24574
+ name: "collateral_asset",
24575
+ type: "core::starknet::contract_address::ContractAddress"
24576
+ },
24577
+ {
24578
+ name: "debt_asset",
24579
+ type: "core::starknet::contract_address::ContractAddress"
24580
+ }
24581
+ ],
24582
+ outputs: [
24583
+ {
24584
+ type: "vesu::extension::components::position_hooks::ShutdownStatus"
24585
+ }
24586
+ ],
24587
+ state_mutability: "view"
24588
+ },
24589
+ {
24590
+ type: "function",
24591
+ name: "pairs",
24592
+ inputs: [
24593
+ {
24594
+ name: "pool_id",
24595
+ type: "core::felt252"
24596
+ },
24597
+ {
24598
+ name: "collateral_asset",
24599
+ type: "core::starknet::contract_address::ContractAddress"
24600
+ },
24601
+ {
24602
+ name: "debt_asset",
24603
+ type: "core::starknet::contract_address::ContractAddress"
24604
+ }
24605
+ ],
24606
+ outputs: [
24607
+ {
24608
+ type: "vesu::extension::components::position_hooks::Pair"
24609
+ }
24610
+ ],
24611
+ state_mutability: "view"
24612
+ },
24613
+ {
24614
+ type: "function",
24615
+ name: "violation_timestamp_for_pair",
24616
+ inputs: [
24617
+ {
24618
+ name: "pool_id",
24619
+ type: "core::felt252"
24620
+ },
24621
+ {
24622
+ name: "collateral_asset",
24623
+ type: "core::starknet::contract_address::ContractAddress"
24624
+ },
24625
+ {
24626
+ name: "debt_asset",
24627
+ type: "core::starknet::contract_address::ContractAddress"
24628
+ }
24629
+ ],
24630
+ outputs: [
24631
+ {
24632
+ type: "core::integer::u64"
24633
+ }
24634
+ ],
24635
+ state_mutability: "view"
24636
+ },
24637
+ {
24638
+ type: "function",
24639
+ name: "violation_timestamp_count",
24640
+ inputs: [
24641
+ {
24642
+ name: "pool_id",
24643
+ type: "core::felt252"
24644
+ },
24645
+ {
24646
+ name: "violation_timestamp",
24647
+ type: "core::integer::u64"
24648
+ }
24649
+ ],
24650
+ outputs: [
24651
+ {
24652
+ type: "core::integer::u128"
24653
+ }
24654
+ ],
24655
+ state_mutability: "view"
24656
+ },
24657
+ {
24658
+ type: "function",
24659
+ name: "oldest_violation_timestamp",
24660
+ inputs: [
24661
+ {
24662
+ name: "pool_id",
24663
+ type: "core::felt252"
24664
+ }
24665
+ ],
24666
+ outputs: [
24667
+ {
24668
+ type: "core::integer::u64"
24669
+ }
24670
+ ],
24671
+ state_mutability: "view"
24672
+ },
24673
+ {
24674
+ type: "function",
24675
+ name: "next_violation_timestamp",
24676
+ inputs: [
24677
+ {
24678
+ name: "pool_id",
24679
+ type: "core::felt252"
24680
+ },
24681
+ {
24682
+ name: "violation_timestamp",
24683
+ type: "core::integer::u64"
24684
+ }
24685
+ ],
24686
+ outputs: [
24687
+ {
24688
+ type: "core::integer::u64"
24689
+ }
24690
+ ],
24691
+ state_mutability: "view"
24692
+ },
24693
+ {
24694
+ type: "function",
24695
+ name: "v_token_for_collateral_asset",
24696
+ inputs: [
24697
+ {
24698
+ name: "pool_id",
24699
+ type: "core::felt252"
24700
+ },
24701
+ {
24702
+ name: "collateral_asset",
24703
+ type: "core::starknet::contract_address::ContractAddress"
24704
+ }
24705
+ ],
24706
+ outputs: [
24707
+ {
24708
+ type: "core::starknet::contract_address::ContractAddress"
24709
+ }
24710
+ ],
24711
+ state_mutability: "view"
24712
+ },
24713
+ {
24714
+ type: "function",
24715
+ name: "collateral_asset_for_v_token",
24716
+ inputs: [
24717
+ {
24718
+ name: "pool_id",
24719
+ type: "core::felt252"
24720
+ },
24721
+ {
24722
+ name: "v_token",
24723
+ type: "core::starknet::contract_address::ContractAddress"
24724
+ }
24725
+ ],
24726
+ outputs: [
24727
+ {
24728
+ type: "core::starknet::contract_address::ContractAddress"
24729
+ }
24730
+ ],
24731
+ state_mutability: "view"
24732
+ },
24733
+ {
24734
+ type: "function",
24735
+ name: "create_pool",
24736
+ inputs: [
24737
+ {
24738
+ name: "name",
24739
+ type: "core::felt252"
24740
+ },
24741
+ {
24742
+ name: "asset_params",
24743
+ type: "core::array::Span::<vesu::data_model::AssetParams>"
24744
+ },
24745
+ {
24746
+ name: "v_token_params",
24747
+ type: "core::array::Span::<vesu::extension::default_extension_po::VTokenParams>"
24748
+ },
24749
+ {
24750
+ name: "ltv_params",
24751
+ type: "core::array::Span::<vesu::data_model::LTVParams>"
24752
+ },
24753
+ {
24754
+ name: "interest_rate_configs",
24755
+ type: "core::array::Span::<vesu::extension::components::interest_rate_model::InterestRateConfig>"
24756
+ },
24757
+ {
24758
+ name: "pragma_oracle_params",
24759
+ type: "core::array::Span::<vesu::extension::default_extension_po::PragmaOracleParams>"
24760
+ },
24761
+ {
24762
+ name: "liquidation_params",
24763
+ type: "core::array::Span::<vesu::extension::default_extension_po::LiquidationParams>"
24764
+ },
24765
+ {
24766
+ name: "debt_caps",
24767
+ type: "core::array::Span::<vesu::data_model::DebtCapParams>"
24768
+ },
24769
+ {
24770
+ name: "shutdown_params",
24771
+ type: "vesu::extension::default_extension_po::ShutdownParams"
24772
+ },
24773
+ {
24774
+ name: "fee_params",
24775
+ type: "vesu::extension::default_extension_po::FeeParams"
24776
+ },
24777
+ {
24778
+ name: "owner",
24779
+ type: "core::starknet::contract_address::ContractAddress"
24780
+ }
24781
+ ],
24782
+ outputs: [
24783
+ {
24784
+ type: "core::felt252"
24785
+ }
24786
+ ],
24787
+ state_mutability: "external"
24788
+ },
24789
+ {
24790
+ type: "function",
24791
+ name: "add_asset",
24792
+ inputs: [
24793
+ {
24794
+ name: "pool_id",
24795
+ type: "core::felt252"
24796
+ },
24797
+ {
24798
+ name: "asset_params",
24799
+ type: "vesu::data_model::AssetParams"
24800
+ },
24801
+ {
24802
+ name: "v_token_params",
24803
+ type: "vesu::extension::default_extension_po::VTokenParams"
24804
+ },
24805
+ {
24806
+ name: "interest_rate_config",
24807
+ type: "vesu::extension::components::interest_rate_model::InterestRateConfig"
24808
+ },
24809
+ {
24810
+ name: "pragma_oracle_params",
24811
+ type: "vesu::extension::default_extension_po::PragmaOracleParams"
24812
+ }
24813
+ ],
24814
+ outputs: [],
24815
+ state_mutability: "external"
24816
+ },
24817
+ {
24818
+ type: "function",
24819
+ name: "set_asset_parameter",
24820
+ inputs: [
24821
+ {
24822
+ name: "pool_id",
24823
+ type: "core::felt252"
24824
+ },
24825
+ {
24826
+ name: "asset",
24827
+ type: "core::starknet::contract_address::ContractAddress"
24828
+ },
24829
+ {
24830
+ name: "parameter",
24831
+ type: "core::felt252"
24832
+ },
24833
+ {
24834
+ name: "value",
24835
+ type: "core::integer::u256"
24836
+ }
24837
+ ],
24838
+ outputs: [],
24839
+ state_mutability: "external"
24840
+ },
24841
+ {
24842
+ type: "function",
24843
+ name: "set_debt_cap",
24844
+ inputs: [
24845
+ {
24846
+ name: "pool_id",
24847
+ type: "core::felt252"
24848
+ },
24849
+ {
24850
+ name: "collateral_asset",
24851
+ type: "core::starknet::contract_address::ContractAddress"
24852
+ },
24853
+ {
24854
+ name: "debt_asset",
24855
+ type: "core::starknet::contract_address::ContractAddress"
24856
+ },
24857
+ {
24858
+ name: "debt_cap",
24859
+ type: "core::integer::u256"
24860
+ }
24861
+ ],
24862
+ outputs: [],
24863
+ state_mutability: "external"
24864
+ },
24865
+ {
24866
+ type: "function",
24867
+ name: "set_interest_rate_parameter",
24868
+ inputs: [
24869
+ {
24870
+ name: "pool_id",
24871
+ type: "core::felt252"
24872
+ },
24873
+ {
24874
+ name: "asset",
24875
+ type: "core::starknet::contract_address::ContractAddress"
24876
+ },
24877
+ {
24878
+ name: "parameter",
24879
+ type: "core::felt252"
24880
+ },
24881
+ {
24882
+ name: "value",
24883
+ type: "core::integer::u256"
24884
+ }
24885
+ ],
24886
+ outputs: [],
24887
+ state_mutability: "external"
24888
+ },
24889
+ {
24890
+ type: "function",
24891
+ name: "set_oracle_parameter",
24892
+ inputs: [
24893
+ {
24894
+ name: "pool_id",
24895
+ type: "core::felt252"
24896
+ },
24897
+ {
24898
+ name: "asset",
24899
+ type: "core::starknet::contract_address::ContractAddress"
24900
+ },
24901
+ {
24902
+ name: "parameter",
24903
+ type: "core::felt252"
24904
+ },
24905
+ {
24906
+ name: "value",
24907
+ type: "core::felt252"
24908
+ }
24909
+ ],
24910
+ outputs: [],
24911
+ state_mutability: "external"
24912
+ },
24913
+ {
24914
+ type: "function",
24915
+ name: "set_liquidation_config",
24916
+ inputs: [
24917
+ {
24918
+ name: "pool_id",
24919
+ type: "core::felt252"
24920
+ },
24921
+ {
24922
+ name: "collateral_asset",
24923
+ type: "core::starknet::contract_address::ContractAddress"
24924
+ },
24925
+ {
24926
+ name: "debt_asset",
24927
+ type: "core::starknet::contract_address::ContractAddress"
24928
+ },
24929
+ {
24930
+ name: "liquidation_config",
24931
+ type: "vesu::extension::components::position_hooks::LiquidationConfig"
24932
+ }
24933
+ ],
24934
+ outputs: [],
24935
+ state_mutability: "external"
24936
+ },
24937
+ {
24938
+ type: "function",
24939
+ name: "set_ltv_config",
24940
+ inputs: [
24941
+ {
24942
+ name: "pool_id",
24943
+ type: "core::felt252"
24944
+ },
24945
+ {
24946
+ name: "collateral_asset",
24947
+ type: "core::starknet::contract_address::ContractAddress"
24948
+ },
24949
+ {
24950
+ name: "debt_asset",
24951
+ type: "core::starknet::contract_address::ContractAddress"
24952
+ },
24953
+ {
24954
+ name: "ltv_config",
24955
+ type: "vesu::data_model::LTVConfig"
24956
+ }
24957
+ ],
24958
+ outputs: [],
24959
+ state_mutability: "external"
24960
+ },
24961
+ {
24962
+ type: "function",
24963
+ name: "set_shutdown_config",
24964
+ inputs: [
24965
+ {
24966
+ name: "pool_id",
24967
+ type: "core::felt252"
24968
+ },
24969
+ {
24970
+ name: "shutdown_config",
24971
+ type: "vesu::extension::components::position_hooks::ShutdownConfig"
24972
+ }
24973
+ ],
24974
+ outputs: [],
24975
+ state_mutability: "external"
24976
+ },
24977
+ {
24978
+ type: "function",
24979
+ name: "set_shutdown_ltv_config",
24980
+ inputs: [
24981
+ {
24982
+ name: "pool_id",
24983
+ type: "core::felt252"
24984
+ },
24985
+ {
24986
+ name: "collateral_asset",
24987
+ type: "core::starknet::contract_address::ContractAddress"
24988
+ },
24989
+ {
24990
+ name: "debt_asset",
24991
+ type: "core::starknet::contract_address::ContractAddress"
24992
+ },
24993
+ {
24994
+ name: "shutdown_ltv_config",
24995
+ type: "vesu::data_model::LTVConfig"
24996
+ }
24997
+ ],
24998
+ outputs: [],
24999
+ state_mutability: "external"
25000
+ },
25001
+ {
25002
+ type: "function",
25003
+ name: "set_shutdown_mode",
25004
+ inputs: [
25005
+ {
25006
+ name: "pool_id",
25007
+ type: "core::felt252"
25008
+ },
25009
+ {
25010
+ name: "shutdown_mode",
25011
+ type: "vesu::extension::components::position_hooks::ShutdownMode"
25012
+ }
25013
+ ],
25014
+ outputs: [],
25015
+ state_mutability: "external"
25016
+ },
25017
+ {
25018
+ type: "function",
25019
+ name: "set_pool_owner",
25020
+ inputs: [
25021
+ {
25022
+ name: "pool_id",
25023
+ type: "core::felt252"
25024
+ },
25025
+ {
25026
+ name: "owner",
25027
+ type: "core::starknet::contract_address::ContractAddress"
25028
+ }
25029
+ ],
25030
+ outputs: [],
25031
+ state_mutability: "external"
25032
+ },
25033
+ {
25034
+ type: "function",
25035
+ name: "set_shutdown_mode_agent",
25036
+ inputs: [
25037
+ {
25038
+ name: "pool_id",
25039
+ type: "core::felt252"
25040
+ },
25041
+ {
25042
+ name: "shutdown_mode_agent",
25043
+ type: "core::starknet::contract_address::ContractAddress"
25044
+ }
25045
+ ],
25046
+ outputs: [],
25047
+ state_mutability: "external"
25048
+ },
25049
+ {
25050
+ type: "function",
25051
+ name: "update_shutdown_status",
25052
+ inputs: [
25053
+ {
25054
+ name: "pool_id",
25055
+ type: "core::felt252"
25056
+ },
25057
+ {
25058
+ name: "collateral_asset",
25059
+ type: "core::starknet::contract_address::ContractAddress"
25060
+ },
25061
+ {
25062
+ name: "debt_asset",
25063
+ type: "core::starknet::contract_address::ContractAddress"
25064
+ }
25065
+ ],
25066
+ outputs: [
25067
+ {
25068
+ type: "vesu::extension::components::position_hooks::ShutdownMode"
25069
+ }
25070
+ ],
25071
+ state_mutability: "external"
25072
+ },
25073
+ {
25074
+ type: "function",
25075
+ name: "set_fee_config",
25076
+ inputs: [
25077
+ {
25078
+ name: "pool_id",
25079
+ type: "core::felt252"
25080
+ },
25081
+ {
25082
+ name: "fee_config",
25083
+ type: "vesu::extension::components::fee_model::FeeConfig"
25084
+ }
25085
+ ],
25086
+ outputs: [],
25087
+ state_mutability: "external"
25088
+ },
25089
+ {
25090
+ type: "function",
25091
+ name: "claim_fees",
25092
+ inputs: [
25093
+ {
25094
+ name: "pool_id",
25095
+ type: "core::felt252"
25096
+ },
25097
+ {
25098
+ name: "collateral_asset",
25099
+ type: "core::starknet::contract_address::ContractAddress"
25100
+ }
25101
+ ],
25102
+ outputs: [],
25103
+ state_mutability: "external"
25104
+ },
25105
+ {
25106
+ type: "function",
25107
+ name: "migrate_pool",
25108
+ inputs: [
25109
+ {
25110
+ name: "pool_id",
25111
+ type: "core::felt252"
25112
+ },
25113
+ {
25114
+ name: "name",
25115
+ type: "core::felt252"
25116
+ },
25117
+ {
25118
+ name: "v_token_configs",
25119
+ type: "core::array::Span::<(core::felt252, core::felt252, core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress)>"
25120
+ },
25121
+ {
25122
+ name: "interest_rate_configs",
25123
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::interest_rate_model::InterestRateConfig)>"
25124
+ },
25125
+ {
25126
+ name: "pragma_oracle_configs",
25127
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::pragma_oracle::OracleConfig)>"
25128
+ },
25129
+ {
25130
+ name: "liquidation_configs",
25131
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::LiquidationConfig)>"
25132
+ },
25133
+ {
25134
+ name: "pairs",
25135
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::Pair)>"
25136
+ },
25137
+ {
25138
+ name: "debt_caps",
25139
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, core::integer::u256)>"
25140
+ },
25141
+ {
25142
+ name: "shutdown_ltv_configs",
25143
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::data_model::LTVConfig)>"
25144
+ },
25145
+ {
25146
+ name: "shutdown_config",
25147
+ type: "vesu::extension::components::position_hooks::ShutdownConfig"
25148
+ },
25149
+ {
25150
+ name: "fee_config",
25151
+ type: "vesu::extension::components::fee_model::FeeConfig"
25152
+ },
25153
+ {
25154
+ name: "owner",
25155
+ type: "core::starknet::contract_address::ContractAddress"
25156
+ }
25157
+ ],
25158
+ outputs: [],
25159
+ state_mutability: "external"
25160
+ },
25161
+ {
25162
+ type: "function",
25163
+ name: "set_migrator",
25164
+ inputs: [
25165
+ {
25166
+ name: "migrator",
25167
+ type: "core::starknet::contract_address::ContractAddress"
25168
+ }
25169
+ ],
25170
+ outputs: [],
25171
+ state_mutability: "external"
25172
+ },
25173
+ {
25174
+ type: "function",
25175
+ name: "set_extension_utils_class_hash",
25176
+ inputs: [
25177
+ {
25178
+ name: "extension",
25179
+ type: "core::felt252"
25180
+ }
25181
+ ],
25182
+ outputs: [],
25183
+ state_mutability: "external"
25184
+ },
25185
+ {
25186
+ type: "function",
25187
+ name: "upgrade_name",
25188
+ inputs: [],
25189
+ outputs: [
25190
+ {
25191
+ type: "core::felt252"
25192
+ }
25193
+ ],
25194
+ state_mutability: "view"
25195
+ },
25196
+ {
25197
+ type: "function",
25198
+ name: "upgrade",
25199
+ inputs: [
25200
+ {
25201
+ name: "new_implementation",
25202
+ type: "core::starknet::class_hash::ClassHash"
25203
+ }
25204
+ ],
25205
+ outputs: [],
25206
+ state_mutability: "external"
25207
+ }
25208
+ ]
25209
+ },
25210
+ {
25211
+ type: "impl",
25212
+ name: "ExtensionImpl",
25213
+ interface_name: "vesu::extension::interface::IExtension"
25214
+ },
25215
+ {
25216
+ type: "struct",
25217
+ name: "vesu::data_model::AssetPrice",
25218
+ members: [
25219
+ {
25220
+ name: "value",
25221
+ type: "core::integer::u256"
25222
+ },
25223
+ {
25224
+ name: "is_valid",
25225
+ type: "core::bool"
25226
+ }
25227
+ ]
25228
+ },
25229
+ {
25230
+ type: "struct",
25231
+ name: "vesu::data_model::AssetConfig",
25232
+ members: [
25233
+ {
25234
+ name: "total_collateral_shares",
25235
+ type: "core::integer::u256"
25236
+ },
25237
+ {
25238
+ name: "total_nominal_debt",
25239
+ type: "core::integer::u256"
25240
+ },
25241
+ {
25242
+ name: "reserve",
25243
+ type: "core::integer::u256"
25244
+ },
25245
+ {
25246
+ name: "max_utilization",
25247
+ type: "core::integer::u256"
25248
+ },
25249
+ {
25250
+ name: "floor",
25251
+ type: "core::integer::u256"
25252
+ },
25253
+ {
25254
+ name: "scale",
25255
+ type: "core::integer::u256"
25256
+ },
25257
+ {
25258
+ name: "is_legacy",
25259
+ type: "core::bool"
25260
+ },
25261
+ {
25262
+ name: "last_updated",
25263
+ type: "core::integer::u64"
25264
+ },
25265
+ {
25266
+ name: "last_rate_accumulator",
25267
+ type: "core::integer::u256"
25268
+ },
25269
+ {
25270
+ name: "last_full_utilization_rate",
25271
+ type: "core::integer::u256"
25272
+ },
25273
+ {
25274
+ name: "fee_rate",
25275
+ type: "core::integer::u256"
25276
+ }
25277
+ ]
25278
+ },
25279
+ {
25280
+ type: "struct",
25281
+ name: "vesu::data_model::Position",
25282
+ members: [
25283
+ {
25284
+ name: "collateral_shares",
25285
+ type: "core::integer::u256"
25286
+ },
25287
+ {
25288
+ name: "nominal_debt",
25289
+ type: "core::integer::u256"
25290
+ }
25291
+ ]
25292
+ },
25293
+ {
25294
+ type: "struct",
25295
+ name: "vesu::data_model::Context",
25296
+ members: [
25297
+ {
25298
+ name: "pool_id",
25299
+ type: "core::felt252"
25300
+ },
25301
+ {
25302
+ name: "extension",
25303
+ type: "core::starknet::contract_address::ContractAddress"
25304
+ },
25305
+ {
25306
+ name: "collateral_asset",
25307
+ type: "core::starknet::contract_address::ContractAddress"
25308
+ },
25309
+ {
25310
+ name: "debt_asset",
25311
+ type: "core::starknet::contract_address::ContractAddress"
25312
+ },
25313
+ {
25314
+ name: "collateral_asset_config",
25315
+ type: "vesu::data_model::AssetConfig"
25316
+ },
25317
+ {
25318
+ name: "debt_asset_config",
25319
+ type: "vesu::data_model::AssetConfig"
25320
+ },
25321
+ {
25322
+ name: "collateral_asset_price",
25323
+ type: "vesu::data_model::AssetPrice"
25324
+ },
25325
+ {
25326
+ name: "debt_asset_price",
25327
+ type: "vesu::data_model::AssetPrice"
25328
+ },
25329
+ {
25330
+ name: "collateral_asset_fee_shares",
25331
+ type: "core::integer::u256"
25332
+ },
25333
+ {
25334
+ name: "debt_asset_fee_shares",
25335
+ type: "core::integer::u256"
25336
+ },
25337
+ {
25338
+ name: "max_ltv",
25339
+ type: "core::integer::u64"
25340
+ },
25341
+ {
25342
+ name: "user",
25343
+ type: "core::starknet::contract_address::ContractAddress"
25344
+ },
25345
+ {
25346
+ name: "position",
25347
+ type: "vesu::data_model::Position"
25348
+ }
25349
+ ]
25350
+ },
25351
+ {
25352
+ type: "enum",
25353
+ name: "vesu::data_model::AmountType",
25354
+ variants: [
25355
+ {
25356
+ name: "Delta",
25357
+ type: "()"
25358
+ },
25359
+ {
25360
+ name: "Target",
25361
+ type: "()"
25362
+ }
25363
+ ]
25364
+ },
25365
+ {
25366
+ type: "enum",
25367
+ name: "vesu::data_model::AmountDenomination",
25368
+ variants: [
25369
+ {
25370
+ name: "Native",
25371
+ type: "()"
25372
+ },
25373
+ {
25374
+ name: "Assets",
25375
+ type: "()"
25376
+ }
25377
+ ]
25378
+ },
25379
+ {
25380
+ type: "struct",
25381
+ name: "alexandria_math::i257::i257",
25382
+ members: [
25383
+ {
25384
+ name: "abs",
25385
+ type: "core::integer::u256"
25386
+ },
25387
+ {
25388
+ name: "is_negative",
25389
+ type: "core::bool"
25390
+ }
25391
+ ]
25392
+ },
25393
+ {
25394
+ type: "struct",
25395
+ name: "vesu::data_model::Amount",
25396
+ members: [
25397
+ {
25398
+ name: "amount_type",
25399
+ type: "vesu::data_model::AmountType"
25400
+ },
25401
+ {
25402
+ name: "denomination",
25403
+ type: "vesu::data_model::AmountDenomination"
25404
+ },
25405
+ {
25406
+ name: "value",
25407
+ type: "alexandria_math::i257::i257"
25408
+ }
25409
+ ]
25410
+ },
25411
+ {
25412
+ type: "struct",
25413
+ name: "core::array::Span::<core::felt252>",
25414
+ members: [
25415
+ {
25416
+ name: "snapshot",
25417
+ type: "@core::array::Array::<core::felt252>"
25418
+ }
25419
+ ]
25420
+ },
25421
+ {
25422
+ type: "struct",
25423
+ name: "vesu::data_model::UnsignedAmount",
25424
+ members: [
25425
+ {
25426
+ name: "amount_type",
25427
+ type: "vesu::data_model::AmountType"
25428
+ },
25429
+ {
25430
+ name: "denomination",
25431
+ type: "vesu::data_model::AmountDenomination"
25432
+ },
25433
+ {
25434
+ name: "value",
25435
+ type: "core::integer::u256"
25436
+ }
25437
+ ]
25438
+ },
25439
+ {
25440
+ type: "interface",
25441
+ name: "vesu::extension::interface::IExtension",
25442
+ items: [
25443
+ {
25444
+ type: "function",
25445
+ name: "singleton",
25446
+ inputs: [],
25447
+ outputs: [
25448
+ {
25449
+ type: "core::starknet::contract_address::ContractAddress"
25450
+ }
25451
+ ],
25452
+ state_mutability: "view"
25453
+ },
25454
+ {
25455
+ type: "function",
25456
+ name: "price",
25457
+ inputs: [
25458
+ {
25459
+ name: "pool_id",
25460
+ type: "core::felt252"
25461
+ },
25462
+ {
25463
+ name: "asset",
25464
+ type: "core::starknet::contract_address::ContractAddress"
25465
+ }
25466
+ ],
25467
+ outputs: [
25468
+ {
25469
+ type: "vesu::data_model::AssetPrice"
25470
+ }
25471
+ ],
25472
+ state_mutability: "view"
25473
+ },
25474
+ {
25475
+ type: "function",
25476
+ name: "interest_rate",
25477
+ inputs: [
25478
+ {
25479
+ name: "pool_id",
25480
+ type: "core::felt252"
25481
+ },
25482
+ {
25483
+ name: "asset",
25484
+ type: "core::starknet::contract_address::ContractAddress"
25485
+ },
25486
+ {
25487
+ name: "utilization",
25488
+ type: "core::integer::u256"
25489
+ },
25490
+ {
25491
+ name: "last_updated",
25492
+ type: "core::integer::u64"
25493
+ },
25494
+ {
25495
+ name: "last_full_utilization_rate",
25496
+ type: "core::integer::u256"
25497
+ }
25498
+ ],
25499
+ outputs: [
25500
+ {
25501
+ type: "core::integer::u256"
25502
+ }
25503
+ ],
25504
+ state_mutability: "view"
25505
+ },
25506
+ {
25507
+ type: "function",
25508
+ name: "rate_accumulator",
25509
+ inputs: [
25510
+ {
25511
+ name: "pool_id",
25512
+ type: "core::felt252"
25513
+ },
25514
+ {
25515
+ name: "asset",
25516
+ type: "core::starknet::contract_address::ContractAddress"
25517
+ },
25518
+ {
25519
+ name: "utilization",
25520
+ type: "core::integer::u256"
25521
+ },
25522
+ {
25523
+ name: "last_updated",
25524
+ type: "core::integer::u64"
25525
+ },
25526
+ {
25527
+ name: "last_rate_accumulator",
25528
+ type: "core::integer::u256"
25529
+ },
25530
+ {
25531
+ name: "last_full_utilization_rate",
25532
+ type: "core::integer::u256"
25533
+ }
25534
+ ],
25535
+ outputs: [
25536
+ {
25537
+ type: "(core::integer::u256, core::integer::u256)"
25538
+ }
25539
+ ],
25540
+ state_mutability: "view"
25541
+ },
25542
+ {
25543
+ type: "function",
25544
+ name: "before_modify_position",
25545
+ inputs: [
25546
+ {
25547
+ name: "context",
25548
+ type: "vesu::data_model::Context"
25549
+ },
25550
+ {
25551
+ name: "collateral",
25552
+ type: "vesu::data_model::Amount"
25553
+ },
25554
+ {
25555
+ name: "debt",
25556
+ type: "vesu::data_model::Amount"
25557
+ },
25558
+ {
25559
+ name: "data",
25560
+ type: "core::array::Span::<core::felt252>"
25561
+ },
25562
+ {
25563
+ name: "caller",
25564
+ type: "core::starknet::contract_address::ContractAddress"
25565
+ }
25566
+ ],
25567
+ outputs: [
25568
+ {
25569
+ type: "(vesu::data_model::Amount, vesu::data_model::Amount)"
25570
+ }
25571
+ ],
25572
+ state_mutability: "external"
25573
+ },
25574
+ {
25575
+ type: "function",
25576
+ name: "after_modify_position",
25577
+ inputs: [
25578
+ {
25579
+ name: "context",
25580
+ type: "vesu::data_model::Context"
25581
+ },
25582
+ {
25583
+ name: "collateral_delta",
25584
+ type: "alexandria_math::i257::i257"
25585
+ },
25586
+ {
25587
+ name: "collateral_shares_delta",
25588
+ type: "alexandria_math::i257::i257"
25589
+ },
25590
+ {
25591
+ name: "debt_delta",
25592
+ type: "alexandria_math::i257::i257"
25593
+ },
25594
+ {
25595
+ name: "nominal_debt_delta",
25596
+ type: "alexandria_math::i257::i257"
25597
+ },
25598
+ {
25599
+ name: "data",
25600
+ type: "core::array::Span::<core::felt252>"
25601
+ },
25602
+ {
25603
+ name: "caller",
25604
+ type: "core::starknet::contract_address::ContractAddress"
25605
+ }
25606
+ ],
25607
+ outputs: [
25608
+ {
25609
+ type: "core::bool"
25610
+ }
25611
+ ],
25612
+ state_mutability: "external"
25613
+ },
25614
+ {
25615
+ type: "function",
25616
+ name: "before_transfer_position",
25617
+ inputs: [
25618
+ {
25619
+ name: "from_context",
25620
+ type: "vesu::data_model::Context"
25621
+ },
25622
+ {
25623
+ name: "to_context",
25624
+ type: "vesu::data_model::Context"
25625
+ },
25626
+ {
25627
+ name: "collateral",
25628
+ type: "vesu::data_model::UnsignedAmount"
25629
+ },
25630
+ {
25631
+ name: "debt",
25632
+ type: "vesu::data_model::UnsignedAmount"
25633
+ },
25634
+ {
25635
+ name: "data",
25636
+ type: "core::array::Span::<core::felt252>"
25637
+ },
25638
+ {
25639
+ name: "caller",
25640
+ type: "core::starknet::contract_address::ContractAddress"
25641
+ }
25642
+ ],
25643
+ outputs: [
25644
+ {
25645
+ type: "(vesu::data_model::UnsignedAmount, vesu::data_model::UnsignedAmount)"
25646
+ }
25647
+ ],
25648
+ state_mutability: "external"
25649
+ },
25650
+ {
25651
+ type: "function",
25652
+ name: "after_transfer_position",
25653
+ inputs: [
25654
+ {
25655
+ name: "from_context",
25656
+ type: "vesu::data_model::Context"
25657
+ },
25658
+ {
25659
+ name: "to_context",
25660
+ type: "vesu::data_model::Context"
25661
+ },
25662
+ {
25663
+ name: "collateral_delta",
25664
+ type: "core::integer::u256"
25665
+ },
25666
+ {
25667
+ name: "collateral_shares_delta",
25668
+ type: "core::integer::u256"
25669
+ },
25670
+ {
25671
+ name: "debt_delta",
25672
+ type: "core::integer::u256"
25673
+ },
25674
+ {
25675
+ name: "nominal_debt_delta",
25676
+ type: "core::integer::u256"
25677
+ },
25678
+ {
25679
+ name: "data",
25680
+ type: "core::array::Span::<core::felt252>"
25681
+ },
25682
+ {
25683
+ name: "caller",
25684
+ type: "core::starknet::contract_address::ContractAddress"
25685
+ }
25686
+ ],
25687
+ outputs: [
25688
+ {
25689
+ type: "core::bool"
25690
+ }
25691
+ ],
25692
+ state_mutability: "external"
25693
+ },
25694
+ {
25695
+ type: "function",
25696
+ name: "before_liquidate_position",
25697
+ inputs: [
25698
+ {
25699
+ name: "context",
25700
+ type: "vesu::data_model::Context"
25701
+ },
25702
+ {
25703
+ name: "data",
25704
+ type: "core::array::Span::<core::felt252>"
25705
+ },
25706
+ {
25707
+ name: "caller",
25708
+ type: "core::starknet::contract_address::ContractAddress"
25709
+ }
25710
+ ],
25711
+ outputs: [
25712
+ {
25713
+ type: "(core::integer::u256, core::integer::u256, core::integer::u256)"
25714
+ }
25715
+ ],
25716
+ state_mutability: "external"
25717
+ },
25718
+ {
25719
+ type: "function",
25720
+ name: "after_liquidate_position",
25721
+ inputs: [
25722
+ {
25723
+ name: "context",
25724
+ type: "vesu::data_model::Context"
25725
+ },
25726
+ {
25727
+ name: "collateral_delta",
25728
+ type: "alexandria_math::i257::i257"
25729
+ },
25730
+ {
25731
+ name: "collateral_shares_delta",
25732
+ type: "alexandria_math::i257::i257"
25733
+ },
25734
+ {
25735
+ name: "debt_delta",
25736
+ type: "alexandria_math::i257::i257"
25737
+ },
25738
+ {
25739
+ name: "nominal_debt_delta",
25740
+ type: "alexandria_math::i257::i257"
25741
+ },
25742
+ {
25743
+ name: "bad_debt",
25744
+ type: "core::integer::u256"
25745
+ },
25746
+ {
25747
+ name: "data",
25748
+ type: "core::array::Span::<core::felt252>"
25749
+ },
25750
+ {
25751
+ name: "caller",
25752
+ type: "core::starknet::contract_address::ContractAddress"
25753
+ }
25754
+ ],
25755
+ outputs: [
25756
+ {
25757
+ type: "core::bool"
25758
+ }
25759
+ ],
25760
+ state_mutability: "external"
25761
+ }
25762
+ ]
25763
+ },
25764
+ {
25765
+ type: "constructor",
25766
+ name: "constructor",
25767
+ inputs: [
25768
+ {
25769
+ name: "singleton",
25770
+ type: "core::starknet::contract_address::ContractAddress"
25771
+ },
25772
+ {
25773
+ name: "oracle_address",
25774
+ type: "core::starknet::contract_address::ContractAddress"
25775
+ },
25776
+ {
25777
+ name: "summary_address",
25778
+ type: "core::starknet::contract_address::ContractAddress"
25779
+ },
25780
+ {
25781
+ name: "v_token_class_hash",
25782
+ type: "core::felt252"
25783
+ },
25784
+ {
25785
+ name: "v_token_v2_class_hash",
25786
+ type: "core::felt252"
25787
+ },
25788
+ {
25789
+ name: "migrator",
25790
+ type: "core::starknet::contract_address::ContractAddress"
25791
+ },
25792
+ {
25793
+ name: "extension_utils_class_hash",
25794
+ type: "core::felt252"
25795
+ }
25796
+ ]
25797
+ },
25798
+ {
25799
+ type: "event",
25800
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetLiquidationConfig",
25801
+ kind: "struct",
25802
+ members: [
25803
+ {
25804
+ name: "pool_id",
25805
+ type: "core::felt252",
25806
+ kind: "key"
25807
+ },
25808
+ {
25809
+ name: "collateral_asset",
25810
+ type: "core::starknet::contract_address::ContractAddress",
25811
+ kind: "key"
25812
+ },
25813
+ {
25814
+ name: "debt_asset",
25815
+ type: "core::starknet::contract_address::ContractAddress",
25816
+ kind: "key"
25817
+ },
25818
+ {
25819
+ name: "liquidation_config",
25820
+ type: "vesu::extension::components::position_hooks::LiquidationConfig",
25821
+ kind: "data"
25822
+ }
25823
+ ]
25824
+ },
25825
+ {
25826
+ type: "event",
25827
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownConfig",
25828
+ kind: "struct",
25829
+ members: [
25830
+ {
25831
+ name: "pool_id",
25832
+ type: "core::felt252",
25833
+ kind: "key"
25834
+ },
25835
+ {
25836
+ name: "shutdown_config",
25837
+ type: "vesu::extension::components::position_hooks::ShutdownConfig",
25838
+ kind: "data"
25839
+ }
25840
+ ]
25841
+ },
25842
+ {
25843
+ type: "event",
25844
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownLTVConfig",
25845
+ kind: "struct",
25846
+ members: [
25847
+ {
25848
+ name: "pool_id",
25849
+ type: "core::felt252",
25850
+ kind: "key"
25851
+ },
25852
+ {
25853
+ name: "collateral_asset",
25854
+ type: "core::starknet::contract_address::ContractAddress",
25855
+ kind: "key"
25856
+ },
25857
+ {
25858
+ name: "debt_asset",
25859
+ type: "core::starknet::contract_address::ContractAddress",
25860
+ kind: "key"
25861
+ },
25862
+ {
25863
+ name: "shutdown_ltv_config",
25864
+ type: "vesu::data_model::LTVConfig",
25865
+ kind: "data"
25866
+ }
25867
+ ]
25868
+ },
25869
+ {
25870
+ type: "event",
25871
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetDebtCap",
25872
+ kind: "struct",
25873
+ members: [
25874
+ {
25875
+ name: "pool_id",
25876
+ type: "core::felt252",
25877
+ kind: "key"
25878
+ },
25879
+ {
25880
+ name: "collateral_asset",
25881
+ type: "core::starknet::contract_address::ContractAddress",
25882
+ kind: "key"
25883
+ },
25884
+ {
25885
+ name: "debt_asset",
25886
+ type: "core::starknet::contract_address::ContractAddress",
25887
+ kind: "key"
25888
+ },
25889
+ {
25890
+ name: "debt_cap",
25891
+ type: "core::integer::u256",
25892
+ kind: "data"
25893
+ }
25894
+ ]
25895
+ },
25896
+ {
25897
+ type: "event",
25898
+ name: "vesu::extension::components::position_hooks::position_hooks_component::Event",
25899
+ kind: "enum",
25900
+ variants: [
25901
+ {
25902
+ name: "SetLiquidationConfig",
25903
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetLiquidationConfig",
25904
+ kind: "nested"
25905
+ },
25906
+ {
25907
+ name: "SetShutdownConfig",
25908
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownConfig",
25909
+ kind: "nested"
25910
+ },
25911
+ {
25912
+ name: "SetShutdownLTVConfig",
25913
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownLTVConfig",
25914
+ kind: "nested"
25915
+ },
25916
+ {
25917
+ name: "SetDebtCap",
25918
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetDebtCap",
25919
+ kind: "nested"
25920
+ }
25921
+ ]
25922
+ },
25923
+ {
25924
+ type: "event",
25925
+ name: "vesu::extension::components::interest_rate_model::interest_rate_model_component::SetInterestRateConfig",
25926
+ kind: "struct",
25927
+ members: [
25928
+ {
25929
+ name: "pool_id",
25930
+ type: "core::felt252",
25931
+ kind: "data"
25932
+ },
25933
+ {
25934
+ name: "asset",
25935
+ type: "core::starknet::contract_address::ContractAddress",
25936
+ kind: "data"
25937
+ },
25938
+ {
25939
+ name: "interest_rate_config",
25940
+ type: "vesu::extension::components::interest_rate_model::InterestRateConfig",
25941
+ kind: "data"
25942
+ }
25943
+ ]
25944
+ },
25945
+ {
25946
+ type: "event",
25947
+ name: "vesu::extension::components::interest_rate_model::interest_rate_model_component::Event",
25948
+ kind: "enum",
25949
+ variants: [
25950
+ {
25951
+ name: "SetInterestRateConfig",
25952
+ type: "vesu::extension::components::interest_rate_model::interest_rate_model_component::SetInterestRateConfig",
25953
+ kind: "nested"
25954
+ }
25955
+ ]
25956
+ },
25957
+ {
25958
+ type: "event",
25959
+ name: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleConfig",
25960
+ kind: "struct",
25961
+ members: [
25962
+ {
25963
+ name: "pool_id",
25964
+ type: "core::felt252",
25965
+ kind: "data"
25966
+ },
25967
+ {
25968
+ name: "asset",
25969
+ type: "core::starknet::contract_address::ContractAddress",
25970
+ kind: "data"
25971
+ },
25972
+ {
25973
+ name: "oracle_config",
25974
+ type: "vesu::extension::components::pragma_oracle::OracleConfig",
25975
+ kind: "data"
25976
+ }
25977
+ ]
25978
+ },
25979
+ {
25980
+ type: "event",
25981
+ name: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleParameter",
25982
+ kind: "struct",
25983
+ members: [
25984
+ {
25985
+ name: "pool_id",
25986
+ type: "core::felt252",
25987
+ kind: "data"
25988
+ },
25989
+ {
25990
+ name: "asset",
25991
+ type: "core::starknet::contract_address::ContractAddress",
25992
+ kind: "data"
25993
+ },
25994
+ {
25995
+ name: "parameter",
25996
+ type: "core::felt252",
25997
+ kind: "data"
25998
+ },
25999
+ {
26000
+ name: "value",
26001
+ type: "core::felt252",
26002
+ kind: "data"
26003
+ }
26004
+ ]
26005
+ },
26006
+ {
26007
+ type: "event",
26008
+ name: "vesu::extension::components::pragma_oracle::pragma_oracle_component::Event",
26009
+ kind: "enum",
26010
+ variants: [
26011
+ {
26012
+ name: "SetOracleConfig",
26013
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleConfig",
26014
+ kind: "nested"
26015
+ },
26016
+ {
26017
+ name: "SetOracleParameter",
26018
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleParameter",
26019
+ kind: "nested"
26020
+ }
26021
+ ]
26022
+ },
26023
+ {
26024
+ type: "event",
26025
+ name: "vesu::map_list::map_list_component::Event",
26026
+ kind: "enum",
26027
+ variants: []
26028
+ },
26029
+ {
26030
+ type: "event",
26031
+ name: "vesu::extension::components::fee_model::fee_model_component::SetFeeConfig",
26032
+ kind: "struct",
26033
+ members: [
26034
+ {
26035
+ name: "pool_id",
26036
+ type: "core::felt252",
26037
+ kind: "key"
26038
+ },
26039
+ {
26040
+ name: "fee_config",
26041
+ type: "vesu::extension::components::fee_model::FeeConfig",
26042
+ kind: "key"
26043
+ }
26044
+ ]
26045
+ },
26046
+ {
26047
+ type: "event",
26048
+ name: "vesu::extension::components::fee_model::fee_model_component::ClaimFees",
26049
+ kind: "struct",
26050
+ members: [
26051
+ {
26052
+ name: "pool_id",
26053
+ type: "core::felt252",
26054
+ kind: "key"
26055
+ },
26056
+ {
26057
+ name: "collateral_asset",
26058
+ type: "core::starknet::contract_address::ContractAddress",
26059
+ kind: "data"
26060
+ },
26061
+ {
26062
+ name: "debt_asset",
26063
+ type: "core::starknet::contract_address::ContractAddress",
26064
+ kind: "data"
26065
+ },
26066
+ {
26067
+ name: "recipient",
26068
+ type: "core::starknet::contract_address::ContractAddress",
26069
+ kind: "data"
26070
+ },
26071
+ {
26072
+ name: "amount",
26073
+ type: "core::integer::u256",
26074
+ kind: "data"
26075
+ }
26076
+ ]
26077
+ },
26078
+ {
26079
+ type: "event",
26080
+ name: "vesu::extension::components::fee_model::fee_model_component::Event",
26081
+ kind: "enum",
26082
+ variants: [
26083
+ {
26084
+ name: "SetFeeConfig",
26085
+ type: "vesu::extension::components::fee_model::fee_model_component::SetFeeConfig",
26086
+ kind: "nested"
26087
+ },
26088
+ {
26089
+ name: "ClaimFees",
26090
+ type: "vesu::extension::components::fee_model::fee_model_component::ClaimFees",
26091
+ kind: "nested"
26092
+ }
26093
+ ]
26094
+ },
26095
+ {
26096
+ type: "event",
26097
+ name: "vesu::extension::components::tokenization::tokenization_component::CreateVToken",
26098
+ kind: "struct",
26099
+ members: [
26100
+ {
26101
+ name: "v_token",
26102
+ type: "core::starknet::contract_address::ContractAddress",
26103
+ kind: "key"
26104
+ },
26105
+ {
26106
+ name: "pool_id",
26107
+ type: "core::felt252",
26108
+ kind: "key"
26109
+ },
26110
+ {
26111
+ name: "collateral_asset",
26112
+ type: "core::starknet::contract_address::ContractAddress",
26113
+ kind: "key"
26114
+ }
26115
+ ]
26116
+ },
26117
+ {
26118
+ type: "event",
26119
+ name: "vesu::extension::components::tokenization::tokenization_component::Event",
26120
+ kind: "enum",
26121
+ variants: [
26122
+ {
26123
+ name: "CreateVToken",
26124
+ type: "vesu::extension::components::tokenization::tokenization_component::CreateVToken",
26125
+ kind: "nested"
26126
+ }
26127
+ ]
26128
+ },
26129
+ {
26130
+ type: "event",
26131
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetAssetParameter",
26132
+ kind: "struct",
26133
+ members: [
26134
+ {
26135
+ name: "pool_id",
26136
+ type: "core::felt252",
26137
+ kind: "key"
26138
+ },
26139
+ {
26140
+ name: "asset",
26141
+ type: "core::starknet::contract_address::ContractAddress",
26142
+ kind: "key"
26143
+ },
26144
+ {
26145
+ name: "parameter",
26146
+ type: "core::felt252",
26147
+ kind: "key"
26148
+ },
26149
+ {
26150
+ name: "value",
26151
+ type: "core::integer::u256",
26152
+ kind: "data"
26153
+ }
26154
+ ]
26155
+ },
26156
+ {
26157
+ type: "event",
26158
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetPoolOwner",
26159
+ kind: "struct",
26160
+ members: [
26161
+ {
26162
+ name: "pool_id",
26163
+ type: "core::felt252",
26164
+ kind: "key"
26165
+ },
26166
+ {
26167
+ name: "owner",
26168
+ type: "core::starknet::contract_address::ContractAddress",
26169
+ kind: "key"
26170
+ }
26171
+ ]
26172
+ },
26173
+ {
26174
+ type: "event",
26175
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::ContractUpgraded",
26176
+ kind: "struct",
26177
+ members: [
26178
+ {
26179
+ name: "new_implementation",
26180
+ type: "core::starknet::class_hash::ClassHash",
26181
+ kind: "data"
26182
+ }
26183
+ ]
26184
+ },
26185
+ {
26186
+ type: "event",
26187
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::Event",
26188
+ kind: "enum",
26189
+ variants: [
26190
+ {
26191
+ name: "PositionHooksEvents",
26192
+ type: "vesu::extension::components::position_hooks::position_hooks_component::Event",
26193
+ kind: "nested"
26194
+ },
26195
+ {
26196
+ name: "InterestRateModelEvents",
26197
+ type: "vesu::extension::components::interest_rate_model::interest_rate_model_component::Event",
26198
+ kind: "nested"
26199
+ },
26200
+ {
26201
+ name: "PragmaOracleEvents",
26202
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::Event",
26203
+ kind: "nested"
26204
+ },
26205
+ {
26206
+ name: "MapListEvents",
26207
+ type: "vesu::map_list::map_list_component::Event",
26208
+ kind: "nested"
26209
+ },
26210
+ {
26211
+ name: "FeeModelEvents",
26212
+ type: "vesu::extension::components::fee_model::fee_model_component::Event",
26213
+ kind: "nested"
26214
+ },
26215
+ {
26216
+ name: "TokenizationEvents",
26217
+ type: "vesu::extension::components::tokenization::tokenization_component::Event",
26218
+ kind: "nested"
26219
+ },
26220
+ {
26221
+ name: "SetAssetParameter",
26222
+ type: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetAssetParameter",
26223
+ kind: "nested"
26224
+ },
26225
+ {
26226
+ name: "SetPoolOwner",
26227
+ type: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetPoolOwner",
26228
+ kind: "nested"
26229
+ },
26230
+ {
26231
+ name: "CreateVToken",
26232
+ type: "vesu::extension::components::tokenization::tokenization_component::CreateVToken",
26233
+ kind: "nested"
26234
+ },
26235
+ {
26236
+ name: "SetInterestRateConfig",
26237
+ type: "vesu::extension::components::interest_rate_model::interest_rate_model_component::SetInterestRateConfig",
26238
+ kind: "nested"
26239
+ },
26240
+ {
26241
+ name: "SetOracleConfig",
26242
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleConfig",
26243
+ kind: "nested"
26244
+ },
26245
+ {
26246
+ name: "SetLiquidationConfig",
26247
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetLiquidationConfig",
26248
+ kind: "nested"
26249
+ },
26250
+ {
26251
+ name: "SetDebtCap",
26252
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetDebtCap",
26253
+ kind: "nested"
26254
+ },
26255
+ {
26256
+ name: "SetShutdownLTVConfig",
26257
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownLTVConfig",
26258
+ kind: "nested"
26259
+ },
26260
+ {
26261
+ name: "ContractUpgraded",
26262
+ type: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::ContractUpgraded",
26263
+ kind: "nested"
26264
+ }
26265
+ ]
26266
+ }
26267
+ ];
26268
+
23824
26269
  // src/strategies/universal-adapters/vesu-adapter.ts
23825
26270
  var VesuAmountType = /* @__PURE__ */ ((VesuAmountType2) => {
23826
26271
  VesuAmountType2[VesuAmountType2["Delta"] = 0] = "Delta";
@@ -23832,6 +26277,9 @@ var VesuAmountDenomination = /* @__PURE__ */ ((VesuAmountDenomination2) => {
23832
26277
  VesuAmountDenomination2[VesuAmountDenomination2["Assets"] = 1] = "Assets";
23833
26278
  return VesuAmountDenomination2;
23834
26279
  })(VesuAmountDenomination || {});
26280
+ var SCALE = BigInt(1e18);
26281
+ var UTILIZATION_SCALE = 100000n;
26282
+ var UTILIZATION_SCALE_TO_SCALE = BigInt(1e13);
23835
26283
  function getVesuMultiplyParams(isIncrease, params) {
23836
26284
  if (isIncrease) {
23837
26285
  const _params2 = params;
@@ -23937,6 +26385,8 @@ var VesuPools = {
23937
26385
  Re7xSTRK: ContractAddr.from("0x052fb52363939c3aa848f8f4ac28f0a51379f8d1b971d8444de25fbd77d8f161"),
23938
26386
  Re7xBTC: ContractAddr.from("0x3a8416bf20d036df5b1cf3447630a2e1cb04685f6b0c3a70ed7fb1473548ecf")
23939
26387
  };
26388
+ var extensionMap = {};
26389
+ extensionMap[VesuPools.Re7xSTRK.address] = ContractAddr.from("0x04e06e04b8d624d039aa1c3ca8e0aa9e21dc1ccba1d88d0d650837159e0ee054");
23940
26390
  function getVesuSingletonAddress(vesuPool) {
23941
26391
  if (vesuPool.eq(VesuPools.Genesis) || vesuPool.eq(VesuPools.Re7xSTRK)) {
23942
26392
  return { addr: VESU_SINGLETON, isV2: false };
@@ -24200,6 +26650,61 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24200
26650
  isV2
24201
26651
  };
24202
26652
  }
26653
+ async getDebtCap(config) {
26654
+ const { contract, isV2 } = await this.getVesuSingletonContract(config, this.config.poolId);
26655
+ if (!isV2) {
26656
+ const extensionAddr = extensionMap[this.config.poolId.address];
26657
+ if (!extensionAddr) {
26658
+ throw new Error("Extension address not found");
26659
+ }
26660
+ const extensionContract = new Contract8({ abi: vesu_extension_abi_default, address: extensionAddr.address, providerOrAccount: config.provider });
26661
+ const output2 = await extensionContract.call("debt_caps", [this.config.poolId.address, this.config.collateral.address.address, this.config.debt.address.address]);
26662
+ logger.verbose(`${this.config.debt.symbol}::VesuAdapter::getDebtCap debt_cap: ${output2.toString()}`);
26663
+ return Web3Number.fromWei(output2.toString(), this.config.debt.decimals);
26664
+ }
26665
+ const output = await contract.call("pair_config", [this.config.collateral.address.address, this.config.debt.address.address]);
26666
+ logger.verbose(`${this.config.debt.symbol}::VesuAdapter::getDebtCap debt_cap: ${output.debt_cap.toString()}`);
26667
+ return Web3Number.fromWei(output.debt_cap.toString(), this.config.debt.decimals);
26668
+ }
26669
+ async getMaxBorrowableByInterestRate(config, asset, maxBorrowAPY) {
26670
+ const { contract, isV2 } = await this.getVesuSingletonContract(config, this.config.poolId);
26671
+ let interestRateConfigContract = contract;
26672
+ if (!isV2) {
26673
+ const extensionAddr = extensionMap[this.config.poolId.address];
26674
+ if (!extensionAddr) {
26675
+ throw new Error("Extension address not found");
26676
+ }
26677
+ interestRateConfigContract = new Contract8({ abi: vesu_extension_abi_default, address: extensionAddr.address, providerOrAccount: config.provider });
26678
+ }
26679
+ const _interestRateConfig = await interestRateConfigContract.call(
26680
+ "interest_rate_config",
26681
+ isV2 ? [this.config.debt.address.address] : [this.config.poolId.address, this.config.debt.address.address]
26682
+ );
26683
+ const interestRateConfig = {
26684
+ target_utilization: _interestRateConfig.target_utilization,
26685
+ zero_utilization_rate: _interestRateConfig.zero_utilization_rate,
26686
+ target_rate_percent: _interestRateConfig.target_rate_percent,
26687
+ min_target_utilization: _interestRateConfig.min_target_utilization,
26688
+ max_target_utilization: _interestRateConfig.max_target_utilization,
26689
+ rate_half_life: _interestRateConfig.rate_half_life,
26690
+ min_full_utilization_rate: _interestRateConfig.min_full_utilization_rate,
26691
+ max_full_utilization_rate: _interestRateConfig.max_full_utilization_rate
26692
+ };
26693
+ const _assetConfig = await contract.call(
26694
+ isV2 ? "asset_config" : "asset_config_unsafe",
26695
+ isV2 ? [asset.address.address] : [this.config.poolId.address, asset.address.address]
26696
+ );
26697
+ const assetConfig = isV2 ? _assetConfig : _assetConfig["0"];
26698
+ const timeDelta = assetConfig.last_updated;
26699
+ const lastFullUtilizationRate = assetConfig.last_full_utilization_rate;
26700
+ const totalSupply = new Web3Number((Number(assetConfig.total_nominal_debt) / 1e18).toFixed(9), asset.decimals).plus(Web3Number.fromWei(assetConfig.reserve, asset.decimals));
26701
+ const ratePerSecond = BigInt(Math.round(maxBorrowAPY / 365 / 24 / 60 / 60 * Number(SCALE)));
26702
+ const maxUtilisation = this.getMaxUtilizationGivenRatePerSecond(interestRateConfig, ratePerSecond, timeDelta, lastFullUtilizationRate);
26703
+ logger.verbose(`${asset.symbol}::VesuAdapter::getMaxBorrowableByInterestRate maxUtilisation: ${Number(maxUtilisation) / 1e18}, totalSupply: ${totalSupply.toString()}`);
26704
+ const maxDebtToHave = totalSupply.multipliedBy(Number(maxUtilisation) / 1e18);
26705
+ const currentDebt = new Web3Number((Number(assetConfig.total_nominal_debt) / 1e18).toFixed(9), asset.decimals);
26706
+ return maxDebtToHave.minus(currentDebt);
26707
+ }
24203
26708
  async getLTVConfig(config) {
24204
26709
  const CACHE_KEY = "ltv_config";
24205
26710
  const cacheData = this.getCache(CACHE_KEY);
@@ -24215,6 +26720,9 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24215
26720
  const output = await contract.call("ltv_config", [this.config.poolId.address, this.config.collateral.address.address, this.config.debt.address.address]);
24216
26721
  ltv = Number(output.max_ltv) / 1e18;
24217
26722
  }
26723
+ if (ltv == 0) {
26724
+ throw new Error("LTV is 0");
26725
+ }
24218
26726
  this.setCache(CACHE_KEY, ltv, 3e5);
24219
26727
  return this.getCache(CACHE_KEY);
24220
26728
  }
@@ -24349,6 +26857,78 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24349
26857
  Global.setGlobalCache(CACHE_KEY, { pools, isErrorPoolsAPI }, 3e5);
24350
26858
  return { pools, isErrorPoolsAPI };
24351
26859
  }
26860
+ fullUtilizationRate(interestRateConfig, timeDelta, utilization, fullUtilizationRate) {
26861
+ const {
26862
+ min_target_utilization,
26863
+ max_target_utilization,
26864
+ rate_half_life,
26865
+ min_full_utilization_rate,
26866
+ max_full_utilization_rate
26867
+ } = interestRateConfig;
26868
+ const halfLifeScaled = rate_half_life * SCALE;
26869
+ let nextFullUtilizationRate;
26870
+ if (utilization < min_target_utilization) {
26871
+ const utilizationDelta = (min_target_utilization - utilization) * SCALE / min_target_utilization;
26872
+ const decay = halfLifeScaled + utilizationDelta * timeDelta;
26873
+ nextFullUtilizationRate = fullUtilizationRate * halfLifeScaled / decay;
26874
+ } else if (utilization > max_target_utilization) {
26875
+ const utilizationDelta = (utilization - max_target_utilization) * SCALE / (UTILIZATION_SCALE - max_target_utilization);
26876
+ const growth = halfLifeScaled + utilizationDelta * timeDelta;
26877
+ nextFullUtilizationRate = fullUtilizationRate * growth / halfLifeScaled;
26878
+ } else {
26879
+ nextFullUtilizationRate = fullUtilizationRate;
26880
+ }
26881
+ if (nextFullUtilizationRate > max_full_utilization_rate) {
26882
+ return max_full_utilization_rate;
26883
+ } else if (nextFullUtilizationRate < min_full_utilization_rate) {
26884
+ return min_full_utilization_rate;
26885
+ } else {
26886
+ return nextFullUtilizationRate;
26887
+ }
26888
+ }
26889
+ /**
26890
+ * Calculates new interest rate per second and next full utilization rate.
26891
+ */
26892
+ calculateInterestRate(interestRateConfig, utilization, timeDelta, lastFullUtilizationRate) {
26893
+ const scaledUtilization = utilization / UTILIZATION_SCALE_TO_SCALE;
26894
+ const {
26895
+ target_utilization,
26896
+ zero_utilization_rate,
26897
+ target_rate_percent
26898
+ } = interestRateConfig;
26899
+ const nextFullUtilizationRate = this.fullUtilizationRate(
26900
+ interestRateConfig,
26901
+ timeDelta,
26902
+ scaledUtilization,
26903
+ lastFullUtilizationRate
26904
+ );
26905
+ const targetRate = (nextFullUtilizationRate - zero_utilization_rate) * target_rate_percent / SCALE + zero_utilization_rate;
26906
+ let newRatePerSecond;
26907
+ if (scaledUtilization < target_utilization) {
26908
+ newRatePerSecond = zero_utilization_rate + scaledUtilization * (targetRate - zero_utilization_rate) / target_utilization;
26909
+ } else {
26910
+ newRatePerSecond = targetRate + (scaledUtilization - target_utilization) * (nextFullUtilizationRate - targetRate) / (UTILIZATION_SCALE - target_utilization);
26911
+ }
26912
+ return { newRatePerSecond, nextFullUtilizationRate };
26913
+ }
26914
+ /**
26915
+ * Calculates utilization given a specific rate per second.
26916
+ * This is an inverse function of the piecewise interest rate formula above.
26917
+ */
26918
+ getMaxUtilizationGivenRatePerSecond(interestRateConfig, ratePerSecond, timeDelta, last_full_utilization_rate) {
26919
+ logger.verbose(`VesuAdapter::getMaxUtilizationGivenRatePerSecond ratePerSecond: ${Number(ratePerSecond) / 1e18}, timeDelta: ${Number(timeDelta) / 1e18}, last_full_utilization_rate: ${Number(last_full_utilization_rate) / 1e18}`);
26920
+ let utilization = 0n;
26921
+ let nextUtilization = SCALE / 100n;
26922
+ while (utilization <= SCALE) {
26923
+ logger.verbose(`VesuAdapter::getMaxUtilizationGivenRatePerSecond utilization: ${Number(utilization) / 1e18}, nextUtilization: ${Number(nextUtilization) / 1e18}`);
26924
+ const { newRatePerSecond } = this.calculateInterestRate(interestRateConfig, utilization, timeDelta, last_full_utilization_rate);
26925
+ if (newRatePerSecond > ratePerSecond) {
26926
+ return utilization;
26927
+ }
26928
+ utilization += nextUtilization;
26929
+ }
26930
+ throw new Error("Max utilization not found");
26931
+ }
24352
26932
  };
24353
26933
 
24354
26934
  // src/strategies/universal-strategy.tsx
@@ -26685,21 +29265,7 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
26685
29265
  usdValue
26686
29266
  };
26687
29267
  }
26688
- /**
26689
- * Calculates the weighted average APY across all pools based on USD value.
26690
- * @returns {Promise<number>} The weighted average APY across all pools
26691
- */
26692
- async netAPY() {
26693
- if (this.metadata.isPreview) {
26694
- return { net: 0, splits: [{
26695
- apy: 0,
26696
- id: "base"
26697
- }, {
26698
- apy: 0,
26699
- id: "defispring"
26700
- }] };
26701
- }
26702
- const prevAUM = await this.getPrevAUM();
29268
+ async getVesuAPYs() {
26703
29269
  const vesuAdapters = this.getVesuAdapters();
26704
29270
  const allVesuPools = await VesuAdapter.getVesuPools();
26705
29271
  const pools = vesuAdapters.map((vesuAdapter) => {
@@ -26727,7 +29293,18 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
26727
29293
  logger.verbose(`${this.metadata.name}::netAPY: baseAPYs: ${JSON.stringify(baseAPYs)}`);
26728
29294
  logger.verbose(`${this.metadata.name}::netAPY: rewardAPYs: ${JSON.stringify(rewardAPYs)}`);
26729
29295
  assert(baseAPYs.length == positions.length, "APYs and positions length mismatch");
26730
- if (positions.every((p) => p.amount.isZero())) {
29296
+ return {
29297
+ baseAPYs,
29298
+ rewardAPYs,
29299
+ positions
29300
+ };
29301
+ }
29302
+ /**
29303
+ * Calculates the weighted average APY across all pools based on USD value.
29304
+ * @returns {Promise<number>} The weighted average APY across all pools
29305
+ */
29306
+ async netAPY() {
29307
+ if (this.metadata.isPreview) {
26731
29308
  return { net: 0, splits: [{
26732
29309
  apy: 0,
26733
29310
  id: "base"
@@ -26736,11 +29313,25 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
26736
29313
  id: "defispring"
26737
29314
  }] };
26738
29315
  }
29316
+ const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
26739
29317
  const unusedBalanceAPY = await this.getUnusedBalanceAPY();
26740
29318
  baseAPYs.push(...[unusedBalanceAPY.apy]);
26741
29319
  rewardAPYs.push(0);
26742
29320
  const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
26743
29321
  weights.push(unusedBalanceAPY.weight);
29322
+ return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
29323
+ }
29324
+ async returnNetAPY(baseAPYs, rewardAPYs, weights) {
29325
+ if (weights.every((p) => p == 0)) {
29326
+ return { net: 0, splits: [{
29327
+ apy: 0,
29328
+ id: "base"
29329
+ }, {
29330
+ apy: 0,
29331
+ id: "defispring"
29332
+ }] };
29333
+ }
29334
+ const prevAUM = await this.getPrevAUM();
26744
29335
  const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
26745
29336
  const prevAUMUSD = prevAUM.multipliedBy(price.price);
26746
29337
  const baseAPY = this.computeAPY(baseAPYs, weights, prevAUMUSD);
@@ -27578,13 +30169,31 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27578
30169
  getTag() {
27579
30170
  return `${_UniversalLstMultiplierStrategy.name}:${this.metadata.name}`;
27580
30171
  }
30172
+ // Vesu adapter with LST and base token match
30173
+ getVesuSameTokenAdapter() {
30174
+ const baseAdapter = this.getAdapter("vesu_leg1_adapter" /* VESU_LEG1 */);
30175
+ baseAdapter.networkConfig = this.config;
30176
+ baseAdapter.pricer = this.pricer;
30177
+ return baseAdapter;
30178
+ }
27581
30179
  // only one leg is used
27582
30180
  // todo support lending assets of underlying as well (like if xSTRK looping is not viable, simply supply STRK)
27583
30181
  getVesuAdapters() {
27584
- const vesuAdapter1 = this.getAdapter("vesu_leg1_adapter" /* VESU_LEG1 */);
27585
- vesuAdapter1.pricer = this.pricer;
27586
- vesuAdapter1.networkConfig = this.config;
27587
- return [vesuAdapter1];
30182
+ const adapters = [];
30183
+ const baseAdapter = this.getVesuSameTokenAdapter();
30184
+ for (const asset of this.metadata.additionalInfo.borrowable_assets) {
30185
+ const vesuAdapter1 = new VesuAdapter({
30186
+ poolId: baseAdapter.config.poolId,
30187
+ collateral: this.asset(),
30188
+ debt: asset,
30189
+ vaultAllocator: this.metadata.additionalInfo.vaultAllocator,
30190
+ id: ""
30191
+ });
30192
+ vesuAdapter1.pricer = this.pricer;
30193
+ vesuAdapter1.networkConfig = this.config;
30194
+ adapters.push(vesuAdapter1);
30195
+ }
30196
+ return adapters;
27588
30197
  }
27589
30198
  // not applicable for this strategy
27590
30199
  // No rewards on collateral or borrowing of LST assets
@@ -27612,7 +30221,8 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27612
30221
  async getAvnuSwapMultiplyCall(params) {
27613
30222
  return this._getAvnuDepositSwapLegCall({
27614
30223
  ...params,
27615
- minHF: 1.02
30224
+ minHF: 1.1
30225
+ // undo
27616
30226
  });
27617
30227
  }
27618
30228
  async _getAvnuDepositSwapLegCall(params) {
@@ -27635,6 +30245,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27635
30245
  const totalDebtAmount = totalCollateral.multipliedBy(collateralPrice).multipliedBy(legLTV).dividedBy(debtPrice).dividedBy(params.minHF);
27636
30246
  logger.verbose(`${this.getTag()}::_getAvnuDepositSwapLegCall totalDebtAmount: ${totalDebtAmount}`);
27637
30247
  const debtAmount = totalDebtAmount.minus(existingDebtInfo.amount);
30248
+ logger.verbose(`${this.getTag()}::_getAvnuDepositSwapLegCall debtAmount: ${debtAmount}`);
27638
30249
  if (debtAmount.lt(0)) {
27639
30250
  const lstDEXPrice = await this.getLSTDexPrice();
27640
30251
  const debtAmountInLST = debtAmount.abs().dividedBy(lstDEXPrice);
@@ -27642,10 +30253,9 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27642
30253
  isDeposit: false,
27643
30254
  leg1DepositAmount: debtAmountInLST
27644
30255
  });
27645
- assert(calls.length == 1, "Expected 1 call for unwind");
30256
+ assert(calls.length == 1, `Expected 1 call for unwind, got ${calls.length}`);
27646
30257
  return calls[0];
27647
30258
  }
27648
- logger.verbose(`${this.getTag()}::_getAvnuDepositSwapLegCall debtAmount: ${debtAmount}`);
27649
30259
  const STEP0 = "approve_token1" /* APPROVE_TOKEN1 */;
27650
30260
  const manage0Info = this.getProofs(STEP0);
27651
30261
  const manageCall0 = manage0Info.callConstructor({
@@ -27750,10 +30360,32 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27750
30360
  return { shouldRebalance: false, manageCall: void 0 };
27751
30361
  }
27752
30362
  }
30363
+ async getVesuAUM(adapter) {
30364
+ const legAUM = await adapter.getPositions(this.config);
30365
+ const underlying = this.asset();
30366
+ assert(underlying.symbol.startsWith("x"), "Underlying is not an LST of Endur");
30367
+ let vesuAum = Web3Number.fromWei("0", underlying.decimals);
30368
+ let tokenUnderlyingPrice = await this.getLSTExchangeRate();
30369
+ tokenUnderlyingPrice = tokenUnderlyingPrice * 0.998;
30370
+ logger.verbose(`${this.getTag()} tokenUnderlyingPrice: ${tokenUnderlyingPrice}`);
30371
+ if (legAUM[0].token.address.eq(underlying.address)) {
30372
+ vesuAum = vesuAum.plus(legAUM[0].amount);
30373
+ } else {
30374
+ vesuAum = vesuAum.plus(legAUM[0].amount.dividedBy(tokenUnderlyingPrice));
30375
+ }
30376
+ if (legAUM[1].token.address.eq(underlying.address)) {
30377
+ vesuAum = vesuAum.minus(legAUM[1].amount);
30378
+ } else {
30379
+ vesuAum = vesuAum.minus(legAUM[1].amount.dividedBy(tokenUnderlyingPrice));
30380
+ }
30381
+ ;
30382
+ logger.verbose(`${this.getTag()} Vesu AUM: ${vesuAum}, legCollateral: ${legAUM[0].amount.toNumber()}, legDebt: ${legAUM[1].amount.toNumber()}`);
30383
+ return vesuAum;
30384
+ }
27753
30385
  //
27754
30386
  async _getMinOutputAmountLSTBuy(amountInUnderlying) {
27755
30387
  const lstTruePrice = await this.getLSTExchangeRate();
27756
- const minOutputAmount = amountInUnderlying.dividedBy(lstTruePrice);
30388
+ const minOutputAmount = amountInUnderlying.dividedBy(lstTruePrice).multipliedBy(0.99979);
27757
30389
  return minOutputAmount;
27758
30390
  }
27759
30391
  async _getMinOutputAmountLSTSell(amountInLST) {
@@ -27772,6 +30404,10 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27772
30404
  const [vesuAdapter1] = this.getVesuAdapters();
27773
30405
  const legLTV = await vesuAdapter1.getLTVConfig(this.config);
27774
30406
  logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
30407
+ if (!params.isDeposit) {
30408
+ const unusedBalance = await this.getUnusedBalance();
30409
+ logger.verbose(`${this.getTag()}::getVesuMultiplyCall unusedBalance: ${unusedBalance.amount.toString()}, required: ${params.leg1DepositAmount.toString()}`);
30410
+ }
27775
30411
  const existingPositions = await vesuAdapter1.getPositions(this.config);
27776
30412
  const collateralisation = await vesuAdapter1.getCollateralization(this.config);
27777
30413
  const existingCollateralInfo = existingPositions[0];
@@ -27804,16 +30440,34 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27804
30440
  });
27805
30441
  }
27806
30442
  getLSTUnderlyingTokenInfo() {
27807
- const [vesuAdapter1] = this.getVesuAdapters();
30443
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
27808
30444
  return vesuAdapter1.config.debt;
27809
30445
  }
30446
+ async getMaxBorrowableAmount() {
30447
+ const vesuAdapters = this.getVesuAdapters();
30448
+ let netMaxBorrowableAmount = Web3Number.fromWei("0", this.getLSTUnderlyingTokenInfo().decimals);
30449
+ const maxBorrowables = [];
30450
+ const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
30451
+ const maxInterestRate = lstAPY * 0.8;
30452
+ for (const vesuAdapter of vesuAdapters) {
30453
+ const maxBorrowableAmount = await vesuAdapter.getMaxBorrowableByInterestRate(this.config, vesuAdapter.config.debt, maxInterestRate);
30454
+ const debtCap = await vesuAdapter.getDebtCap(this.config);
30455
+ maxBorrowables.push({ amount: maxBorrowableAmount.minimum(debtCap), borrowableAsset: vesuAdapter.config.debt });
30456
+ }
30457
+ maxBorrowables.sort((a, b) => b.amount.toNumber() - a.amount.toNumber());
30458
+ netMaxBorrowableAmount = maxBorrowables.reduce((acc, curr) => acc.plus(curr.amount), Web3Number.fromWei("0", this.getLSTUnderlyingTokenInfo().decimals));
30459
+ return { netMaxBorrowableAmount, maxBorrowables };
30460
+ }
30461
+ // todo how much to unwind to get back healthy APY zone again
30462
+ // if net APY < LST APR + 0.5%, we need to unwind to get back to LST APR + 1% atleast or 0 vesu position
30463
+ // For xSTRK, simply deposit in Vesu if looping is not viable
27810
30464
  /**
27811
30465
  * Gets LST APR for the strategy's underlying asset from Endur API
27812
30466
  * @returns Promise<number> The LST APR (not divided by 1e18)
27813
30467
  */
27814
30468
  async getLSTAPR(_address) {
27815
30469
  try {
27816
- const vesuAdapter1 = this.getVesuAdapters()[0];
30470
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
27817
30471
  const apr = await LSTAPRService.getLSTAPR(vesuAdapter1.config.debt.address);
27818
30472
  if (!apr) {
27819
30473
  throw new Error("Failed to get LST APR");
@@ -27826,21 +30480,41 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27826
30480
  }
27827
30481
  // todo undo this
27828
30482
  async netAPY() {
27829
- const { net, splits } = await super.netAPY();
27830
- let _net = net;
27831
- if (this.asset().symbol == "xWBTC") {
27832
- const debtToken = this.getVesuAdapters()[0].config.debt;
27833
- const lstAPY = await this.getLSTAPR(debtToken.address);
27834
- _net = lstAPY * 5;
30483
+ const unusedBalance = await this.getUnusedBalance();
30484
+ const maxNewDeposits = await this.maxNewDeposits();
30485
+ if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
30486
+ return super.netAPY();
30487
+ } else {
30488
+ const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
30489
+ const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
30490
+ return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
27835
30491
  }
27836
- return {
27837
- net: _net,
27838
- splits
27839
- };
27840
30492
  }
30493
+ async maxNewDeposits() {
30494
+ const maxBorrowableAmounts = await this.getMaxBorrowableAmount();
30495
+ let ltv = void 0;
30496
+ for (let adapter of this.getVesuAdapters()) {
30497
+ const maxBorrowableAmount = maxBorrowableAmounts.maxBorrowables.find((b) => b.borrowableAsset.address.eq(adapter.config.debt.address))?.amount;
30498
+ if (!maxBorrowableAmount) {
30499
+ throw new Error(`Max borrowable amount not found for adapter: ${adapter.config.debt.symbol}`);
30500
+ }
30501
+ const maxLTV = await adapter.getLTVConfig(this.config);
30502
+ if (!ltv) {
30503
+ ltv = maxLTV;
30504
+ } else if (ltv != maxLTV) {
30505
+ throw new Error(`LTV mismatch for adapter: ${adapter.config.debt.symbol}`);
30506
+ }
30507
+ }
30508
+ if (!ltv) {
30509
+ throw new Error("LTV not found");
30510
+ }
30511
+ const numerator = this.metadata.additionalInfo.targetHealthFactor * maxBorrowableAmounts.netMaxBorrowableAmount.toNumber() / ltv;
30512
+ return numerator - maxBorrowableAmounts.netMaxBorrowableAmount.toNumber();
30513
+ }
30514
+ // todo revisit cases where 0th adapters is used
27841
30515
  async getUnusedBalanceAPY() {
27842
30516
  const unusedBalance = await this.getUnusedBalance();
27843
- const vesuAdapter = this.getVesuAdapters()[0];
30517
+ const vesuAdapter = this.getVesuSameTokenAdapter();
27844
30518
  const underlying = vesuAdapter.config.debt;
27845
30519
  const lstAPY = await this.getLSTAPR(underlying.address);
27846
30520
  return {
@@ -27849,7 +30523,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27849
30523
  };
27850
30524
  }
27851
30525
  async getLSTExchangeRate() {
27852
- const [vesuAdapter1] = this.getVesuAdapters();
30526
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
27853
30527
  const lstTokenInfo = vesuAdapter1.config.collateral;
27854
30528
  const lstABI = new Contract10({
27855
30529
  abi: erc4626_abi_default,
@@ -27868,7 +30542,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27868
30542
  async getModifyLeverCall(params) {
27869
30543
  logger.verbose(`${this.getTag()}::getModifyLeverCall marginAmount: ${params.marginAmount}, debtAmount: ${params.debtAmount}, lstDexPriceInUnderlying: ${params.lstDexPriceInUnderlying}, isIncrease: ${params.isIncrease}`);
27870
30544
  assert(!params.marginAmount.isZero() || !params.debtAmount.isZero(), "Deposit/debt must be non-0");
27871
- const [vesuAdapter1] = this.getVesuAdapters();
30545
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
27872
30546
  const lstTokenInfo = this.asset();
27873
30547
  const lstUnderlyingTokenInfo = vesuAdapter1.config.debt;
27874
30548
  const maxAmounts = lstTokenInfo.symbol == "xSTRK" ? 5e5 : 0.5;
@@ -28105,6 +30779,12 @@ var _riskFactor4 = [
28105
30779
  { 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." },
28106
30780
  { type: "Depeg Risk" /* DEPEG_RISK */, value: 2 /* GENERALLY_STABLE */, weight: 25, reason: "Generally stable pegged assets" }
28107
30781
  ];
30782
+ var borrowableAssets = [
30783
+ "WBTC",
30784
+ "tBTC",
30785
+ "LBTC",
30786
+ "solvBTC"
30787
+ ];
28108
30788
  var hyperxSTRK = {
28109
30789
  vaultAddress: ContractAddr.from("0x46c7a54c82b1fe374353859f554a40b8bd31d3e30f742901579e7b57b1b5960"),
28110
30790
  manager: ContractAddr.from("0x5d499cd333757f461a0bedaca3dfc4d77320c773037e0aa299f22a6dbfdc03a"),
@@ -28114,7 +30794,8 @@ var hyperxSTRK = {
28114
30794
  leafAdapters: [],
28115
30795
  adapters: [],
28116
30796
  targetHealthFactor: 1.1,
28117
- minHealthFactor: 1.05
30797
+ minHealthFactor: 1.05,
30798
+ borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "STRK")
28118
30799
  };
28119
30800
  var hyperxWBTC = {
28120
30801
  vaultAddress: ContractAddr.from("0x2da9d0f96a46b453f55604313785dc866424240b1c6811d13bef594343db818"),
@@ -28125,7 +30806,8 @@ var hyperxWBTC = {
28125
30806
  leafAdapters: [],
28126
30807
  adapters: [],
28127
30808
  targetHealthFactor: 1.1,
28128
- minHealthFactor: 1.05
30809
+ minHealthFactor: 1.05,
30810
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
28129
30811
  };
28130
30812
  var hyperxtBTC = {
28131
30813
  vaultAddress: ContractAddr.from("0x47d5f68477e5637ce0e56436c6b5eee5a354e6828995dae106b11a48679328"),
@@ -28136,7 +30818,8 @@ var hyperxtBTC = {
28136
30818
  leafAdapters: [],
28137
30819
  adapters: [],
28138
30820
  targetHealthFactor: 1.1,
28139
- minHealthFactor: 1.05
30821
+ minHealthFactor: 1.05,
30822
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
28140
30823
  };
28141
30824
  var hyperxsBTC = {
28142
30825
  vaultAddress: ContractAddr.from("0x437ef1e7d0f100b2e070b7a65cafec0b2be31b0290776da8b4112f5473d8d9"),
@@ -28147,7 +30830,8 @@ var hyperxsBTC = {
28147
30830
  leafAdapters: [],
28148
30831
  adapters: [],
28149
30832
  targetHealthFactor: 1.1,
28150
- minHealthFactor: 1.05
30833
+ minHealthFactor: 1.05,
30834
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
28151
30835
  };
28152
30836
  var hyperxLBTC = {
28153
30837
  vaultAddress: ContractAddr.from("0x64cf24d4883fe569926419a0569ab34497c6956a1a308fa883257f7486d7030"),
@@ -28158,7 +30842,8 @@ var hyperxLBTC = {
28158
30842
  leafAdapters: [],
28159
30843
  adapters: [],
28160
30844
  targetHealthFactor: 1.1,
28161
- minHealthFactor: 1.05
30845
+ minHealthFactor: 1.05,
30846
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
28162
30847
  };
28163
30848
  function getInvestmentSteps(lstSymbol, underlyingSymbol) {
28164
30849
  return [
@@ -28189,7 +30874,8 @@ function getStrategySettings(lstSymbol, underlyingSymbol, addresses, isPreview =
28189
30874
  contractDetails: getContractDetails(addresses),
28190
30875
  faqs: getFAQs2(lstSymbol, underlyingSymbol),
28191
30876
  investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
28192
- isPreview
30877
+ isPreview,
30878
+ apyMethodology: "Current annualized APY in terms of base asset of the LST"
28193
30879
  };
28194
30880
  }
28195
30881
  var HyperLSTStrategies = [
@@ -28916,6 +31602,7 @@ export {
28916
31602
  Web3Number,
28917
31603
  ZkLend,
28918
31604
  assert,
31605
+ extensionMap,
28919
31606
  getAPIUsingHeadlessBrowser,
28920
31607
  getContractDetails,
28921
31608
  getDefaultStoreConfig,