@strkfarm/sdk 1.1.34 → 1.1.35

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