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