@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.
@@ -23923,6 +23923,2451 @@ var vesu_pool_v2_abi_default = [
23923
23923
  }
23924
23924
  ];
23925
23925
 
23926
+ // src/data/vesu-extension.abi.json
23927
+ var vesu_extension_abi_default = [
23928
+ {
23929
+ type: "impl",
23930
+ name: "DefaultExtensionPOV2Impl",
23931
+ interface_name: "vesu::v2::default_extension_po_v2::IDefaultExtensionPOV2"
23932
+ },
23933
+ {
23934
+ type: "enum",
23935
+ name: "vesu::vendor::pragma::AggregationMode",
23936
+ variants: [
23937
+ {
23938
+ name: "Median",
23939
+ type: "()"
23940
+ },
23941
+ {
23942
+ name: "Mean",
23943
+ type: "()"
23944
+ },
23945
+ {
23946
+ name: "Error",
23947
+ type: "()"
23948
+ }
23949
+ ]
23950
+ },
23951
+ {
23952
+ type: "struct",
23953
+ name: "vesu::extension::components::pragma_oracle::OracleConfig",
23954
+ members: [
23955
+ {
23956
+ name: "pragma_key",
23957
+ type: "core::felt252"
23958
+ },
23959
+ {
23960
+ name: "timeout",
23961
+ type: "core::integer::u64"
23962
+ },
23963
+ {
23964
+ name: "number_of_sources",
23965
+ type: "core::integer::u32"
23966
+ },
23967
+ {
23968
+ name: "start_time_offset",
23969
+ type: "core::integer::u64"
23970
+ },
23971
+ {
23972
+ name: "time_window",
23973
+ type: "core::integer::u64"
23974
+ },
23975
+ {
23976
+ name: "aggregation_mode",
23977
+ type: "vesu::vendor::pragma::AggregationMode"
23978
+ }
23979
+ ]
23980
+ },
23981
+ {
23982
+ type: "struct",
23983
+ name: "vesu::extension::components::fee_model::FeeConfig",
23984
+ members: [
23985
+ {
23986
+ name: "fee_recipient",
23987
+ type: "core::starknet::contract_address::ContractAddress"
23988
+ }
23989
+ ]
23990
+ },
23991
+ {
23992
+ type: "struct",
23993
+ name: "core::integer::u256",
23994
+ members: [
23995
+ {
23996
+ name: "low",
23997
+ type: "core::integer::u128"
23998
+ },
23999
+ {
24000
+ name: "high",
24001
+ type: "core::integer::u128"
24002
+ }
24003
+ ]
24004
+ },
24005
+ {
24006
+ type: "struct",
24007
+ name: "vesu::extension::components::interest_rate_model::InterestRateConfig",
24008
+ members: [
24009
+ {
24010
+ name: "min_target_utilization",
24011
+ type: "core::integer::u256"
24012
+ },
24013
+ {
24014
+ name: "max_target_utilization",
24015
+ type: "core::integer::u256"
24016
+ },
24017
+ {
24018
+ name: "target_utilization",
24019
+ type: "core::integer::u256"
24020
+ },
24021
+ {
24022
+ name: "min_full_utilization_rate",
24023
+ type: "core::integer::u256"
24024
+ },
24025
+ {
24026
+ name: "max_full_utilization_rate",
24027
+ type: "core::integer::u256"
24028
+ },
24029
+ {
24030
+ name: "zero_utilization_rate",
24031
+ type: "core::integer::u256"
24032
+ },
24033
+ {
24034
+ name: "rate_half_life",
24035
+ type: "core::integer::u256"
24036
+ },
24037
+ {
24038
+ name: "target_rate_percent",
24039
+ type: "core::integer::u256"
24040
+ }
24041
+ ]
24042
+ },
24043
+ {
24044
+ type: "struct",
24045
+ name: "vesu::extension::components::position_hooks::LiquidationConfig",
24046
+ members: [
24047
+ {
24048
+ name: "liquidation_factor",
24049
+ type: "core::integer::u64"
24050
+ }
24051
+ ]
24052
+ },
24053
+ {
24054
+ type: "struct",
24055
+ name: "vesu::extension::components::position_hooks::ShutdownConfig",
24056
+ members: [
24057
+ {
24058
+ name: "recovery_period",
24059
+ type: "core::integer::u64"
24060
+ },
24061
+ {
24062
+ name: "subscription_period",
24063
+ type: "core::integer::u64"
24064
+ }
24065
+ ]
24066
+ },
24067
+ {
24068
+ type: "struct",
24069
+ name: "vesu::data_model::LTVConfig",
24070
+ members: [
24071
+ {
24072
+ name: "max_ltv",
24073
+ type: "core::integer::u64"
24074
+ }
24075
+ ]
24076
+ },
24077
+ {
24078
+ type: "enum",
24079
+ name: "vesu::extension::components::position_hooks::ShutdownMode",
24080
+ variants: [
24081
+ {
24082
+ name: "None",
24083
+ type: "()"
24084
+ },
24085
+ {
24086
+ name: "Recovery",
24087
+ type: "()"
24088
+ },
24089
+ {
24090
+ name: "Subscription",
24091
+ type: "()"
24092
+ },
24093
+ {
24094
+ name: "Redemption",
24095
+ type: "()"
24096
+ }
24097
+ ]
24098
+ },
24099
+ {
24100
+ type: "enum",
24101
+ name: "core::bool",
24102
+ variants: [
24103
+ {
24104
+ name: "False",
24105
+ type: "()"
24106
+ },
24107
+ {
24108
+ name: "True",
24109
+ type: "()"
24110
+ }
24111
+ ]
24112
+ },
24113
+ {
24114
+ type: "struct",
24115
+ name: "vesu::extension::components::position_hooks::ShutdownStatus",
24116
+ members: [
24117
+ {
24118
+ name: "shutdown_mode",
24119
+ type: "vesu::extension::components::position_hooks::ShutdownMode"
24120
+ },
24121
+ {
24122
+ name: "violating",
24123
+ type: "core::bool"
24124
+ },
24125
+ {
24126
+ name: "previous_violation_timestamp",
24127
+ type: "core::integer::u64"
24128
+ },
24129
+ {
24130
+ name: "count_at_violation_timestamp",
24131
+ type: "core::integer::u128"
24132
+ }
24133
+ ]
24134
+ },
24135
+ {
24136
+ type: "struct",
24137
+ name: "vesu::extension::components::position_hooks::Pair",
24138
+ members: [
24139
+ {
24140
+ name: "total_collateral_shares",
24141
+ type: "core::integer::u256"
24142
+ },
24143
+ {
24144
+ name: "total_nominal_debt",
24145
+ type: "core::integer::u256"
24146
+ }
24147
+ ]
24148
+ },
24149
+ {
24150
+ type: "struct",
24151
+ name: "vesu::data_model::AssetParams",
24152
+ members: [
24153
+ {
24154
+ name: "asset",
24155
+ type: "core::starknet::contract_address::ContractAddress"
24156
+ },
24157
+ {
24158
+ name: "floor",
24159
+ type: "core::integer::u256"
24160
+ },
24161
+ {
24162
+ name: "initial_rate_accumulator",
24163
+ type: "core::integer::u256"
24164
+ },
24165
+ {
24166
+ name: "initial_full_utilization_rate",
24167
+ type: "core::integer::u256"
24168
+ },
24169
+ {
24170
+ name: "max_utilization",
24171
+ type: "core::integer::u256"
24172
+ },
24173
+ {
24174
+ name: "is_legacy",
24175
+ type: "core::bool"
24176
+ },
24177
+ {
24178
+ name: "fee_rate",
24179
+ type: "core::integer::u256"
24180
+ }
24181
+ ]
24182
+ },
24183
+ {
24184
+ type: "struct",
24185
+ name: "core::array::Span::<vesu::data_model::AssetParams>",
24186
+ members: [
24187
+ {
24188
+ name: "snapshot",
24189
+ type: "@core::array::Array::<vesu::data_model::AssetParams>"
24190
+ }
24191
+ ]
24192
+ },
24193
+ {
24194
+ type: "struct",
24195
+ name: "vesu::extension::default_extension_po::VTokenParams",
24196
+ members: [
24197
+ {
24198
+ name: "v_token_name",
24199
+ type: "core::felt252"
24200
+ },
24201
+ {
24202
+ name: "v_token_symbol",
24203
+ type: "core::felt252"
24204
+ }
24205
+ ]
24206
+ },
24207
+ {
24208
+ type: "struct",
24209
+ name: "core::array::Span::<vesu::extension::default_extension_po::VTokenParams>",
24210
+ members: [
24211
+ {
24212
+ name: "snapshot",
24213
+ type: "@core::array::Array::<vesu::extension::default_extension_po::VTokenParams>"
24214
+ }
24215
+ ]
24216
+ },
24217
+ {
24218
+ type: "struct",
24219
+ name: "vesu::data_model::LTVParams",
24220
+ members: [
24221
+ {
24222
+ name: "collateral_asset_index",
24223
+ type: "core::integer::u32"
24224
+ },
24225
+ {
24226
+ name: "debt_asset_index",
24227
+ type: "core::integer::u32"
24228
+ },
24229
+ {
24230
+ name: "max_ltv",
24231
+ type: "core::integer::u64"
24232
+ }
24233
+ ]
24234
+ },
24235
+ {
24236
+ type: "struct",
24237
+ name: "core::array::Span::<vesu::data_model::LTVParams>",
24238
+ members: [
24239
+ {
24240
+ name: "snapshot",
24241
+ type: "@core::array::Array::<vesu::data_model::LTVParams>"
24242
+ }
24243
+ ]
24244
+ },
24245
+ {
24246
+ type: "struct",
24247
+ name: "core::array::Span::<vesu::extension::components::interest_rate_model::InterestRateConfig>",
24248
+ members: [
24249
+ {
24250
+ name: "snapshot",
24251
+ type: "@core::array::Array::<vesu::extension::components::interest_rate_model::InterestRateConfig>"
24252
+ }
24253
+ ]
24254
+ },
24255
+ {
24256
+ type: "struct",
24257
+ name: "vesu::extension::default_extension_po::PragmaOracleParams",
24258
+ members: [
24259
+ {
24260
+ name: "pragma_key",
24261
+ type: "core::felt252"
24262
+ },
24263
+ {
24264
+ name: "timeout",
24265
+ type: "core::integer::u64"
24266
+ },
24267
+ {
24268
+ name: "number_of_sources",
24269
+ type: "core::integer::u32"
24270
+ },
24271
+ {
24272
+ name: "start_time_offset",
24273
+ type: "core::integer::u64"
24274
+ },
24275
+ {
24276
+ name: "time_window",
24277
+ type: "core::integer::u64"
24278
+ },
24279
+ {
24280
+ name: "aggregation_mode",
24281
+ type: "vesu::vendor::pragma::AggregationMode"
24282
+ }
24283
+ ]
24284
+ },
24285
+ {
24286
+ type: "struct",
24287
+ name: "core::array::Span::<vesu::extension::default_extension_po::PragmaOracleParams>",
24288
+ members: [
24289
+ {
24290
+ name: "snapshot",
24291
+ type: "@core::array::Array::<vesu::extension::default_extension_po::PragmaOracleParams>"
24292
+ }
24293
+ ]
24294
+ },
24295
+ {
24296
+ type: "struct",
24297
+ name: "vesu::extension::default_extension_po::LiquidationParams",
24298
+ members: [
24299
+ {
24300
+ name: "collateral_asset_index",
24301
+ type: "core::integer::u32"
24302
+ },
24303
+ {
24304
+ name: "debt_asset_index",
24305
+ type: "core::integer::u32"
24306
+ },
24307
+ {
24308
+ name: "liquidation_factor",
24309
+ type: "core::integer::u64"
24310
+ }
24311
+ ]
24312
+ },
24313
+ {
24314
+ type: "struct",
24315
+ name: "core::array::Span::<vesu::extension::default_extension_po::LiquidationParams>",
24316
+ members: [
24317
+ {
24318
+ name: "snapshot",
24319
+ type: "@core::array::Array::<vesu::extension::default_extension_po::LiquidationParams>"
24320
+ }
24321
+ ]
24322
+ },
24323
+ {
24324
+ type: "struct",
24325
+ name: "vesu::data_model::DebtCapParams",
24326
+ members: [
24327
+ {
24328
+ name: "collateral_asset_index",
24329
+ type: "core::integer::u32"
24330
+ },
24331
+ {
24332
+ name: "debt_asset_index",
24333
+ type: "core::integer::u32"
24334
+ },
24335
+ {
24336
+ name: "debt_cap",
24337
+ type: "core::integer::u256"
24338
+ }
24339
+ ]
24340
+ },
24341
+ {
24342
+ type: "struct",
24343
+ name: "core::array::Span::<vesu::data_model::DebtCapParams>",
24344
+ members: [
24345
+ {
24346
+ name: "snapshot",
24347
+ type: "@core::array::Array::<vesu::data_model::DebtCapParams>"
24348
+ }
24349
+ ]
24350
+ },
24351
+ {
24352
+ type: "struct",
24353
+ name: "vesu::extension::default_extension_po::ShutdownParams",
24354
+ members: [
24355
+ {
24356
+ name: "recovery_period",
24357
+ type: "core::integer::u64"
24358
+ },
24359
+ {
24360
+ name: "subscription_period",
24361
+ type: "core::integer::u64"
24362
+ },
24363
+ {
24364
+ name: "ltv_params",
24365
+ type: "core::array::Span::<vesu::data_model::LTVParams>"
24366
+ }
24367
+ ]
24368
+ },
24369
+ {
24370
+ type: "struct",
24371
+ name: "vesu::extension::default_extension_po::FeeParams",
24372
+ members: [
24373
+ {
24374
+ name: "fee_recipient",
24375
+ type: "core::starknet::contract_address::ContractAddress"
24376
+ }
24377
+ ]
24378
+ },
24379
+ {
24380
+ type: "struct",
24381
+ name: "core::array::Span::<(core::felt252, core::felt252, core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress)>",
24382
+ members: [
24383
+ {
24384
+ name: "snapshot",
24385
+ type: "@core::array::Array::<(core::felt252, core::felt252, core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress)>"
24386
+ }
24387
+ ]
24388
+ },
24389
+ {
24390
+ type: "struct",
24391
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::interest_rate_model::InterestRateConfig)>",
24392
+ members: [
24393
+ {
24394
+ name: "snapshot",
24395
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::interest_rate_model::InterestRateConfig)>"
24396
+ }
24397
+ ]
24398
+ },
24399
+ {
24400
+ type: "struct",
24401
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::pragma_oracle::OracleConfig)>",
24402
+ members: [
24403
+ {
24404
+ name: "snapshot",
24405
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::pragma_oracle::OracleConfig)>"
24406
+ }
24407
+ ]
24408
+ },
24409
+ {
24410
+ type: "struct",
24411
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::LiquidationConfig)>",
24412
+ members: [
24413
+ {
24414
+ name: "snapshot",
24415
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::LiquidationConfig)>"
24416
+ }
24417
+ ]
24418
+ },
24419
+ {
24420
+ type: "struct",
24421
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::Pair)>",
24422
+ members: [
24423
+ {
24424
+ name: "snapshot",
24425
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::Pair)>"
24426
+ }
24427
+ ]
24428
+ },
24429
+ {
24430
+ type: "struct",
24431
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, core::integer::u256)>",
24432
+ members: [
24433
+ {
24434
+ name: "snapshot",
24435
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, core::integer::u256)>"
24436
+ }
24437
+ ]
24438
+ },
24439
+ {
24440
+ type: "struct",
24441
+ name: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::data_model::LTVConfig)>",
24442
+ members: [
24443
+ {
24444
+ name: "snapshot",
24445
+ type: "@core::array::Array::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::data_model::LTVConfig)>"
24446
+ }
24447
+ ]
24448
+ },
24449
+ {
24450
+ type: "interface",
24451
+ name: "vesu::v2::default_extension_po_v2::IDefaultExtensionPOV2",
24452
+ items: [
24453
+ {
24454
+ type: "function",
24455
+ name: "pool_name",
24456
+ inputs: [
24457
+ {
24458
+ name: "pool_id",
24459
+ type: "core::felt252"
24460
+ }
24461
+ ],
24462
+ outputs: [
24463
+ {
24464
+ type: "core::felt252"
24465
+ }
24466
+ ],
24467
+ state_mutability: "view"
24468
+ },
24469
+ {
24470
+ type: "function",
24471
+ name: "pool_owner",
24472
+ inputs: [
24473
+ {
24474
+ name: "pool_id",
24475
+ type: "core::felt252"
24476
+ }
24477
+ ],
24478
+ outputs: [
24479
+ {
24480
+ type: "core::starknet::contract_address::ContractAddress"
24481
+ }
24482
+ ],
24483
+ state_mutability: "view"
24484
+ },
24485
+ {
24486
+ type: "function",
24487
+ name: "shutdown_mode_agent",
24488
+ inputs: [
24489
+ {
24490
+ name: "pool_id",
24491
+ type: "core::felt252"
24492
+ }
24493
+ ],
24494
+ outputs: [
24495
+ {
24496
+ type: "core::starknet::contract_address::ContractAddress"
24497
+ }
24498
+ ],
24499
+ state_mutability: "view"
24500
+ },
24501
+ {
24502
+ type: "function",
24503
+ name: "pragma_oracle",
24504
+ inputs: [],
24505
+ outputs: [
24506
+ {
24507
+ type: "core::starknet::contract_address::ContractAddress"
24508
+ }
24509
+ ],
24510
+ state_mutability: "view"
24511
+ },
24512
+ {
24513
+ type: "function",
24514
+ name: "pragma_summary",
24515
+ inputs: [],
24516
+ outputs: [
24517
+ {
24518
+ type: "core::starknet::contract_address::ContractAddress"
24519
+ }
24520
+ ],
24521
+ state_mutability: "view"
24522
+ },
24523
+ {
24524
+ type: "function",
24525
+ name: "oracle_config",
24526
+ inputs: [
24527
+ {
24528
+ name: "pool_id",
24529
+ type: "core::felt252"
24530
+ },
24531
+ {
24532
+ name: "asset",
24533
+ type: "core::starknet::contract_address::ContractAddress"
24534
+ }
24535
+ ],
24536
+ outputs: [
24537
+ {
24538
+ type: "vesu::extension::components::pragma_oracle::OracleConfig"
24539
+ }
24540
+ ],
24541
+ state_mutability: "view"
24542
+ },
24543
+ {
24544
+ type: "function",
24545
+ name: "fee_config",
24546
+ inputs: [
24547
+ {
24548
+ name: "pool_id",
24549
+ type: "core::felt252"
24550
+ }
24551
+ ],
24552
+ outputs: [
24553
+ {
24554
+ type: "vesu::extension::components::fee_model::FeeConfig"
24555
+ }
24556
+ ],
24557
+ state_mutability: "view"
24558
+ },
24559
+ {
24560
+ type: "function",
24561
+ name: "debt_caps",
24562
+ inputs: [
24563
+ {
24564
+ name: "pool_id",
24565
+ type: "core::felt252"
24566
+ },
24567
+ {
24568
+ name: "collateral_asset",
24569
+ type: "core::starknet::contract_address::ContractAddress"
24570
+ },
24571
+ {
24572
+ name: "debt_asset",
24573
+ type: "core::starknet::contract_address::ContractAddress"
24574
+ }
24575
+ ],
24576
+ outputs: [
24577
+ {
24578
+ type: "core::integer::u256"
24579
+ }
24580
+ ],
24581
+ state_mutability: "view"
24582
+ },
24583
+ {
24584
+ type: "function",
24585
+ name: "interest_rate_config",
24586
+ inputs: [
24587
+ {
24588
+ name: "pool_id",
24589
+ type: "core::felt252"
24590
+ },
24591
+ {
24592
+ name: "asset",
24593
+ type: "core::starknet::contract_address::ContractAddress"
24594
+ }
24595
+ ],
24596
+ outputs: [
24597
+ {
24598
+ type: "vesu::extension::components::interest_rate_model::InterestRateConfig"
24599
+ }
24600
+ ],
24601
+ state_mutability: "view"
24602
+ },
24603
+ {
24604
+ type: "function",
24605
+ name: "liquidation_config",
24606
+ inputs: [
24607
+ {
24608
+ name: "pool_id",
24609
+ type: "core::felt252"
24610
+ },
24611
+ {
24612
+ name: "collateral_asset",
24613
+ type: "core::starknet::contract_address::ContractAddress"
24614
+ },
24615
+ {
24616
+ name: "debt_asset",
24617
+ type: "core::starknet::contract_address::ContractAddress"
24618
+ }
24619
+ ],
24620
+ outputs: [
24621
+ {
24622
+ type: "vesu::extension::components::position_hooks::LiquidationConfig"
24623
+ }
24624
+ ],
24625
+ state_mutability: "view"
24626
+ },
24627
+ {
24628
+ type: "function",
24629
+ name: "shutdown_config",
24630
+ inputs: [
24631
+ {
24632
+ name: "pool_id",
24633
+ type: "core::felt252"
24634
+ }
24635
+ ],
24636
+ outputs: [
24637
+ {
24638
+ type: "vesu::extension::components::position_hooks::ShutdownConfig"
24639
+ }
24640
+ ],
24641
+ state_mutability: "view"
24642
+ },
24643
+ {
24644
+ type: "function",
24645
+ name: "shutdown_ltv_config",
24646
+ inputs: [
24647
+ {
24648
+ name: "pool_id",
24649
+ type: "core::felt252"
24650
+ },
24651
+ {
24652
+ name: "collateral_asset",
24653
+ type: "core::starknet::contract_address::ContractAddress"
24654
+ },
24655
+ {
24656
+ name: "debt_asset",
24657
+ type: "core::starknet::contract_address::ContractAddress"
24658
+ }
24659
+ ],
24660
+ outputs: [
24661
+ {
24662
+ type: "vesu::data_model::LTVConfig"
24663
+ }
24664
+ ],
24665
+ state_mutability: "view"
24666
+ },
24667
+ {
24668
+ type: "function",
24669
+ name: "shutdown_status",
24670
+ inputs: [
24671
+ {
24672
+ name: "pool_id",
24673
+ type: "core::felt252"
24674
+ },
24675
+ {
24676
+ name: "collateral_asset",
24677
+ type: "core::starknet::contract_address::ContractAddress"
24678
+ },
24679
+ {
24680
+ name: "debt_asset",
24681
+ type: "core::starknet::contract_address::ContractAddress"
24682
+ }
24683
+ ],
24684
+ outputs: [
24685
+ {
24686
+ type: "vesu::extension::components::position_hooks::ShutdownStatus"
24687
+ }
24688
+ ],
24689
+ state_mutability: "view"
24690
+ },
24691
+ {
24692
+ type: "function",
24693
+ name: "pairs",
24694
+ inputs: [
24695
+ {
24696
+ name: "pool_id",
24697
+ type: "core::felt252"
24698
+ },
24699
+ {
24700
+ name: "collateral_asset",
24701
+ type: "core::starknet::contract_address::ContractAddress"
24702
+ },
24703
+ {
24704
+ name: "debt_asset",
24705
+ type: "core::starknet::contract_address::ContractAddress"
24706
+ }
24707
+ ],
24708
+ outputs: [
24709
+ {
24710
+ type: "vesu::extension::components::position_hooks::Pair"
24711
+ }
24712
+ ],
24713
+ state_mutability: "view"
24714
+ },
24715
+ {
24716
+ type: "function",
24717
+ name: "violation_timestamp_for_pair",
24718
+ inputs: [
24719
+ {
24720
+ name: "pool_id",
24721
+ type: "core::felt252"
24722
+ },
24723
+ {
24724
+ name: "collateral_asset",
24725
+ type: "core::starknet::contract_address::ContractAddress"
24726
+ },
24727
+ {
24728
+ name: "debt_asset",
24729
+ type: "core::starknet::contract_address::ContractAddress"
24730
+ }
24731
+ ],
24732
+ outputs: [
24733
+ {
24734
+ type: "core::integer::u64"
24735
+ }
24736
+ ],
24737
+ state_mutability: "view"
24738
+ },
24739
+ {
24740
+ type: "function",
24741
+ name: "violation_timestamp_count",
24742
+ inputs: [
24743
+ {
24744
+ name: "pool_id",
24745
+ type: "core::felt252"
24746
+ },
24747
+ {
24748
+ name: "violation_timestamp",
24749
+ type: "core::integer::u64"
24750
+ }
24751
+ ],
24752
+ outputs: [
24753
+ {
24754
+ type: "core::integer::u128"
24755
+ }
24756
+ ],
24757
+ state_mutability: "view"
24758
+ },
24759
+ {
24760
+ type: "function",
24761
+ name: "oldest_violation_timestamp",
24762
+ inputs: [
24763
+ {
24764
+ name: "pool_id",
24765
+ type: "core::felt252"
24766
+ }
24767
+ ],
24768
+ outputs: [
24769
+ {
24770
+ type: "core::integer::u64"
24771
+ }
24772
+ ],
24773
+ state_mutability: "view"
24774
+ },
24775
+ {
24776
+ type: "function",
24777
+ name: "next_violation_timestamp",
24778
+ inputs: [
24779
+ {
24780
+ name: "pool_id",
24781
+ type: "core::felt252"
24782
+ },
24783
+ {
24784
+ name: "violation_timestamp",
24785
+ type: "core::integer::u64"
24786
+ }
24787
+ ],
24788
+ outputs: [
24789
+ {
24790
+ type: "core::integer::u64"
24791
+ }
24792
+ ],
24793
+ state_mutability: "view"
24794
+ },
24795
+ {
24796
+ type: "function",
24797
+ name: "v_token_for_collateral_asset",
24798
+ inputs: [
24799
+ {
24800
+ name: "pool_id",
24801
+ type: "core::felt252"
24802
+ },
24803
+ {
24804
+ name: "collateral_asset",
24805
+ type: "core::starknet::contract_address::ContractAddress"
24806
+ }
24807
+ ],
24808
+ outputs: [
24809
+ {
24810
+ type: "core::starknet::contract_address::ContractAddress"
24811
+ }
24812
+ ],
24813
+ state_mutability: "view"
24814
+ },
24815
+ {
24816
+ type: "function",
24817
+ name: "collateral_asset_for_v_token",
24818
+ inputs: [
24819
+ {
24820
+ name: "pool_id",
24821
+ type: "core::felt252"
24822
+ },
24823
+ {
24824
+ name: "v_token",
24825
+ type: "core::starknet::contract_address::ContractAddress"
24826
+ }
24827
+ ],
24828
+ outputs: [
24829
+ {
24830
+ type: "core::starknet::contract_address::ContractAddress"
24831
+ }
24832
+ ],
24833
+ state_mutability: "view"
24834
+ },
24835
+ {
24836
+ type: "function",
24837
+ name: "create_pool",
24838
+ inputs: [
24839
+ {
24840
+ name: "name",
24841
+ type: "core::felt252"
24842
+ },
24843
+ {
24844
+ name: "asset_params",
24845
+ type: "core::array::Span::<vesu::data_model::AssetParams>"
24846
+ },
24847
+ {
24848
+ name: "v_token_params",
24849
+ type: "core::array::Span::<vesu::extension::default_extension_po::VTokenParams>"
24850
+ },
24851
+ {
24852
+ name: "ltv_params",
24853
+ type: "core::array::Span::<vesu::data_model::LTVParams>"
24854
+ },
24855
+ {
24856
+ name: "interest_rate_configs",
24857
+ type: "core::array::Span::<vesu::extension::components::interest_rate_model::InterestRateConfig>"
24858
+ },
24859
+ {
24860
+ name: "pragma_oracle_params",
24861
+ type: "core::array::Span::<vesu::extension::default_extension_po::PragmaOracleParams>"
24862
+ },
24863
+ {
24864
+ name: "liquidation_params",
24865
+ type: "core::array::Span::<vesu::extension::default_extension_po::LiquidationParams>"
24866
+ },
24867
+ {
24868
+ name: "debt_caps",
24869
+ type: "core::array::Span::<vesu::data_model::DebtCapParams>"
24870
+ },
24871
+ {
24872
+ name: "shutdown_params",
24873
+ type: "vesu::extension::default_extension_po::ShutdownParams"
24874
+ },
24875
+ {
24876
+ name: "fee_params",
24877
+ type: "vesu::extension::default_extension_po::FeeParams"
24878
+ },
24879
+ {
24880
+ name: "owner",
24881
+ type: "core::starknet::contract_address::ContractAddress"
24882
+ }
24883
+ ],
24884
+ outputs: [
24885
+ {
24886
+ type: "core::felt252"
24887
+ }
24888
+ ],
24889
+ state_mutability: "external"
24890
+ },
24891
+ {
24892
+ type: "function",
24893
+ name: "add_asset",
24894
+ inputs: [
24895
+ {
24896
+ name: "pool_id",
24897
+ type: "core::felt252"
24898
+ },
24899
+ {
24900
+ name: "asset_params",
24901
+ type: "vesu::data_model::AssetParams"
24902
+ },
24903
+ {
24904
+ name: "v_token_params",
24905
+ type: "vesu::extension::default_extension_po::VTokenParams"
24906
+ },
24907
+ {
24908
+ name: "interest_rate_config",
24909
+ type: "vesu::extension::components::interest_rate_model::InterestRateConfig"
24910
+ },
24911
+ {
24912
+ name: "pragma_oracle_params",
24913
+ type: "vesu::extension::default_extension_po::PragmaOracleParams"
24914
+ }
24915
+ ],
24916
+ outputs: [],
24917
+ state_mutability: "external"
24918
+ },
24919
+ {
24920
+ type: "function",
24921
+ name: "set_asset_parameter",
24922
+ inputs: [
24923
+ {
24924
+ name: "pool_id",
24925
+ type: "core::felt252"
24926
+ },
24927
+ {
24928
+ name: "asset",
24929
+ type: "core::starknet::contract_address::ContractAddress"
24930
+ },
24931
+ {
24932
+ name: "parameter",
24933
+ type: "core::felt252"
24934
+ },
24935
+ {
24936
+ name: "value",
24937
+ type: "core::integer::u256"
24938
+ }
24939
+ ],
24940
+ outputs: [],
24941
+ state_mutability: "external"
24942
+ },
24943
+ {
24944
+ type: "function",
24945
+ name: "set_debt_cap",
24946
+ inputs: [
24947
+ {
24948
+ name: "pool_id",
24949
+ type: "core::felt252"
24950
+ },
24951
+ {
24952
+ name: "collateral_asset",
24953
+ type: "core::starknet::contract_address::ContractAddress"
24954
+ },
24955
+ {
24956
+ name: "debt_asset",
24957
+ type: "core::starknet::contract_address::ContractAddress"
24958
+ },
24959
+ {
24960
+ name: "debt_cap",
24961
+ type: "core::integer::u256"
24962
+ }
24963
+ ],
24964
+ outputs: [],
24965
+ state_mutability: "external"
24966
+ },
24967
+ {
24968
+ type: "function",
24969
+ name: "set_interest_rate_parameter",
24970
+ inputs: [
24971
+ {
24972
+ name: "pool_id",
24973
+ type: "core::felt252"
24974
+ },
24975
+ {
24976
+ name: "asset",
24977
+ type: "core::starknet::contract_address::ContractAddress"
24978
+ },
24979
+ {
24980
+ name: "parameter",
24981
+ type: "core::felt252"
24982
+ },
24983
+ {
24984
+ name: "value",
24985
+ type: "core::integer::u256"
24986
+ }
24987
+ ],
24988
+ outputs: [],
24989
+ state_mutability: "external"
24990
+ },
24991
+ {
24992
+ type: "function",
24993
+ name: "set_oracle_parameter",
24994
+ inputs: [
24995
+ {
24996
+ name: "pool_id",
24997
+ type: "core::felt252"
24998
+ },
24999
+ {
25000
+ name: "asset",
25001
+ type: "core::starknet::contract_address::ContractAddress"
25002
+ },
25003
+ {
25004
+ name: "parameter",
25005
+ type: "core::felt252"
25006
+ },
25007
+ {
25008
+ name: "value",
25009
+ type: "core::felt252"
25010
+ }
25011
+ ],
25012
+ outputs: [],
25013
+ state_mutability: "external"
25014
+ },
25015
+ {
25016
+ type: "function",
25017
+ name: "set_liquidation_config",
25018
+ inputs: [
25019
+ {
25020
+ name: "pool_id",
25021
+ type: "core::felt252"
25022
+ },
25023
+ {
25024
+ name: "collateral_asset",
25025
+ type: "core::starknet::contract_address::ContractAddress"
25026
+ },
25027
+ {
25028
+ name: "debt_asset",
25029
+ type: "core::starknet::contract_address::ContractAddress"
25030
+ },
25031
+ {
25032
+ name: "liquidation_config",
25033
+ type: "vesu::extension::components::position_hooks::LiquidationConfig"
25034
+ }
25035
+ ],
25036
+ outputs: [],
25037
+ state_mutability: "external"
25038
+ },
25039
+ {
25040
+ type: "function",
25041
+ name: "set_ltv_config",
25042
+ inputs: [
25043
+ {
25044
+ name: "pool_id",
25045
+ type: "core::felt252"
25046
+ },
25047
+ {
25048
+ name: "collateral_asset",
25049
+ type: "core::starknet::contract_address::ContractAddress"
25050
+ },
25051
+ {
25052
+ name: "debt_asset",
25053
+ type: "core::starknet::contract_address::ContractAddress"
25054
+ },
25055
+ {
25056
+ name: "ltv_config",
25057
+ type: "vesu::data_model::LTVConfig"
25058
+ }
25059
+ ],
25060
+ outputs: [],
25061
+ state_mutability: "external"
25062
+ },
25063
+ {
25064
+ type: "function",
25065
+ name: "set_shutdown_config",
25066
+ inputs: [
25067
+ {
25068
+ name: "pool_id",
25069
+ type: "core::felt252"
25070
+ },
25071
+ {
25072
+ name: "shutdown_config",
25073
+ type: "vesu::extension::components::position_hooks::ShutdownConfig"
25074
+ }
25075
+ ],
25076
+ outputs: [],
25077
+ state_mutability: "external"
25078
+ },
25079
+ {
25080
+ type: "function",
25081
+ name: "set_shutdown_ltv_config",
25082
+ inputs: [
25083
+ {
25084
+ name: "pool_id",
25085
+ type: "core::felt252"
25086
+ },
25087
+ {
25088
+ name: "collateral_asset",
25089
+ type: "core::starknet::contract_address::ContractAddress"
25090
+ },
25091
+ {
25092
+ name: "debt_asset",
25093
+ type: "core::starknet::contract_address::ContractAddress"
25094
+ },
25095
+ {
25096
+ name: "shutdown_ltv_config",
25097
+ type: "vesu::data_model::LTVConfig"
25098
+ }
25099
+ ],
25100
+ outputs: [],
25101
+ state_mutability: "external"
25102
+ },
25103
+ {
25104
+ type: "function",
25105
+ name: "set_shutdown_mode",
25106
+ inputs: [
25107
+ {
25108
+ name: "pool_id",
25109
+ type: "core::felt252"
25110
+ },
25111
+ {
25112
+ name: "shutdown_mode",
25113
+ type: "vesu::extension::components::position_hooks::ShutdownMode"
25114
+ }
25115
+ ],
25116
+ outputs: [],
25117
+ state_mutability: "external"
25118
+ },
25119
+ {
25120
+ type: "function",
25121
+ name: "set_pool_owner",
25122
+ inputs: [
25123
+ {
25124
+ name: "pool_id",
25125
+ type: "core::felt252"
25126
+ },
25127
+ {
25128
+ name: "owner",
25129
+ type: "core::starknet::contract_address::ContractAddress"
25130
+ }
25131
+ ],
25132
+ outputs: [],
25133
+ state_mutability: "external"
25134
+ },
25135
+ {
25136
+ type: "function",
25137
+ name: "set_shutdown_mode_agent",
25138
+ inputs: [
25139
+ {
25140
+ name: "pool_id",
25141
+ type: "core::felt252"
25142
+ },
25143
+ {
25144
+ name: "shutdown_mode_agent",
25145
+ type: "core::starknet::contract_address::ContractAddress"
25146
+ }
25147
+ ],
25148
+ outputs: [],
25149
+ state_mutability: "external"
25150
+ },
25151
+ {
25152
+ type: "function",
25153
+ name: "update_shutdown_status",
25154
+ inputs: [
25155
+ {
25156
+ name: "pool_id",
25157
+ type: "core::felt252"
25158
+ },
25159
+ {
25160
+ name: "collateral_asset",
25161
+ type: "core::starknet::contract_address::ContractAddress"
25162
+ },
25163
+ {
25164
+ name: "debt_asset",
25165
+ type: "core::starknet::contract_address::ContractAddress"
25166
+ }
25167
+ ],
25168
+ outputs: [
25169
+ {
25170
+ type: "vesu::extension::components::position_hooks::ShutdownMode"
25171
+ }
25172
+ ],
25173
+ state_mutability: "external"
25174
+ },
25175
+ {
25176
+ type: "function",
25177
+ name: "set_fee_config",
25178
+ inputs: [
25179
+ {
25180
+ name: "pool_id",
25181
+ type: "core::felt252"
25182
+ },
25183
+ {
25184
+ name: "fee_config",
25185
+ type: "vesu::extension::components::fee_model::FeeConfig"
25186
+ }
25187
+ ],
25188
+ outputs: [],
25189
+ state_mutability: "external"
25190
+ },
25191
+ {
25192
+ type: "function",
25193
+ name: "claim_fees",
25194
+ inputs: [
25195
+ {
25196
+ name: "pool_id",
25197
+ type: "core::felt252"
25198
+ },
25199
+ {
25200
+ name: "collateral_asset",
25201
+ type: "core::starknet::contract_address::ContractAddress"
25202
+ }
25203
+ ],
25204
+ outputs: [],
25205
+ state_mutability: "external"
25206
+ },
25207
+ {
25208
+ type: "function",
25209
+ name: "migrate_pool",
25210
+ inputs: [
25211
+ {
25212
+ name: "pool_id",
25213
+ type: "core::felt252"
25214
+ },
25215
+ {
25216
+ name: "name",
25217
+ type: "core::felt252"
25218
+ },
25219
+ {
25220
+ name: "v_token_configs",
25221
+ type: "core::array::Span::<(core::felt252, core::felt252, core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress)>"
25222
+ },
25223
+ {
25224
+ name: "interest_rate_configs",
25225
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::interest_rate_model::InterestRateConfig)>"
25226
+ },
25227
+ {
25228
+ name: "pragma_oracle_configs",
25229
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, vesu::extension::components::pragma_oracle::OracleConfig)>"
25230
+ },
25231
+ {
25232
+ name: "liquidation_configs",
25233
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::LiquidationConfig)>"
25234
+ },
25235
+ {
25236
+ name: "pairs",
25237
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::extension::components::position_hooks::Pair)>"
25238
+ },
25239
+ {
25240
+ name: "debt_caps",
25241
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, core::integer::u256)>"
25242
+ },
25243
+ {
25244
+ name: "shutdown_ltv_configs",
25245
+ type: "core::array::Span::<(core::starknet::contract_address::ContractAddress, core::starknet::contract_address::ContractAddress, vesu::data_model::LTVConfig)>"
25246
+ },
25247
+ {
25248
+ name: "shutdown_config",
25249
+ type: "vesu::extension::components::position_hooks::ShutdownConfig"
25250
+ },
25251
+ {
25252
+ name: "fee_config",
25253
+ type: "vesu::extension::components::fee_model::FeeConfig"
25254
+ },
25255
+ {
25256
+ name: "owner",
25257
+ type: "core::starknet::contract_address::ContractAddress"
25258
+ }
25259
+ ],
25260
+ outputs: [],
25261
+ state_mutability: "external"
25262
+ },
25263
+ {
25264
+ type: "function",
25265
+ name: "set_migrator",
25266
+ inputs: [
25267
+ {
25268
+ name: "migrator",
25269
+ type: "core::starknet::contract_address::ContractAddress"
25270
+ }
25271
+ ],
25272
+ outputs: [],
25273
+ state_mutability: "external"
25274
+ },
25275
+ {
25276
+ type: "function",
25277
+ name: "set_extension_utils_class_hash",
25278
+ inputs: [
25279
+ {
25280
+ name: "extension",
25281
+ type: "core::felt252"
25282
+ }
25283
+ ],
25284
+ outputs: [],
25285
+ state_mutability: "external"
25286
+ },
25287
+ {
25288
+ type: "function",
25289
+ name: "upgrade_name",
25290
+ inputs: [],
25291
+ outputs: [
25292
+ {
25293
+ type: "core::felt252"
25294
+ }
25295
+ ],
25296
+ state_mutability: "view"
25297
+ },
25298
+ {
25299
+ type: "function",
25300
+ name: "upgrade",
25301
+ inputs: [
25302
+ {
25303
+ name: "new_implementation",
25304
+ type: "core::starknet::class_hash::ClassHash"
25305
+ }
25306
+ ],
25307
+ outputs: [],
25308
+ state_mutability: "external"
25309
+ }
25310
+ ]
25311
+ },
25312
+ {
25313
+ type: "impl",
25314
+ name: "ExtensionImpl",
25315
+ interface_name: "vesu::extension::interface::IExtension"
25316
+ },
25317
+ {
25318
+ type: "struct",
25319
+ name: "vesu::data_model::AssetPrice",
25320
+ members: [
25321
+ {
25322
+ name: "value",
25323
+ type: "core::integer::u256"
25324
+ },
25325
+ {
25326
+ name: "is_valid",
25327
+ type: "core::bool"
25328
+ }
25329
+ ]
25330
+ },
25331
+ {
25332
+ type: "struct",
25333
+ name: "vesu::data_model::AssetConfig",
25334
+ members: [
25335
+ {
25336
+ name: "total_collateral_shares",
25337
+ type: "core::integer::u256"
25338
+ },
25339
+ {
25340
+ name: "total_nominal_debt",
25341
+ type: "core::integer::u256"
25342
+ },
25343
+ {
25344
+ name: "reserve",
25345
+ type: "core::integer::u256"
25346
+ },
25347
+ {
25348
+ name: "max_utilization",
25349
+ type: "core::integer::u256"
25350
+ },
25351
+ {
25352
+ name: "floor",
25353
+ type: "core::integer::u256"
25354
+ },
25355
+ {
25356
+ name: "scale",
25357
+ type: "core::integer::u256"
25358
+ },
25359
+ {
25360
+ name: "is_legacy",
25361
+ type: "core::bool"
25362
+ },
25363
+ {
25364
+ name: "last_updated",
25365
+ type: "core::integer::u64"
25366
+ },
25367
+ {
25368
+ name: "last_rate_accumulator",
25369
+ type: "core::integer::u256"
25370
+ },
25371
+ {
25372
+ name: "last_full_utilization_rate",
25373
+ type: "core::integer::u256"
25374
+ },
25375
+ {
25376
+ name: "fee_rate",
25377
+ type: "core::integer::u256"
25378
+ }
25379
+ ]
25380
+ },
25381
+ {
25382
+ type: "struct",
25383
+ name: "vesu::data_model::Position",
25384
+ members: [
25385
+ {
25386
+ name: "collateral_shares",
25387
+ type: "core::integer::u256"
25388
+ },
25389
+ {
25390
+ name: "nominal_debt",
25391
+ type: "core::integer::u256"
25392
+ }
25393
+ ]
25394
+ },
25395
+ {
25396
+ type: "struct",
25397
+ name: "vesu::data_model::Context",
25398
+ members: [
25399
+ {
25400
+ name: "pool_id",
25401
+ type: "core::felt252"
25402
+ },
25403
+ {
25404
+ name: "extension",
25405
+ type: "core::starknet::contract_address::ContractAddress"
25406
+ },
25407
+ {
25408
+ name: "collateral_asset",
25409
+ type: "core::starknet::contract_address::ContractAddress"
25410
+ },
25411
+ {
25412
+ name: "debt_asset",
25413
+ type: "core::starknet::contract_address::ContractAddress"
25414
+ },
25415
+ {
25416
+ name: "collateral_asset_config",
25417
+ type: "vesu::data_model::AssetConfig"
25418
+ },
25419
+ {
25420
+ name: "debt_asset_config",
25421
+ type: "vesu::data_model::AssetConfig"
25422
+ },
25423
+ {
25424
+ name: "collateral_asset_price",
25425
+ type: "vesu::data_model::AssetPrice"
25426
+ },
25427
+ {
25428
+ name: "debt_asset_price",
25429
+ type: "vesu::data_model::AssetPrice"
25430
+ },
25431
+ {
25432
+ name: "collateral_asset_fee_shares",
25433
+ type: "core::integer::u256"
25434
+ },
25435
+ {
25436
+ name: "debt_asset_fee_shares",
25437
+ type: "core::integer::u256"
25438
+ },
25439
+ {
25440
+ name: "max_ltv",
25441
+ type: "core::integer::u64"
25442
+ },
25443
+ {
25444
+ name: "user",
25445
+ type: "core::starknet::contract_address::ContractAddress"
25446
+ },
25447
+ {
25448
+ name: "position",
25449
+ type: "vesu::data_model::Position"
25450
+ }
25451
+ ]
25452
+ },
25453
+ {
25454
+ type: "enum",
25455
+ name: "vesu::data_model::AmountType",
25456
+ variants: [
25457
+ {
25458
+ name: "Delta",
25459
+ type: "()"
25460
+ },
25461
+ {
25462
+ name: "Target",
25463
+ type: "()"
25464
+ }
25465
+ ]
25466
+ },
25467
+ {
25468
+ type: "enum",
25469
+ name: "vesu::data_model::AmountDenomination",
25470
+ variants: [
25471
+ {
25472
+ name: "Native",
25473
+ type: "()"
25474
+ },
25475
+ {
25476
+ name: "Assets",
25477
+ type: "()"
25478
+ }
25479
+ ]
25480
+ },
25481
+ {
25482
+ type: "struct",
25483
+ name: "alexandria_math::i257::i257",
25484
+ members: [
25485
+ {
25486
+ name: "abs",
25487
+ type: "core::integer::u256"
25488
+ },
25489
+ {
25490
+ name: "is_negative",
25491
+ type: "core::bool"
25492
+ }
25493
+ ]
25494
+ },
25495
+ {
25496
+ type: "struct",
25497
+ name: "vesu::data_model::Amount",
25498
+ members: [
25499
+ {
25500
+ name: "amount_type",
25501
+ type: "vesu::data_model::AmountType"
25502
+ },
25503
+ {
25504
+ name: "denomination",
25505
+ type: "vesu::data_model::AmountDenomination"
25506
+ },
25507
+ {
25508
+ name: "value",
25509
+ type: "alexandria_math::i257::i257"
25510
+ }
25511
+ ]
25512
+ },
25513
+ {
25514
+ type: "struct",
25515
+ name: "core::array::Span::<core::felt252>",
25516
+ members: [
25517
+ {
25518
+ name: "snapshot",
25519
+ type: "@core::array::Array::<core::felt252>"
25520
+ }
25521
+ ]
25522
+ },
25523
+ {
25524
+ type: "struct",
25525
+ name: "vesu::data_model::UnsignedAmount",
25526
+ members: [
25527
+ {
25528
+ name: "amount_type",
25529
+ type: "vesu::data_model::AmountType"
25530
+ },
25531
+ {
25532
+ name: "denomination",
25533
+ type: "vesu::data_model::AmountDenomination"
25534
+ },
25535
+ {
25536
+ name: "value",
25537
+ type: "core::integer::u256"
25538
+ }
25539
+ ]
25540
+ },
25541
+ {
25542
+ type: "interface",
25543
+ name: "vesu::extension::interface::IExtension",
25544
+ items: [
25545
+ {
25546
+ type: "function",
25547
+ name: "singleton",
25548
+ inputs: [],
25549
+ outputs: [
25550
+ {
25551
+ type: "core::starknet::contract_address::ContractAddress"
25552
+ }
25553
+ ],
25554
+ state_mutability: "view"
25555
+ },
25556
+ {
25557
+ type: "function",
25558
+ name: "price",
25559
+ inputs: [
25560
+ {
25561
+ name: "pool_id",
25562
+ type: "core::felt252"
25563
+ },
25564
+ {
25565
+ name: "asset",
25566
+ type: "core::starknet::contract_address::ContractAddress"
25567
+ }
25568
+ ],
25569
+ outputs: [
25570
+ {
25571
+ type: "vesu::data_model::AssetPrice"
25572
+ }
25573
+ ],
25574
+ state_mutability: "view"
25575
+ },
25576
+ {
25577
+ type: "function",
25578
+ name: "interest_rate",
25579
+ inputs: [
25580
+ {
25581
+ name: "pool_id",
25582
+ type: "core::felt252"
25583
+ },
25584
+ {
25585
+ name: "asset",
25586
+ type: "core::starknet::contract_address::ContractAddress"
25587
+ },
25588
+ {
25589
+ name: "utilization",
25590
+ type: "core::integer::u256"
25591
+ },
25592
+ {
25593
+ name: "last_updated",
25594
+ type: "core::integer::u64"
25595
+ },
25596
+ {
25597
+ name: "last_full_utilization_rate",
25598
+ type: "core::integer::u256"
25599
+ }
25600
+ ],
25601
+ outputs: [
25602
+ {
25603
+ type: "core::integer::u256"
25604
+ }
25605
+ ],
25606
+ state_mutability: "view"
25607
+ },
25608
+ {
25609
+ type: "function",
25610
+ name: "rate_accumulator",
25611
+ inputs: [
25612
+ {
25613
+ name: "pool_id",
25614
+ type: "core::felt252"
25615
+ },
25616
+ {
25617
+ name: "asset",
25618
+ type: "core::starknet::contract_address::ContractAddress"
25619
+ },
25620
+ {
25621
+ name: "utilization",
25622
+ type: "core::integer::u256"
25623
+ },
25624
+ {
25625
+ name: "last_updated",
25626
+ type: "core::integer::u64"
25627
+ },
25628
+ {
25629
+ name: "last_rate_accumulator",
25630
+ type: "core::integer::u256"
25631
+ },
25632
+ {
25633
+ name: "last_full_utilization_rate",
25634
+ type: "core::integer::u256"
25635
+ }
25636
+ ],
25637
+ outputs: [
25638
+ {
25639
+ type: "(core::integer::u256, core::integer::u256)"
25640
+ }
25641
+ ],
25642
+ state_mutability: "view"
25643
+ },
25644
+ {
25645
+ type: "function",
25646
+ name: "before_modify_position",
25647
+ inputs: [
25648
+ {
25649
+ name: "context",
25650
+ type: "vesu::data_model::Context"
25651
+ },
25652
+ {
25653
+ name: "collateral",
25654
+ type: "vesu::data_model::Amount"
25655
+ },
25656
+ {
25657
+ name: "debt",
25658
+ type: "vesu::data_model::Amount"
25659
+ },
25660
+ {
25661
+ name: "data",
25662
+ type: "core::array::Span::<core::felt252>"
25663
+ },
25664
+ {
25665
+ name: "caller",
25666
+ type: "core::starknet::contract_address::ContractAddress"
25667
+ }
25668
+ ],
25669
+ outputs: [
25670
+ {
25671
+ type: "(vesu::data_model::Amount, vesu::data_model::Amount)"
25672
+ }
25673
+ ],
25674
+ state_mutability: "external"
25675
+ },
25676
+ {
25677
+ type: "function",
25678
+ name: "after_modify_position",
25679
+ inputs: [
25680
+ {
25681
+ name: "context",
25682
+ type: "vesu::data_model::Context"
25683
+ },
25684
+ {
25685
+ name: "collateral_delta",
25686
+ type: "alexandria_math::i257::i257"
25687
+ },
25688
+ {
25689
+ name: "collateral_shares_delta",
25690
+ type: "alexandria_math::i257::i257"
25691
+ },
25692
+ {
25693
+ name: "debt_delta",
25694
+ type: "alexandria_math::i257::i257"
25695
+ },
25696
+ {
25697
+ name: "nominal_debt_delta",
25698
+ type: "alexandria_math::i257::i257"
25699
+ },
25700
+ {
25701
+ name: "data",
25702
+ type: "core::array::Span::<core::felt252>"
25703
+ },
25704
+ {
25705
+ name: "caller",
25706
+ type: "core::starknet::contract_address::ContractAddress"
25707
+ }
25708
+ ],
25709
+ outputs: [
25710
+ {
25711
+ type: "core::bool"
25712
+ }
25713
+ ],
25714
+ state_mutability: "external"
25715
+ },
25716
+ {
25717
+ type: "function",
25718
+ name: "before_transfer_position",
25719
+ inputs: [
25720
+ {
25721
+ name: "from_context",
25722
+ type: "vesu::data_model::Context"
25723
+ },
25724
+ {
25725
+ name: "to_context",
25726
+ type: "vesu::data_model::Context"
25727
+ },
25728
+ {
25729
+ name: "collateral",
25730
+ type: "vesu::data_model::UnsignedAmount"
25731
+ },
25732
+ {
25733
+ name: "debt",
25734
+ type: "vesu::data_model::UnsignedAmount"
25735
+ },
25736
+ {
25737
+ name: "data",
25738
+ type: "core::array::Span::<core::felt252>"
25739
+ },
25740
+ {
25741
+ name: "caller",
25742
+ type: "core::starknet::contract_address::ContractAddress"
25743
+ }
25744
+ ],
25745
+ outputs: [
25746
+ {
25747
+ type: "(vesu::data_model::UnsignedAmount, vesu::data_model::UnsignedAmount)"
25748
+ }
25749
+ ],
25750
+ state_mutability: "external"
25751
+ },
25752
+ {
25753
+ type: "function",
25754
+ name: "after_transfer_position",
25755
+ inputs: [
25756
+ {
25757
+ name: "from_context",
25758
+ type: "vesu::data_model::Context"
25759
+ },
25760
+ {
25761
+ name: "to_context",
25762
+ type: "vesu::data_model::Context"
25763
+ },
25764
+ {
25765
+ name: "collateral_delta",
25766
+ type: "core::integer::u256"
25767
+ },
25768
+ {
25769
+ name: "collateral_shares_delta",
25770
+ type: "core::integer::u256"
25771
+ },
25772
+ {
25773
+ name: "debt_delta",
25774
+ type: "core::integer::u256"
25775
+ },
25776
+ {
25777
+ name: "nominal_debt_delta",
25778
+ type: "core::integer::u256"
25779
+ },
25780
+ {
25781
+ name: "data",
25782
+ type: "core::array::Span::<core::felt252>"
25783
+ },
25784
+ {
25785
+ name: "caller",
25786
+ type: "core::starknet::contract_address::ContractAddress"
25787
+ }
25788
+ ],
25789
+ outputs: [
25790
+ {
25791
+ type: "core::bool"
25792
+ }
25793
+ ],
25794
+ state_mutability: "external"
25795
+ },
25796
+ {
25797
+ type: "function",
25798
+ name: "before_liquidate_position",
25799
+ inputs: [
25800
+ {
25801
+ name: "context",
25802
+ type: "vesu::data_model::Context"
25803
+ },
25804
+ {
25805
+ name: "data",
25806
+ type: "core::array::Span::<core::felt252>"
25807
+ },
25808
+ {
25809
+ name: "caller",
25810
+ type: "core::starknet::contract_address::ContractAddress"
25811
+ }
25812
+ ],
25813
+ outputs: [
25814
+ {
25815
+ type: "(core::integer::u256, core::integer::u256, core::integer::u256)"
25816
+ }
25817
+ ],
25818
+ state_mutability: "external"
25819
+ },
25820
+ {
25821
+ type: "function",
25822
+ name: "after_liquidate_position",
25823
+ inputs: [
25824
+ {
25825
+ name: "context",
25826
+ type: "vesu::data_model::Context"
25827
+ },
25828
+ {
25829
+ name: "collateral_delta",
25830
+ type: "alexandria_math::i257::i257"
25831
+ },
25832
+ {
25833
+ name: "collateral_shares_delta",
25834
+ type: "alexandria_math::i257::i257"
25835
+ },
25836
+ {
25837
+ name: "debt_delta",
25838
+ type: "alexandria_math::i257::i257"
25839
+ },
25840
+ {
25841
+ name: "nominal_debt_delta",
25842
+ type: "alexandria_math::i257::i257"
25843
+ },
25844
+ {
25845
+ name: "bad_debt",
25846
+ type: "core::integer::u256"
25847
+ },
25848
+ {
25849
+ name: "data",
25850
+ type: "core::array::Span::<core::felt252>"
25851
+ },
25852
+ {
25853
+ name: "caller",
25854
+ type: "core::starknet::contract_address::ContractAddress"
25855
+ }
25856
+ ],
25857
+ outputs: [
25858
+ {
25859
+ type: "core::bool"
25860
+ }
25861
+ ],
25862
+ state_mutability: "external"
25863
+ }
25864
+ ]
25865
+ },
25866
+ {
25867
+ type: "constructor",
25868
+ name: "constructor",
25869
+ inputs: [
25870
+ {
25871
+ name: "singleton",
25872
+ type: "core::starknet::contract_address::ContractAddress"
25873
+ },
25874
+ {
25875
+ name: "oracle_address",
25876
+ type: "core::starknet::contract_address::ContractAddress"
25877
+ },
25878
+ {
25879
+ name: "summary_address",
25880
+ type: "core::starknet::contract_address::ContractAddress"
25881
+ },
25882
+ {
25883
+ name: "v_token_class_hash",
25884
+ type: "core::felt252"
25885
+ },
25886
+ {
25887
+ name: "v_token_v2_class_hash",
25888
+ type: "core::felt252"
25889
+ },
25890
+ {
25891
+ name: "migrator",
25892
+ type: "core::starknet::contract_address::ContractAddress"
25893
+ },
25894
+ {
25895
+ name: "extension_utils_class_hash",
25896
+ type: "core::felt252"
25897
+ }
25898
+ ]
25899
+ },
25900
+ {
25901
+ type: "event",
25902
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetLiquidationConfig",
25903
+ kind: "struct",
25904
+ members: [
25905
+ {
25906
+ name: "pool_id",
25907
+ type: "core::felt252",
25908
+ kind: "key"
25909
+ },
25910
+ {
25911
+ name: "collateral_asset",
25912
+ type: "core::starknet::contract_address::ContractAddress",
25913
+ kind: "key"
25914
+ },
25915
+ {
25916
+ name: "debt_asset",
25917
+ type: "core::starknet::contract_address::ContractAddress",
25918
+ kind: "key"
25919
+ },
25920
+ {
25921
+ name: "liquidation_config",
25922
+ type: "vesu::extension::components::position_hooks::LiquidationConfig",
25923
+ kind: "data"
25924
+ }
25925
+ ]
25926
+ },
25927
+ {
25928
+ type: "event",
25929
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownConfig",
25930
+ kind: "struct",
25931
+ members: [
25932
+ {
25933
+ name: "pool_id",
25934
+ type: "core::felt252",
25935
+ kind: "key"
25936
+ },
25937
+ {
25938
+ name: "shutdown_config",
25939
+ type: "vesu::extension::components::position_hooks::ShutdownConfig",
25940
+ kind: "data"
25941
+ }
25942
+ ]
25943
+ },
25944
+ {
25945
+ type: "event",
25946
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownLTVConfig",
25947
+ kind: "struct",
25948
+ members: [
25949
+ {
25950
+ name: "pool_id",
25951
+ type: "core::felt252",
25952
+ kind: "key"
25953
+ },
25954
+ {
25955
+ name: "collateral_asset",
25956
+ type: "core::starknet::contract_address::ContractAddress",
25957
+ kind: "key"
25958
+ },
25959
+ {
25960
+ name: "debt_asset",
25961
+ type: "core::starknet::contract_address::ContractAddress",
25962
+ kind: "key"
25963
+ },
25964
+ {
25965
+ name: "shutdown_ltv_config",
25966
+ type: "vesu::data_model::LTVConfig",
25967
+ kind: "data"
25968
+ }
25969
+ ]
25970
+ },
25971
+ {
25972
+ type: "event",
25973
+ name: "vesu::extension::components::position_hooks::position_hooks_component::SetDebtCap",
25974
+ kind: "struct",
25975
+ members: [
25976
+ {
25977
+ name: "pool_id",
25978
+ type: "core::felt252",
25979
+ kind: "key"
25980
+ },
25981
+ {
25982
+ name: "collateral_asset",
25983
+ type: "core::starknet::contract_address::ContractAddress",
25984
+ kind: "key"
25985
+ },
25986
+ {
25987
+ name: "debt_asset",
25988
+ type: "core::starknet::contract_address::ContractAddress",
25989
+ kind: "key"
25990
+ },
25991
+ {
25992
+ name: "debt_cap",
25993
+ type: "core::integer::u256",
25994
+ kind: "data"
25995
+ }
25996
+ ]
25997
+ },
25998
+ {
25999
+ type: "event",
26000
+ name: "vesu::extension::components::position_hooks::position_hooks_component::Event",
26001
+ kind: "enum",
26002
+ variants: [
26003
+ {
26004
+ name: "SetLiquidationConfig",
26005
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetLiquidationConfig",
26006
+ kind: "nested"
26007
+ },
26008
+ {
26009
+ name: "SetShutdownConfig",
26010
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownConfig",
26011
+ kind: "nested"
26012
+ },
26013
+ {
26014
+ name: "SetShutdownLTVConfig",
26015
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownLTVConfig",
26016
+ kind: "nested"
26017
+ },
26018
+ {
26019
+ name: "SetDebtCap",
26020
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetDebtCap",
26021
+ kind: "nested"
26022
+ }
26023
+ ]
26024
+ },
26025
+ {
26026
+ type: "event",
26027
+ name: "vesu::extension::components::interest_rate_model::interest_rate_model_component::SetInterestRateConfig",
26028
+ kind: "struct",
26029
+ members: [
26030
+ {
26031
+ name: "pool_id",
26032
+ type: "core::felt252",
26033
+ kind: "data"
26034
+ },
26035
+ {
26036
+ name: "asset",
26037
+ type: "core::starknet::contract_address::ContractAddress",
26038
+ kind: "data"
26039
+ },
26040
+ {
26041
+ name: "interest_rate_config",
26042
+ type: "vesu::extension::components::interest_rate_model::InterestRateConfig",
26043
+ kind: "data"
26044
+ }
26045
+ ]
26046
+ },
26047
+ {
26048
+ type: "event",
26049
+ name: "vesu::extension::components::interest_rate_model::interest_rate_model_component::Event",
26050
+ kind: "enum",
26051
+ variants: [
26052
+ {
26053
+ name: "SetInterestRateConfig",
26054
+ type: "vesu::extension::components::interest_rate_model::interest_rate_model_component::SetInterestRateConfig",
26055
+ kind: "nested"
26056
+ }
26057
+ ]
26058
+ },
26059
+ {
26060
+ type: "event",
26061
+ name: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleConfig",
26062
+ kind: "struct",
26063
+ members: [
26064
+ {
26065
+ name: "pool_id",
26066
+ type: "core::felt252",
26067
+ kind: "data"
26068
+ },
26069
+ {
26070
+ name: "asset",
26071
+ type: "core::starknet::contract_address::ContractAddress",
26072
+ kind: "data"
26073
+ },
26074
+ {
26075
+ name: "oracle_config",
26076
+ type: "vesu::extension::components::pragma_oracle::OracleConfig",
26077
+ kind: "data"
26078
+ }
26079
+ ]
26080
+ },
26081
+ {
26082
+ type: "event",
26083
+ name: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleParameter",
26084
+ kind: "struct",
26085
+ members: [
26086
+ {
26087
+ name: "pool_id",
26088
+ type: "core::felt252",
26089
+ kind: "data"
26090
+ },
26091
+ {
26092
+ name: "asset",
26093
+ type: "core::starknet::contract_address::ContractAddress",
26094
+ kind: "data"
26095
+ },
26096
+ {
26097
+ name: "parameter",
26098
+ type: "core::felt252",
26099
+ kind: "data"
26100
+ },
26101
+ {
26102
+ name: "value",
26103
+ type: "core::felt252",
26104
+ kind: "data"
26105
+ }
26106
+ ]
26107
+ },
26108
+ {
26109
+ type: "event",
26110
+ name: "vesu::extension::components::pragma_oracle::pragma_oracle_component::Event",
26111
+ kind: "enum",
26112
+ variants: [
26113
+ {
26114
+ name: "SetOracleConfig",
26115
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleConfig",
26116
+ kind: "nested"
26117
+ },
26118
+ {
26119
+ name: "SetOracleParameter",
26120
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleParameter",
26121
+ kind: "nested"
26122
+ }
26123
+ ]
26124
+ },
26125
+ {
26126
+ type: "event",
26127
+ name: "vesu::map_list::map_list_component::Event",
26128
+ kind: "enum",
26129
+ variants: []
26130
+ },
26131
+ {
26132
+ type: "event",
26133
+ name: "vesu::extension::components::fee_model::fee_model_component::SetFeeConfig",
26134
+ kind: "struct",
26135
+ members: [
26136
+ {
26137
+ name: "pool_id",
26138
+ type: "core::felt252",
26139
+ kind: "key"
26140
+ },
26141
+ {
26142
+ name: "fee_config",
26143
+ type: "vesu::extension::components::fee_model::FeeConfig",
26144
+ kind: "key"
26145
+ }
26146
+ ]
26147
+ },
26148
+ {
26149
+ type: "event",
26150
+ name: "vesu::extension::components::fee_model::fee_model_component::ClaimFees",
26151
+ kind: "struct",
26152
+ members: [
26153
+ {
26154
+ name: "pool_id",
26155
+ type: "core::felt252",
26156
+ kind: "key"
26157
+ },
26158
+ {
26159
+ name: "collateral_asset",
26160
+ type: "core::starknet::contract_address::ContractAddress",
26161
+ kind: "data"
26162
+ },
26163
+ {
26164
+ name: "debt_asset",
26165
+ type: "core::starknet::contract_address::ContractAddress",
26166
+ kind: "data"
26167
+ },
26168
+ {
26169
+ name: "recipient",
26170
+ type: "core::starknet::contract_address::ContractAddress",
26171
+ kind: "data"
26172
+ },
26173
+ {
26174
+ name: "amount",
26175
+ type: "core::integer::u256",
26176
+ kind: "data"
26177
+ }
26178
+ ]
26179
+ },
26180
+ {
26181
+ type: "event",
26182
+ name: "vesu::extension::components::fee_model::fee_model_component::Event",
26183
+ kind: "enum",
26184
+ variants: [
26185
+ {
26186
+ name: "SetFeeConfig",
26187
+ type: "vesu::extension::components::fee_model::fee_model_component::SetFeeConfig",
26188
+ kind: "nested"
26189
+ },
26190
+ {
26191
+ name: "ClaimFees",
26192
+ type: "vesu::extension::components::fee_model::fee_model_component::ClaimFees",
26193
+ kind: "nested"
26194
+ }
26195
+ ]
26196
+ },
26197
+ {
26198
+ type: "event",
26199
+ name: "vesu::extension::components::tokenization::tokenization_component::CreateVToken",
26200
+ kind: "struct",
26201
+ members: [
26202
+ {
26203
+ name: "v_token",
26204
+ type: "core::starknet::contract_address::ContractAddress",
26205
+ kind: "key"
26206
+ },
26207
+ {
26208
+ name: "pool_id",
26209
+ type: "core::felt252",
26210
+ kind: "key"
26211
+ },
26212
+ {
26213
+ name: "collateral_asset",
26214
+ type: "core::starknet::contract_address::ContractAddress",
26215
+ kind: "key"
26216
+ }
26217
+ ]
26218
+ },
26219
+ {
26220
+ type: "event",
26221
+ name: "vesu::extension::components::tokenization::tokenization_component::Event",
26222
+ kind: "enum",
26223
+ variants: [
26224
+ {
26225
+ name: "CreateVToken",
26226
+ type: "vesu::extension::components::tokenization::tokenization_component::CreateVToken",
26227
+ kind: "nested"
26228
+ }
26229
+ ]
26230
+ },
26231
+ {
26232
+ type: "event",
26233
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetAssetParameter",
26234
+ kind: "struct",
26235
+ members: [
26236
+ {
26237
+ name: "pool_id",
26238
+ type: "core::felt252",
26239
+ kind: "key"
26240
+ },
26241
+ {
26242
+ name: "asset",
26243
+ type: "core::starknet::contract_address::ContractAddress",
26244
+ kind: "key"
26245
+ },
26246
+ {
26247
+ name: "parameter",
26248
+ type: "core::felt252",
26249
+ kind: "key"
26250
+ },
26251
+ {
26252
+ name: "value",
26253
+ type: "core::integer::u256",
26254
+ kind: "data"
26255
+ }
26256
+ ]
26257
+ },
26258
+ {
26259
+ type: "event",
26260
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetPoolOwner",
26261
+ kind: "struct",
26262
+ members: [
26263
+ {
26264
+ name: "pool_id",
26265
+ type: "core::felt252",
26266
+ kind: "key"
26267
+ },
26268
+ {
26269
+ name: "owner",
26270
+ type: "core::starknet::contract_address::ContractAddress",
26271
+ kind: "key"
26272
+ }
26273
+ ]
26274
+ },
26275
+ {
26276
+ type: "event",
26277
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::ContractUpgraded",
26278
+ kind: "struct",
26279
+ members: [
26280
+ {
26281
+ name: "new_implementation",
26282
+ type: "core::starknet::class_hash::ClassHash",
26283
+ kind: "data"
26284
+ }
26285
+ ]
26286
+ },
26287
+ {
26288
+ type: "event",
26289
+ name: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::Event",
26290
+ kind: "enum",
26291
+ variants: [
26292
+ {
26293
+ name: "PositionHooksEvents",
26294
+ type: "vesu::extension::components::position_hooks::position_hooks_component::Event",
26295
+ kind: "nested"
26296
+ },
26297
+ {
26298
+ name: "InterestRateModelEvents",
26299
+ type: "vesu::extension::components::interest_rate_model::interest_rate_model_component::Event",
26300
+ kind: "nested"
26301
+ },
26302
+ {
26303
+ name: "PragmaOracleEvents",
26304
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::Event",
26305
+ kind: "nested"
26306
+ },
26307
+ {
26308
+ name: "MapListEvents",
26309
+ type: "vesu::map_list::map_list_component::Event",
26310
+ kind: "nested"
26311
+ },
26312
+ {
26313
+ name: "FeeModelEvents",
26314
+ type: "vesu::extension::components::fee_model::fee_model_component::Event",
26315
+ kind: "nested"
26316
+ },
26317
+ {
26318
+ name: "TokenizationEvents",
26319
+ type: "vesu::extension::components::tokenization::tokenization_component::Event",
26320
+ kind: "nested"
26321
+ },
26322
+ {
26323
+ name: "SetAssetParameter",
26324
+ type: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetAssetParameter",
26325
+ kind: "nested"
26326
+ },
26327
+ {
26328
+ name: "SetPoolOwner",
26329
+ type: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::SetPoolOwner",
26330
+ kind: "nested"
26331
+ },
26332
+ {
26333
+ name: "CreateVToken",
26334
+ type: "vesu::extension::components::tokenization::tokenization_component::CreateVToken",
26335
+ kind: "nested"
26336
+ },
26337
+ {
26338
+ name: "SetInterestRateConfig",
26339
+ type: "vesu::extension::components::interest_rate_model::interest_rate_model_component::SetInterestRateConfig",
26340
+ kind: "nested"
26341
+ },
26342
+ {
26343
+ name: "SetOracleConfig",
26344
+ type: "vesu::extension::components::pragma_oracle::pragma_oracle_component::SetOracleConfig",
26345
+ kind: "nested"
26346
+ },
26347
+ {
26348
+ name: "SetLiquidationConfig",
26349
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetLiquidationConfig",
26350
+ kind: "nested"
26351
+ },
26352
+ {
26353
+ name: "SetDebtCap",
26354
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetDebtCap",
26355
+ kind: "nested"
26356
+ },
26357
+ {
26358
+ name: "SetShutdownLTVConfig",
26359
+ type: "vesu::extension::components::position_hooks::position_hooks_component::SetShutdownLTVConfig",
26360
+ kind: "nested"
26361
+ },
26362
+ {
26363
+ name: "ContractUpgraded",
26364
+ type: "vesu::v2::default_extension_po_v2::DefaultExtensionPOV2::ContractUpgraded",
26365
+ kind: "nested"
26366
+ }
26367
+ ]
26368
+ }
26369
+ ];
26370
+
23926
26371
  // src/strategies/universal-adapters/vesu-adapter.ts
23927
26372
  var VesuAmountType = /* @__PURE__ */ ((VesuAmountType2) => {
23928
26373
  VesuAmountType2[VesuAmountType2["Delta"] = 0] = "Delta";
@@ -23934,6 +26379,9 @@ var VesuAmountDenomination = /* @__PURE__ */ ((VesuAmountDenomination2) => {
23934
26379
  VesuAmountDenomination2[VesuAmountDenomination2["Assets"] = 1] = "Assets";
23935
26380
  return VesuAmountDenomination2;
23936
26381
  })(VesuAmountDenomination || {});
26382
+ var SCALE = BigInt(1e18);
26383
+ var UTILIZATION_SCALE = 100000n;
26384
+ var UTILIZATION_SCALE_TO_SCALE = BigInt(1e13);
23937
26385
  function getVesuMultiplyParams(isIncrease, params) {
23938
26386
  if (isIncrease) {
23939
26387
  const _params2 = params;
@@ -24039,6 +26487,8 @@ var VesuPools = {
24039
26487
  Re7xSTRK: ContractAddr.from("0x052fb52363939c3aa848f8f4ac28f0a51379f8d1b971d8444de25fbd77d8f161"),
24040
26488
  Re7xBTC: ContractAddr.from("0x3a8416bf20d036df5b1cf3447630a2e1cb04685f6b0c3a70ed7fb1473548ecf")
24041
26489
  };
26490
+ var extensionMap = {};
26491
+ extensionMap[VesuPools.Re7xSTRK.address] = ContractAddr.from("0x04e06e04b8d624d039aa1c3ca8e0aa9e21dc1ccba1d88d0d650837159e0ee054");
24042
26492
  function getVesuSingletonAddress(vesuPool) {
24043
26493
  if (vesuPool.eq(VesuPools.Genesis) || vesuPool.eq(VesuPools.Re7xSTRK)) {
24044
26494
  return { addr: VESU_SINGLETON, isV2: false };
@@ -24302,6 +26752,61 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24302
26752
  isV2
24303
26753
  };
24304
26754
  }
26755
+ async getDebtCap(config) {
26756
+ const { contract, isV2 } = await this.getVesuSingletonContract(config, this.config.poolId);
26757
+ if (!isV2) {
26758
+ const extensionAddr = extensionMap[this.config.poolId.address];
26759
+ if (!extensionAddr) {
26760
+ throw new Error("Extension address not found");
26761
+ }
26762
+ const extensionContract = new Contract8({ abi: vesu_extension_abi_default, address: extensionAddr.address, providerOrAccount: config.provider });
26763
+ const output2 = await extensionContract.call("debt_caps", [this.config.poolId.address, this.config.collateral.address.address, this.config.debt.address.address]);
26764
+ logger.verbose(`${this.config.debt.symbol}::VesuAdapter::getDebtCap debt_cap: ${output2.toString()}`);
26765
+ return Web3Number.fromWei(output2.toString(), this.config.debt.decimals);
26766
+ }
26767
+ const output = await contract.call("pair_config", [this.config.collateral.address.address, this.config.debt.address.address]);
26768
+ logger.verbose(`${this.config.debt.symbol}::VesuAdapter::getDebtCap debt_cap: ${output.debt_cap.toString()}`);
26769
+ return Web3Number.fromWei(output.debt_cap.toString(), this.config.debt.decimals);
26770
+ }
26771
+ async getMaxBorrowableByInterestRate(config, asset, maxBorrowAPY) {
26772
+ const { contract, isV2 } = await this.getVesuSingletonContract(config, this.config.poolId);
26773
+ let interestRateConfigContract = contract;
26774
+ if (!isV2) {
26775
+ const extensionAddr = extensionMap[this.config.poolId.address];
26776
+ if (!extensionAddr) {
26777
+ throw new Error("Extension address not found");
26778
+ }
26779
+ interestRateConfigContract = new Contract8({ abi: vesu_extension_abi_default, address: extensionAddr.address, providerOrAccount: config.provider });
26780
+ }
26781
+ const _interestRateConfig = await interestRateConfigContract.call(
26782
+ "interest_rate_config",
26783
+ isV2 ? [this.config.debt.address.address] : [this.config.poolId.address, this.config.debt.address.address]
26784
+ );
26785
+ const interestRateConfig = {
26786
+ target_utilization: _interestRateConfig.target_utilization,
26787
+ zero_utilization_rate: _interestRateConfig.zero_utilization_rate,
26788
+ target_rate_percent: _interestRateConfig.target_rate_percent,
26789
+ min_target_utilization: _interestRateConfig.min_target_utilization,
26790
+ max_target_utilization: _interestRateConfig.max_target_utilization,
26791
+ rate_half_life: _interestRateConfig.rate_half_life,
26792
+ min_full_utilization_rate: _interestRateConfig.min_full_utilization_rate,
26793
+ max_full_utilization_rate: _interestRateConfig.max_full_utilization_rate
26794
+ };
26795
+ const _assetConfig = await contract.call(
26796
+ isV2 ? "asset_config" : "asset_config_unsafe",
26797
+ isV2 ? [asset.address.address] : [this.config.poolId.address, asset.address.address]
26798
+ );
26799
+ const assetConfig = isV2 ? _assetConfig : _assetConfig["0"];
26800
+ const timeDelta = assetConfig.last_updated;
26801
+ const lastFullUtilizationRate = assetConfig.last_full_utilization_rate;
26802
+ const totalSupply = new Web3Number((Number(assetConfig.total_nominal_debt) / 1e18).toFixed(9), asset.decimals).plus(Web3Number.fromWei(assetConfig.reserve, asset.decimals));
26803
+ const ratePerSecond = BigInt(Math.round(maxBorrowAPY / 365 / 24 / 60 / 60 * Number(SCALE)));
26804
+ const maxUtilisation = this.getMaxUtilizationGivenRatePerSecond(interestRateConfig, ratePerSecond, timeDelta, lastFullUtilizationRate);
26805
+ logger.verbose(`${asset.symbol}::VesuAdapter::getMaxBorrowableByInterestRate maxUtilisation: ${Number(maxUtilisation) / 1e18}, totalSupply: ${totalSupply.toString()}`);
26806
+ const maxDebtToHave = totalSupply.multipliedBy(Number(maxUtilisation) / 1e18);
26807
+ const currentDebt = new Web3Number((Number(assetConfig.total_nominal_debt) / 1e18).toFixed(9), asset.decimals);
26808
+ return maxDebtToHave.minus(currentDebt);
26809
+ }
24305
26810
  async getLTVConfig(config) {
24306
26811
  const CACHE_KEY = "ltv_config";
24307
26812
  const cacheData = this.getCache(CACHE_KEY);
@@ -24317,6 +26822,9 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24317
26822
  const output = await contract.call("ltv_config", [this.config.poolId.address, this.config.collateral.address.address, this.config.debt.address.address]);
24318
26823
  ltv = Number(output.max_ltv) / 1e18;
24319
26824
  }
26825
+ if (ltv == 0) {
26826
+ throw new Error("LTV is 0");
26827
+ }
24320
26828
  this.setCache(CACHE_KEY, ltv, 3e5);
24321
26829
  return this.getCache(CACHE_KEY);
24322
26830
  }
@@ -24451,6 +26959,78 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24451
26959
  Global.setGlobalCache(CACHE_KEY, { pools, isErrorPoolsAPI }, 3e5);
24452
26960
  return { pools, isErrorPoolsAPI };
24453
26961
  }
26962
+ fullUtilizationRate(interestRateConfig, timeDelta, utilization, fullUtilizationRate) {
26963
+ const {
26964
+ min_target_utilization,
26965
+ max_target_utilization,
26966
+ rate_half_life,
26967
+ min_full_utilization_rate,
26968
+ max_full_utilization_rate
26969
+ } = interestRateConfig;
26970
+ const halfLifeScaled = rate_half_life * SCALE;
26971
+ let nextFullUtilizationRate;
26972
+ if (utilization < min_target_utilization) {
26973
+ const utilizationDelta = (min_target_utilization - utilization) * SCALE / min_target_utilization;
26974
+ const decay = halfLifeScaled + utilizationDelta * timeDelta;
26975
+ nextFullUtilizationRate = fullUtilizationRate * halfLifeScaled / decay;
26976
+ } else if (utilization > max_target_utilization) {
26977
+ const utilizationDelta = (utilization - max_target_utilization) * SCALE / (UTILIZATION_SCALE - max_target_utilization);
26978
+ const growth = halfLifeScaled + utilizationDelta * timeDelta;
26979
+ nextFullUtilizationRate = fullUtilizationRate * growth / halfLifeScaled;
26980
+ } else {
26981
+ nextFullUtilizationRate = fullUtilizationRate;
26982
+ }
26983
+ if (nextFullUtilizationRate > max_full_utilization_rate) {
26984
+ return max_full_utilization_rate;
26985
+ } else if (nextFullUtilizationRate < min_full_utilization_rate) {
26986
+ return min_full_utilization_rate;
26987
+ } else {
26988
+ return nextFullUtilizationRate;
26989
+ }
26990
+ }
26991
+ /**
26992
+ * Calculates new interest rate per second and next full utilization rate.
26993
+ */
26994
+ calculateInterestRate(interestRateConfig, utilization, timeDelta, lastFullUtilizationRate) {
26995
+ const scaledUtilization = utilization / UTILIZATION_SCALE_TO_SCALE;
26996
+ const {
26997
+ target_utilization,
26998
+ zero_utilization_rate,
26999
+ target_rate_percent
27000
+ } = interestRateConfig;
27001
+ const nextFullUtilizationRate = this.fullUtilizationRate(
27002
+ interestRateConfig,
27003
+ timeDelta,
27004
+ scaledUtilization,
27005
+ lastFullUtilizationRate
27006
+ );
27007
+ const targetRate = (nextFullUtilizationRate - zero_utilization_rate) * target_rate_percent / SCALE + zero_utilization_rate;
27008
+ let newRatePerSecond;
27009
+ if (scaledUtilization < target_utilization) {
27010
+ newRatePerSecond = zero_utilization_rate + scaledUtilization * (targetRate - zero_utilization_rate) / target_utilization;
27011
+ } else {
27012
+ newRatePerSecond = targetRate + (scaledUtilization - target_utilization) * (nextFullUtilizationRate - targetRate) / (UTILIZATION_SCALE - target_utilization);
27013
+ }
27014
+ return { newRatePerSecond, nextFullUtilizationRate };
27015
+ }
27016
+ /**
27017
+ * Calculates utilization given a specific rate per second.
27018
+ * This is an inverse function of the piecewise interest rate formula above.
27019
+ */
27020
+ getMaxUtilizationGivenRatePerSecond(interestRateConfig, ratePerSecond, timeDelta, last_full_utilization_rate) {
27021
+ logger.verbose(`VesuAdapter::getMaxUtilizationGivenRatePerSecond ratePerSecond: ${Number(ratePerSecond) / 1e18}, timeDelta: ${Number(timeDelta) / 1e18}, last_full_utilization_rate: ${Number(last_full_utilization_rate) / 1e18}`);
27022
+ let utilization = 0n;
27023
+ let nextUtilization = SCALE / 100n;
27024
+ while (utilization <= SCALE) {
27025
+ logger.verbose(`VesuAdapter::getMaxUtilizationGivenRatePerSecond utilization: ${Number(utilization) / 1e18}, nextUtilization: ${Number(nextUtilization) / 1e18}`);
27026
+ const { newRatePerSecond } = this.calculateInterestRate(interestRateConfig, utilization, timeDelta, last_full_utilization_rate);
27027
+ if (newRatePerSecond > ratePerSecond) {
27028
+ return utilization;
27029
+ }
27030
+ utilization += nextUtilization;
27031
+ }
27032
+ throw new Error("Max utilization not found");
27033
+ }
24454
27034
  };
24455
27035
 
24456
27036
  // src/strategies/universal-strategy.tsx
@@ -26787,21 +29367,7 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
26787
29367
  usdValue
26788
29368
  };
26789
29369
  }
26790
- /**
26791
- * Calculates the weighted average APY across all pools based on USD value.
26792
- * @returns {Promise<number>} The weighted average APY across all pools
26793
- */
26794
- async netAPY() {
26795
- if (this.metadata.isPreview) {
26796
- return { net: 0, splits: [{
26797
- apy: 0,
26798
- id: "base"
26799
- }, {
26800
- apy: 0,
26801
- id: "defispring"
26802
- }] };
26803
- }
26804
- const prevAUM = await this.getPrevAUM();
29370
+ async getVesuAPYs() {
26805
29371
  const vesuAdapters = this.getVesuAdapters();
26806
29372
  const allVesuPools = await VesuAdapter.getVesuPools();
26807
29373
  const pools = vesuAdapters.map((vesuAdapter) => {
@@ -26829,7 +29395,18 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
26829
29395
  logger.verbose(`${this.metadata.name}::netAPY: baseAPYs: ${JSON.stringify(baseAPYs)}`);
26830
29396
  logger.verbose(`${this.metadata.name}::netAPY: rewardAPYs: ${JSON.stringify(rewardAPYs)}`);
26831
29397
  assert(baseAPYs.length == positions.length, "APYs and positions length mismatch");
26832
- if (positions.every((p) => p.amount.isZero())) {
29398
+ return {
29399
+ baseAPYs,
29400
+ rewardAPYs,
29401
+ positions
29402
+ };
29403
+ }
29404
+ /**
29405
+ * Calculates the weighted average APY across all pools based on USD value.
29406
+ * @returns {Promise<number>} The weighted average APY across all pools
29407
+ */
29408
+ async netAPY() {
29409
+ if (this.metadata.isPreview) {
26833
29410
  return { net: 0, splits: [{
26834
29411
  apy: 0,
26835
29412
  id: "base"
@@ -26838,11 +29415,25 @@ var UniversalStrategy = class _UniversalStrategy extends BaseStrategy {
26838
29415
  id: "defispring"
26839
29416
  }] };
26840
29417
  }
29418
+ const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
26841
29419
  const unusedBalanceAPY = await this.getUnusedBalanceAPY();
26842
29420
  baseAPYs.push(...[unusedBalanceAPY.apy]);
26843
29421
  rewardAPYs.push(0);
26844
29422
  const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
26845
29423
  weights.push(unusedBalanceAPY.weight);
29424
+ return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
29425
+ }
29426
+ async returnNetAPY(baseAPYs, rewardAPYs, weights) {
29427
+ if (weights.every((p) => p == 0)) {
29428
+ return { net: 0, splits: [{
29429
+ apy: 0,
29430
+ id: "base"
29431
+ }, {
29432
+ apy: 0,
29433
+ id: "defispring"
29434
+ }] };
29435
+ }
29436
+ const prevAUM = await this.getPrevAUM();
26846
29437
  const price = await this.pricer.getPrice(this.metadata.depositTokens[0].symbol);
26847
29438
  const prevAUMUSD = prevAUM.multipliedBy(price.price);
26848
29439
  const baseAPY = this.computeAPY(baseAPYs, weights, prevAUMUSD);
@@ -27680,13 +30271,31 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27680
30271
  getTag() {
27681
30272
  return `${_UniversalLstMultiplierStrategy.name}:${this.metadata.name}`;
27682
30273
  }
30274
+ // Vesu adapter with LST and base token match
30275
+ getVesuSameTokenAdapter() {
30276
+ const baseAdapter = this.getAdapter("vesu_leg1_adapter" /* VESU_LEG1 */);
30277
+ baseAdapter.networkConfig = this.config;
30278
+ baseAdapter.pricer = this.pricer;
30279
+ return baseAdapter;
30280
+ }
27683
30281
  // only one leg is used
27684
30282
  // todo support lending assets of underlying as well (like if xSTRK looping is not viable, simply supply STRK)
27685
30283
  getVesuAdapters() {
27686
- const vesuAdapter1 = this.getAdapter("vesu_leg1_adapter" /* VESU_LEG1 */);
27687
- vesuAdapter1.pricer = this.pricer;
27688
- vesuAdapter1.networkConfig = this.config;
27689
- return [vesuAdapter1];
30284
+ const adapters = [];
30285
+ const baseAdapter = this.getVesuSameTokenAdapter();
30286
+ for (const asset of this.metadata.additionalInfo.borrowable_assets) {
30287
+ const vesuAdapter1 = new VesuAdapter({
30288
+ poolId: baseAdapter.config.poolId,
30289
+ collateral: this.asset(),
30290
+ debt: asset,
30291
+ vaultAllocator: this.metadata.additionalInfo.vaultAllocator,
30292
+ id: ""
30293
+ });
30294
+ vesuAdapter1.pricer = this.pricer;
30295
+ vesuAdapter1.networkConfig = this.config;
30296
+ adapters.push(vesuAdapter1);
30297
+ }
30298
+ return adapters;
27690
30299
  }
27691
30300
  // not applicable for this strategy
27692
30301
  // No rewards on collateral or borrowing of LST assets
@@ -27714,7 +30323,8 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27714
30323
  async getAvnuSwapMultiplyCall(params) {
27715
30324
  return this._getAvnuDepositSwapLegCall({
27716
30325
  ...params,
27717
- minHF: 1.02
30326
+ minHF: 1.1
30327
+ // undo
27718
30328
  });
27719
30329
  }
27720
30330
  async _getAvnuDepositSwapLegCall(params) {
@@ -27737,6 +30347,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27737
30347
  const totalDebtAmount = totalCollateral.multipliedBy(collateralPrice).multipliedBy(legLTV).dividedBy(debtPrice).dividedBy(params.minHF);
27738
30348
  logger.verbose(`${this.getTag()}::_getAvnuDepositSwapLegCall totalDebtAmount: ${totalDebtAmount}`);
27739
30349
  const debtAmount = totalDebtAmount.minus(existingDebtInfo.amount);
30350
+ logger.verbose(`${this.getTag()}::_getAvnuDepositSwapLegCall debtAmount: ${debtAmount}`);
27740
30351
  if (debtAmount.lt(0)) {
27741
30352
  const lstDEXPrice = await this.getLSTDexPrice();
27742
30353
  const debtAmountInLST = debtAmount.abs().dividedBy(lstDEXPrice);
@@ -27744,10 +30355,9 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27744
30355
  isDeposit: false,
27745
30356
  leg1DepositAmount: debtAmountInLST
27746
30357
  });
27747
- assert(calls.length == 1, "Expected 1 call for unwind");
30358
+ assert(calls.length == 1, `Expected 1 call for unwind, got ${calls.length}`);
27748
30359
  return calls[0];
27749
30360
  }
27750
- logger.verbose(`${this.getTag()}::_getAvnuDepositSwapLegCall debtAmount: ${debtAmount}`);
27751
30361
  const STEP0 = "approve_token1" /* APPROVE_TOKEN1 */;
27752
30362
  const manage0Info = this.getProofs(STEP0);
27753
30363
  const manageCall0 = manage0Info.callConstructor({
@@ -27852,10 +30462,32 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27852
30462
  return { shouldRebalance: false, manageCall: void 0 };
27853
30463
  }
27854
30464
  }
30465
+ async getVesuAUM(adapter) {
30466
+ const legAUM = await adapter.getPositions(this.config);
30467
+ const underlying = this.asset();
30468
+ assert(underlying.symbol.startsWith("x"), "Underlying is not an LST of Endur");
30469
+ let vesuAum = Web3Number.fromWei("0", underlying.decimals);
30470
+ let tokenUnderlyingPrice = await this.getLSTExchangeRate();
30471
+ tokenUnderlyingPrice = tokenUnderlyingPrice * 0.998;
30472
+ logger.verbose(`${this.getTag()} tokenUnderlyingPrice: ${tokenUnderlyingPrice}`);
30473
+ if (legAUM[0].token.address.eq(underlying.address)) {
30474
+ vesuAum = vesuAum.plus(legAUM[0].amount);
30475
+ } else {
30476
+ vesuAum = vesuAum.plus(legAUM[0].amount.dividedBy(tokenUnderlyingPrice));
30477
+ }
30478
+ if (legAUM[1].token.address.eq(underlying.address)) {
30479
+ vesuAum = vesuAum.minus(legAUM[1].amount);
30480
+ } else {
30481
+ vesuAum = vesuAum.minus(legAUM[1].amount.dividedBy(tokenUnderlyingPrice));
30482
+ }
30483
+ ;
30484
+ logger.verbose(`${this.getTag()} Vesu AUM: ${vesuAum}, legCollateral: ${legAUM[0].amount.toNumber()}, legDebt: ${legAUM[1].amount.toNumber()}`);
30485
+ return vesuAum;
30486
+ }
27855
30487
  //
27856
30488
  async _getMinOutputAmountLSTBuy(amountInUnderlying) {
27857
30489
  const lstTruePrice = await this.getLSTExchangeRate();
27858
- const minOutputAmount = amountInUnderlying.dividedBy(lstTruePrice);
30490
+ const minOutputAmount = amountInUnderlying.dividedBy(lstTruePrice).multipliedBy(0.99979);
27859
30491
  return minOutputAmount;
27860
30492
  }
27861
30493
  async _getMinOutputAmountLSTSell(amountInLST) {
@@ -27874,6 +30506,10 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27874
30506
  const [vesuAdapter1] = this.getVesuAdapters();
27875
30507
  const legLTV = await vesuAdapter1.getLTVConfig(this.config);
27876
30508
  logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
30509
+ if (!params.isDeposit) {
30510
+ const unusedBalance = await this.getUnusedBalance();
30511
+ logger.verbose(`${this.getTag()}::getVesuMultiplyCall unusedBalance: ${unusedBalance.amount.toString()}, required: ${params.leg1DepositAmount.toString()}`);
30512
+ }
27877
30513
  const existingPositions = await vesuAdapter1.getPositions(this.config);
27878
30514
  const collateralisation = await vesuAdapter1.getCollateralization(this.config);
27879
30515
  const existingCollateralInfo = existingPositions[0];
@@ -27906,16 +30542,34 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27906
30542
  });
27907
30543
  }
27908
30544
  getLSTUnderlyingTokenInfo() {
27909
- const [vesuAdapter1] = this.getVesuAdapters();
30545
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
27910
30546
  return vesuAdapter1.config.debt;
27911
30547
  }
30548
+ async getMaxBorrowableAmount() {
30549
+ const vesuAdapters = this.getVesuAdapters();
30550
+ let netMaxBorrowableAmount = Web3Number.fromWei("0", this.getLSTUnderlyingTokenInfo().decimals);
30551
+ const maxBorrowables = [];
30552
+ const lstAPY = await this.getLSTAPR(this.getLSTUnderlyingTokenInfo().address);
30553
+ const maxInterestRate = lstAPY * 0.8;
30554
+ for (const vesuAdapter of vesuAdapters) {
30555
+ const maxBorrowableAmount = await vesuAdapter.getMaxBorrowableByInterestRate(this.config, vesuAdapter.config.debt, maxInterestRate);
30556
+ const debtCap = await vesuAdapter.getDebtCap(this.config);
30557
+ maxBorrowables.push({ amount: maxBorrowableAmount.minimum(debtCap), borrowableAsset: vesuAdapter.config.debt });
30558
+ }
30559
+ maxBorrowables.sort((a, b) => b.amount.toNumber() - a.amount.toNumber());
30560
+ netMaxBorrowableAmount = maxBorrowables.reduce((acc, curr) => acc.plus(curr.amount), Web3Number.fromWei("0", this.getLSTUnderlyingTokenInfo().decimals));
30561
+ return { netMaxBorrowableAmount, maxBorrowables };
30562
+ }
30563
+ // todo how much to unwind to get back healthy APY zone again
30564
+ // if net APY < LST APR + 0.5%, we need to unwind to get back to LST APR + 1% atleast or 0 vesu position
30565
+ // For xSTRK, simply deposit in Vesu if looping is not viable
27912
30566
  /**
27913
30567
  * Gets LST APR for the strategy's underlying asset from Endur API
27914
30568
  * @returns Promise<number> The LST APR (not divided by 1e18)
27915
30569
  */
27916
30570
  async getLSTAPR(_address) {
27917
30571
  try {
27918
- const vesuAdapter1 = this.getVesuAdapters()[0];
30572
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
27919
30573
  const apr = await LSTAPRService.getLSTAPR(vesuAdapter1.config.debt.address);
27920
30574
  if (!apr) {
27921
30575
  throw new Error("Failed to get LST APR");
@@ -27928,21 +30582,41 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27928
30582
  }
27929
30583
  // todo undo this
27930
30584
  async netAPY() {
27931
- const { net, splits } = await super.netAPY();
27932
- let _net = net;
27933
- if (this.asset().symbol == "xWBTC") {
27934
- const debtToken = this.getVesuAdapters()[0].config.debt;
27935
- const lstAPY = await this.getLSTAPR(debtToken.address);
27936
- _net = lstAPY * 5;
30585
+ const unusedBalance = await this.getUnusedBalance();
30586
+ const maxNewDeposits = await this.maxNewDeposits();
30587
+ if (maxNewDeposits * 1.5 < unusedBalance.amount.toNumber()) {
30588
+ return super.netAPY();
30589
+ } else {
30590
+ const { positions, baseAPYs, rewardAPYs } = await this.getVesuAPYs();
30591
+ const weights = positions.map((p, index) => p.usdValue * (index % 2 == 0 ? 1 : -1));
30592
+ return this.returnNetAPY(baseAPYs, rewardAPYs, weights);
27937
30593
  }
27938
- return {
27939
- net: _net,
27940
- splits
27941
- };
27942
30594
  }
30595
+ async maxNewDeposits() {
30596
+ const maxBorrowableAmounts = await this.getMaxBorrowableAmount();
30597
+ let ltv = void 0;
30598
+ for (let adapter of this.getVesuAdapters()) {
30599
+ const maxBorrowableAmount = maxBorrowableAmounts.maxBorrowables.find((b) => b.borrowableAsset.address.eq(adapter.config.debt.address))?.amount;
30600
+ if (!maxBorrowableAmount) {
30601
+ throw new Error(`Max borrowable amount not found for adapter: ${adapter.config.debt.symbol}`);
30602
+ }
30603
+ const maxLTV = await adapter.getLTVConfig(this.config);
30604
+ if (!ltv) {
30605
+ ltv = maxLTV;
30606
+ } else if (ltv != maxLTV) {
30607
+ throw new Error(`LTV mismatch for adapter: ${adapter.config.debt.symbol}`);
30608
+ }
30609
+ }
30610
+ if (!ltv) {
30611
+ throw new Error("LTV not found");
30612
+ }
30613
+ const numerator = this.metadata.additionalInfo.targetHealthFactor * maxBorrowableAmounts.netMaxBorrowableAmount.toNumber() / ltv;
30614
+ return numerator - maxBorrowableAmounts.netMaxBorrowableAmount.toNumber();
30615
+ }
30616
+ // todo revisit cases where 0th adapters is used
27943
30617
  async getUnusedBalanceAPY() {
27944
30618
  const unusedBalance = await this.getUnusedBalance();
27945
- const vesuAdapter = this.getVesuAdapters()[0];
30619
+ const vesuAdapter = this.getVesuSameTokenAdapter();
27946
30620
  const underlying = vesuAdapter.config.debt;
27947
30621
  const lstAPY = await this.getLSTAPR(underlying.address);
27948
30622
  return {
@@ -27951,7 +30625,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27951
30625
  };
27952
30626
  }
27953
30627
  async getLSTExchangeRate() {
27954
- const [vesuAdapter1] = this.getVesuAdapters();
30628
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
27955
30629
  const lstTokenInfo = vesuAdapter1.config.collateral;
27956
30630
  const lstABI = new Contract10({
27957
30631
  abi: erc4626_abi_default,
@@ -27970,7 +30644,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
27970
30644
  async getModifyLeverCall(params) {
27971
30645
  logger.verbose(`${this.getTag()}::getModifyLeverCall marginAmount: ${params.marginAmount}, debtAmount: ${params.debtAmount}, lstDexPriceInUnderlying: ${params.lstDexPriceInUnderlying}, isIncrease: ${params.isIncrease}`);
27972
30646
  assert(!params.marginAmount.isZero() || !params.debtAmount.isZero(), "Deposit/debt must be non-0");
27973
- const [vesuAdapter1] = this.getVesuAdapters();
30647
+ const vesuAdapter1 = this.getVesuSameTokenAdapter();
27974
30648
  const lstTokenInfo = this.asset();
27975
30649
  const lstUnderlyingTokenInfo = vesuAdapter1.config.debt;
27976
30650
  const maxAmounts = lstTokenInfo.symbol == "xSTRK" ? 5e5 : 0.5;
@@ -28207,6 +30881,12 @@ var _riskFactor4 = [
28207
30881
  { 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." },
28208
30882
  { type: "Depeg Risk" /* DEPEG_RISK */, value: 2 /* GENERALLY_STABLE */, weight: 25, reason: "Generally stable pegged assets" }
28209
30883
  ];
30884
+ var borrowableAssets = [
30885
+ "WBTC",
30886
+ "tBTC",
30887
+ "LBTC",
30888
+ "solvBTC"
30889
+ ];
28210
30890
  var hyperxSTRK = {
28211
30891
  vaultAddress: ContractAddr.from("0x46c7a54c82b1fe374353859f554a40b8bd31d3e30f742901579e7b57b1b5960"),
28212
30892
  manager: ContractAddr.from("0x5d499cd333757f461a0bedaca3dfc4d77320c773037e0aa299f22a6dbfdc03a"),
@@ -28216,7 +30896,8 @@ var hyperxSTRK = {
28216
30896
  leafAdapters: [],
28217
30897
  adapters: [],
28218
30898
  targetHealthFactor: 1.1,
28219
- minHealthFactor: 1.05
30899
+ minHealthFactor: 1.05,
30900
+ borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "STRK")
28220
30901
  };
28221
30902
  var hyperxWBTC = {
28222
30903
  vaultAddress: ContractAddr.from("0x2da9d0f96a46b453f55604313785dc866424240b1c6811d13bef594343db818"),
@@ -28227,7 +30908,8 @@ var hyperxWBTC = {
28227
30908
  leafAdapters: [],
28228
30909
  adapters: [],
28229
30910
  targetHealthFactor: 1.1,
28230
- minHealthFactor: 1.05
30911
+ minHealthFactor: 1.05,
30912
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
28231
30913
  };
28232
30914
  var hyperxtBTC = {
28233
30915
  vaultAddress: ContractAddr.from("0x47d5f68477e5637ce0e56436c6b5eee5a354e6828995dae106b11a48679328"),
@@ -28238,7 +30920,8 @@ var hyperxtBTC = {
28238
30920
  leafAdapters: [],
28239
30921
  adapters: [],
28240
30922
  targetHealthFactor: 1.1,
28241
- minHealthFactor: 1.05
30923
+ minHealthFactor: 1.05,
30924
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
28242
30925
  };
28243
30926
  var hyperxsBTC = {
28244
30927
  vaultAddress: ContractAddr.from("0x437ef1e7d0f100b2e070b7a65cafec0b2be31b0290776da8b4112f5473d8d9"),
@@ -28249,7 +30932,8 @@ var hyperxsBTC = {
28249
30932
  leafAdapters: [],
28250
30933
  adapters: [],
28251
30934
  targetHealthFactor: 1.1,
28252
- minHealthFactor: 1.05
30935
+ minHealthFactor: 1.05,
30936
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
28253
30937
  };
28254
30938
  var hyperxLBTC = {
28255
30939
  vaultAddress: ContractAddr.from("0x64cf24d4883fe569926419a0569ab34497c6956a1a308fa883257f7486d7030"),
@@ -28260,7 +30944,8 @@ var hyperxLBTC = {
28260
30944
  leafAdapters: [],
28261
30945
  adapters: [],
28262
30946
  targetHealthFactor: 1.1,
28263
- minHealthFactor: 1.05
30947
+ minHealthFactor: 1.05,
30948
+ borrowable_assets: borrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset))
28264
30949
  };
28265
30950
  function getInvestmentSteps(lstSymbol, underlyingSymbol) {
28266
30951
  return [
@@ -28291,7 +30976,8 @@ function getStrategySettings(lstSymbol, underlyingSymbol, addresses, isPreview =
28291
30976
  contractDetails: getContractDetails(addresses),
28292
30977
  faqs: getFAQs2(lstSymbol, underlyingSymbol),
28293
30978
  investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
28294
- isPreview
30979
+ isPreview,
30980
+ apyMethodology: "Current annualized APY in terms of base asset of the LST"
28295
30981
  };
28296
30982
  }
28297
30983
  var HyperLSTStrategies = [
@@ -28351,6 +31037,7 @@ export {
28351
31037
  VesuRebalanceStrategies,
28352
31038
  Web3Number,
28353
31039
  ZkLend,
31040
+ extensionMap,
28354
31041
  getContractDetails,
28355
31042
  getMainnetConfig,
28356
31043
  getNoRiskTags,