@optimex-xyz/market-maker-sdk 0.9.0-dev-aaad824 → 0.9.0-dev-6069ee6

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.d.mts CHANGED
@@ -988,16 +988,14 @@ interface ERC20 extends BaseContract {
988
988
  };
989
989
  }
990
990
 
991
- interface LendingLiquidationInterface extends Interface {
992
- getFunction(nameOrSignature: "LENDING_MANAGEMENT" | "MORPHO" | "VALIDATOR_FORCE_CLOSE_TYPEHASH" | "eip712Domain" | "onMorphoLiquidate" | "optimexDomain" | "owBtc" | "payment"): FunctionFragment;
993
- getEvent(nameOrSignatureOrTopic: "EIP712DomainChanged" | "ForceClose" | "Liquidate" | "Payment"): EventFragment;
994
- encodeFunctionData(functionFragment: "LENDING_MANAGEMENT", values?: undefined): string;
995
- encodeFunctionData(functionFragment: "MORPHO", values?: undefined): string;
996
- encodeFunctionData(functionFragment: "VALIDATOR_FORCE_CLOSE_TYPEHASH", values?: undefined): string;
991
+ interface MorphoLiquidatorInterface extends Interface {
992
+ getFunction(nameOrSignature: "MORPHO_MANAGEMENT" | "eip712Domain" | "onMorphoLiquidate" | "onMorphoRepay" | "optimexDomain" | "payment"): FunctionFragment;
993
+ getEvent(nameOrSignatureOrTopic: "EIP712DomainChanged" | "ForceClose" | "Liquidate" | "OnMorphoLiquidate" | "OnMorphoRepay" | "Payment" | "ProfitTaken" | "Refunded"): EventFragment;
994
+ encodeFunctionData(functionFragment: "MORPHO_MANAGEMENT", values?: undefined): string;
997
995
  encodeFunctionData(functionFragment: "eip712Domain", values?: undefined): string;
998
996
  encodeFunctionData(functionFragment: "onMorphoLiquidate", values: [BigNumberish, BytesLike]): string;
997
+ encodeFunctionData(functionFragment: "onMorphoRepay", values: [BigNumberish, BytesLike]): string;
999
998
  encodeFunctionData(functionFragment: "optimexDomain", values?: undefined): string;
1000
- encodeFunctionData(functionFragment: "owBtc", values?: undefined): string;
1001
999
  encodeFunctionData(functionFragment: "payment", values: [
1002
1000
  BytesLike,
1003
1001
  AddressLike,
@@ -1006,13 +1004,11 @@ interface LendingLiquidationInterface extends Interface {
1006
1004
  boolean,
1007
1005
  BytesLike
1008
1006
  ]): string;
1009
- decodeFunctionResult(functionFragment: "LENDING_MANAGEMENT", data: BytesLike): Result;
1010
- decodeFunctionResult(functionFragment: "MORPHO", data: BytesLike): Result;
1011
- decodeFunctionResult(functionFragment: "VALIDATOR_FORCE_CLOSE_TYPEHASH", data: BytesLike): Result;
1007
+ decodeFunctionResult(functionFragment: "MORPHO_MANAGEMENT", data: BytesLike): Result;
1012
1008
  decodeFunctionResult(functionFragment: "eip712Domain", data: BytesLike): Result;
1013
1009
  decodeFunctionResult(functionFragment: "onMorphoLiquidate", data: BytesLike): Result;
1010
+ decodeFunctionResult(functionFragment: "onMorphoRepay", data: BytesLike): Result;
1014
1011
  decodeFunctionResult(functionFragment: "optimexDomain", data: BytesLike): Result;
1015
- decodeFunctionResult(functionFragment: "owBtc", data: BytesLike): Result;
1016
1012
  decodeFunctionResult(functionFragment: "payment", data: BytesLike): Result;
1017
1013
  }
1018
1014
  declare namespace EIP712DomainChangedEvent$1 {
@@ -1029,26 +1025,26 @@ declare namespace ForceCloseEvent {
1029
1025
  type InputTuple = [
1030
1026
  positionManager: AddressLike,
1031
1027
  positionId: BytesLike,
1032
- tradeId: BytesLike,
1033
1028
  marketId: BytesLike,
1034
- repaidLoan: BigNumberish,
1035
- userRefund: BigNumberish
1029
+ totalCollateral: BigNumberish,
1030
+ totalPayment: BigNumberish,
1031
+ repaidDebt: BigNumberish
1036
1032
  ];
1037
1033
  type OutputTuple = [
1038
1034
  positionManager: string,
1039
1035
  positionId: string,
1040
- tradeId: string,
1041
1036
  marketId: string,
1042
- repaidLoan: bigint,
1043
- userRefund: bigint
1037
+ totalCollateral: bigint,
1038
+ totalPayment: bigint,
1039
+ repaidDebt: bigint
1044
1040
  ];
1045
1041
  interface OutputObject {
1046
1042
  positionManager: string;
1047
1043
  positionId: string;
1048
- tradeId: string;
1049
1044
  marketId: string;
1050
- repaidLoan: bigint;
1051
- userRefund: bigint;
1045
+ totalCollateral: bigint;
1046
+ totalPayment: bigint;
1047
+ repaidDebt: bigint;
1052
1048
  }
1053
1049
  type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1054
1050
  type Filter = TypedDeferredTopicFilter<Event>;
@@ -1059,32 +1055,71 @@ declare namespace LiquidateEvent {
1059
1055
  type InputTuple = [
1060
1056
  positionManager: AddressLike,
1061
1057
  positionId: BytesLike,
1062
- tradeId: BytesLike,
1063
1058
  marketId: BytesLike,
1059
+ totalCollateral: BigNumberish,
1064
1060
  seizedCollateral: BigNumberish,
1065
- remainingCollateral: BigNumberish,
1066
- repaidLoan: BigNumberish,
1067
- bonusLoan: BigNumberish
1061
+ totalPayment: BigNumberish,
1062
+ repaidDebt: BigNumberish
1068
1063
  ];
1069
1064
  type OutputTuple = [
1070
1065
  positionManager: string,
1071
1066
  positionId: string,
1072
- tradeId: string,
1073
1067
  marketId: string,
1068
+ totalCollateral: bigint,
1074
1069
  seizedCollateral: bigint,
1075
- remainingCollateral: bigint,
1076
- repaidLoan: bigint,
1077
- bonusLoan: bigint
1070
+ totalPayment: bigint,
1071
+ repaidDebt: bigint
1078
1072
  ];
1079
1073
  interface OutputObject {
1080
1074
  positionManager: string;
1081
1075
  positionId: string;
1082
- tradeId: string;
1083
1076
  marketId: string;
1077
+ totalCollateral: bigint;
1084
1078
  seizedCollateral: bigint;
1085
- remainingCollateral: bigint;
1086
- repaidLoan: bigint;
1087
- bonusLoan: bigint;
1079
+ totalPayment: bigint;
1080
+ repaidDebt: bigint;
1081
+ }
1082
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1083
+ type Filter = TypedDeferredTopicFilter<Event>;
1084
+ type Log = TypedEventLog<Event>;
1085
+ type LogDescription = TypedLogDescription<Event>;
1086
+ }
1087
+ declare namespace OnMorphoLiquidateEvent {
1088
+ type InputTuple = [
1089
+ positionManager: AddressLike,
1090
+ repaidAssets: BigNumberish,
1091
+ data: BytesLike
1092
+ ];
1093
+ type OutputTuple = [
1094
+ positionManager: string,
1095
+ repaidAssets: bigint,
1096
+ data: string
1097
+ ];
1098
+ interface OutputObject {
1099
+ positionManager: string;
1100
+ repaidAssets: bigint;
1101
+ data: string;
1102
+ }
1103
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1104
+ type Filter = TypedDeferredTopicFilter<Event>;
1105
+ type Log = TypedEventLog<Event>;
1106
+ type LogDescription = TypedLogDescription<Event>;
1107
+ }
1108
+ declare namespace OnMorphoRepayEvent {
1109
+ type InputTuple = [
1110
+ positionManager: AddressLike,
1111
+ repaidAssets: BigNumberish,
1112
+ data: BytesLike
1113
+ ];
1114
+ type OutputTuple = [
1115
+ positionManager: string,
1116
+ repaidAssets: bigint,
1117
+ data: string
1118
+ ];
1119
+ interface OutputObject {
1120
+ positionManager: string;
1121
+ repaidAssets: bigint;
1122
+ data: string;
1088
1123
  }
1089
1124
  type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1090
1125
  type Filter = TypedDeferredTopicFilter<Event>;
@@ -1093,27 +1128,27 @@ declare namespace LiquidateEvent {
1093
1128
  }
1094
1129
  declare namespace PaymentEvent {
1095
1130
  type InputTuple = [
1131
+ tradeId: BytesLike,
1096
1132
  positionManager: AddressLike,
1097
1133
  positionId: BytesLike,
1098
- tradeId: BytesLike,
1099
1134
  sender: AddressLike,
1100
1135
  marketId: BytesLike,
1101
1136
  amount: BigNumberish,
1102
1137
  collateral: BigNumberish
1103
1138
  ];
1104
1139
  type OutputTuple = [
1140
+ tradeId: string,
1105
1141
  positionManager: string,
1106
1142
  positionId: string,
1107
- tradeId: string,
1108
1143
  sender: string,
1109
1144
  marketId: string,
1110
1145
  amount: bigint,
1111
1146
  collateral: bigint
1112
1147
  ];
1113
1148
  interface OutputObject {
1149
+ tradeId: string;
1114
1150
  positionManager: string;
1115
1151
  positionId: string;
1116
- tradeId: string;
1117
1152
  sender: string;
1118
1153
  marketId: string;
1119
1154
  amount: bigint;
@@ -1124,10 +1159,58 @@ declare namespace PaymentEvent {
1124
1159
  type Log = TypedEventLog<Event>;
1125
1160
  type LogDescription = TypedLogDescription<Event>;
1126
1161
  }
1127
- interface LendingLiquidation extends BaseContract {
1128
- connect(runner?: ContractRunner | null): LendingLiquidation;
1162
+ declare namespace ProfitTakenEvent {
1163
+ type InputTuple = [
1164
+ positionId: BytesLike,
1165
+ token: AddressLike,
1166
+ pFeeReceiver: AddressLike,
1167
+ amount: BigNumberish
1168
+ ];
1169
+ type OutputTuple = [
1170
+ positionId: string,
1171
+ token: string,
1172
+ pFeeReceiver: string,
1173
+ amount: bigint
1174
+ ];
1175
+ interface OutputObject {
1176
+ positionId: string;
1177
+ token: string;
1178
+ pFeeReceiver: string;
1179
+ amount: bigint;
1180
+ }
1181
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1182
+ type Filter = TypedDeferredTopicFilter<Event>;
1183
+ type Log = TypedEventLog<Event>;
1184
+ type LogDescription = TypedLogDescription<Event>;
1185
+ }
1186
+ declare namespace RefundedEvent {
1187
+ type InputTuple = [
1188
+ positionId: BytesLike,
1189
+ token: AddressLike,
1190
+ recipient: AddressLike,
1191
+ refundedAmount: BigNumberish
1192
+ ];
1193
+ type OutputTuple = [
1194
+ positionId: string,
1195
+ token: string,
1196
+ recipient: string,
1197
+ refundedAmount: bigint
1198
+ ];
1199
+ interface OutputObject {
1200
+ positionId: string;
1201
+ token: string;
1202
+ recipient: string;
1203
+ refundedAmount: bigint;
1204
+ }
1205
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
1206
+ type Filter = TypedDeferredTopicFilter<Event>;
1207
+ type Log = TypedEventLog<Event>;
1208
+ type LogDescription = TypedLogDescription<Event>;
1209
+ }
1210
+ interface MorphoLiquidator extends BaseContract {
1211
+ connect(runner?: ContractRunner | null): MorphoLiquidator;
1129
1212
  waitForDeployment(): Promise<this>;
1130
- interface: LendingLiquidationInterface;
1213
+ interface: MorphoLiquidatorInterface;
1131
1214
  queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
1132
1215
  queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
1133
1216
  on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
@@ -1137,9 +1220,7 @@ interface LendingLiquidation extends BaseContract {
1137
1220
  listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
1138
1221
  listeners(eventName?: string): Promise<Array<Listener>>;
1139
1222
  removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
1140
- LENDING_MANAGEMENT: TypedContractMethod<[], [string], "view">;
1141
- MORPHO: TypedContractMethod<[], [string], "view">;
1142
- VALIDATOR_FORCE_CLOSE_TYPEHASH: TypedContractMethod<[], [string], "view">;
1223
+ MORPHO_MANAGEMENT: TypedContractMethod<[], [string], "view">;
1143
1224
  eip712Domain: TypedContractMethod<[
1144
1225
  ], [
1145
1226
  [
@@ -1166,6 +1247,12 @@ interface LendingLiquidation extends BaseContract {
1166
1247
  ], [
1167
1248
  void
1168
1249
  ], "nonpayable">;
1250
+ onMorphoRepay: TypedContractMethod<[
1251
+ repaidAssets: BigNumberish,
1252
+ data: BytesLike
1253
+ ], [
1254
+ void
1255
+ ], "nonpayable">;
1169
1256
  optimexDomain: TypedContractMethod<[
1170
1257
  ], [
1171
1258
  [string, string] & {
@@ -1173,7 +1260,6 @@ interface LendingLiquidation extends BaseContract {
1173
1260
  version: string;
1174
1261
  }
1175
1262
  ], "view">;
1176
- owBtc: TypedContractMethod<[], [string], "view">;
1177
1263
  payment: TypedContractMethod<[
1178
1264
  tradeId: BytesLike,
1179
1265
  positionManager: AddressLike,
@@ -1185,9 +1271,7 @@ interface LendingLiquidation extends BaseContract {
1185
1271
  void
1186
1272
  ], "nonpayable">;
1187
1273
  getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
1188
- getFunction(nameOrSignature: "LENDING_MANAGEMENT"): TypedContractMethod<[], [string], "view">;
1189
- getFunction(nameOrSignature: "MORPHO"): TypedContractMethod<[], [string], "view">;
1190
- getFunction(nameOrSignature: "VALIDATOR_FORCE_CLOSE_TYPEHASH"): TypedContractMethod<[], [string], "view">;
1274
+ getFunction(nameOrSignature: "MORPHO_MANAGEMENT"): TypedContractMethod<[], [string], "view">;
1191
1275
  getFunction(nameOrSignature: "eip712Domain"): TypedContractMethod<[
1192
1276
  ], [
1193
1277
  [
@@ -1214,6 +1298,12 @@ interface LendingLiquidation extends BaseContract {
1214
1298
  ], [
1215
1299
  void
1216
1300
  ], "nonpayable">;
1301
+ getFunction(nameOrSignature: "onMorphoRepay"): TypedContractMethod<[
1302
+ repaidAssets: BigNumberish,
1303
+ data: BytesLike
1304
+ ], [
1305
+ void
1306
+ ], "nonpayable">;
1217
1307
  getFunction(nameOrSignature: "optimexDomain"): TypedContractMethod<[
1218
1308
  ], [
1219
1309
  [string, string] & {
@@ -1221,7 +1311,6 @@ interface LendingLiquidation extends BaseContract {
1221
1311
  version: string;
1222
1312
  }
1223
1313
  ], "view">;
1224
- getFunction(nameOrSignature: "owBtc"): TypedContractMethod<[], [string], "view">;
1225
1314
  getFunction(nameOrSignature: "payment"): TypedContractMethod<[
1226
1315
  tradeId: BytesLike,
1227
1316
  positionManager: AddressLike,
@@ -1235,16 +1324,28 @@ interface LendingLiquidation extends BaseContract {
1235
1324
  getEvent(key: "EIP712DomainChanged"): TypedContractEvent<EIP712DomainChangedEvent$1.InputTuple, EIP712DomainChangedEvent$1.OutputTuple, EIP712DomainChangedEvent$1.OutputObject>;
1236
1325
  getEvent(key: "ForceClose"): TypedContractEvent<ForceCloseEvent.InputTuple, ForceCloseEvent.OutputTuple, ForceCloseEvent.OutputObject>;
1237
1326
  getEvent(key: "Liquidate"): TypedContractEvent<LiquidateEvent.InputTuple, LiquidateEvent.OutputTuple, LiquidateEvent.OutputObject>;
1327
+ getEvent(key: "OnMorphoLiquidate"): TypedContractEvent<OnMorphoLiquidateEvent.InputTuple, OnMorphoLiquidateEvent.OutputTuple, OnMorphoLiquidateEvent.OutputObject>;
1328
+ getEvent(key: "OnMorphoRepay"): TypedContractEvent<OnMorphoRepayEvent.InputTuple, OnMorphoRepayEvent.OutputTuple, OnMorphoRepayEvent.OutputObject>;
1238
1329
  getEvent(key: "Payment"): TypedContractEvent<PaymentEvent.InputTuple, PaymentEvent.OutputTuple, PaymentEvent.OutputObject>;
1330
+ getEvent(key: "ProfitTaken"): TypedContractEvent<ProfitTakenEvent.InputTuple, ProfitTakenEvent.OutputTuple, ProfitTakenEvent.OutputObject>;
1331
+ getEvent(key: "Refunded"): TypedContractEvent<RefundedEvent.InputTuple, RefundedEvent.OutputTuple, RefundedEvent.OutputObject>;
1239
1332
  filters: {
1240
1333
  "EIP712DomainChanged()": TypedContractEvent<EIP712DomainChangedEvent$1.InputTuple, EIP712DomainChangedEvent$1.OutputTuple, EIP712DomainChangedEvent$1.OutputObject>;
1241
1334
  EIP712DomainChanged: TypedContractEvent<EIP712DomainChangedEvent$1.InputTuple, EIP712DomainChangedEvent$1.OutputTuple, EIP712DomainChangedEvent$1.OutputObject>;
1242
- "ForceClose(address,bytes32,bytes32,bytes32,uint256,uint256)": TypedContractEvent<ForceCloseEvent.InputTuple, ForceCloseEvent.OutputTuple, ForceCloseEvent.OutputObject>;
1335
+ "ForceClose(address,bytes32,bytes32,uint256,uint256,uint256)": TypedContractEvent<ForceCloseEvent.InputTuple, ForceCloseEvent.OutputTuple, ForceCloseEvent.OutputObject>;
1243
1336
  ForceClose: TypedContractEvent<ForceCloseEvent.InputTuple, ForceCloseEvent.OutputTuple, ForceCloseEvent.OutputObject>;
1244
- "Liquidate(address,bytes32,bytes32,bytes32,uint256,uint256,uint256,uint256)": TypedContractEvent<LiquidateEvent.InputTuple, LiquidateEvent.OutputTuple, LiquidateEvent.OutputObject>;
1337
+ "Liquidate(address,bytes32,bytes32,uint256,uint256,uint256,uint256)": TypedContractEvent<LiquidateEvent.InputTuple, LiquidateEvent.OutputTuple, LiquidateEvent.OutputObject>;
1245
1338
  Liquidate: TypedContractEvent<LiquidateEvent.InputTuple, LiquidateEvent.OutputTuple, LiquidateEvent.OutputObject>;
1246
- "Payment(address,bytes32,bytes32,address,bytes32,uint256,uint256)": TypedContractEvent<PaymentEvent.InputTuple, PaymentEvent.OutputTuple, PaymentEvent.OutputObject>;
1339
+ "OnMorphoLiquidate(address,uint256,bytes)": TypedContractEvent<OnMorphoLiquidateEvent.InputTuple, OnMorphoLiquidateEvent.OutputTuple, OnMorphoLiquidateEvent.OutputObject>;
1340
+ OnMorphoLiquidate: TypedContractEvent<OnMorphoLiquidateEvent.InputTuple, OnMorphoLiquidateEvent.OutputTuple, OnMorphoLiquidateEvent.OutputObject>;
1341
+ "OnMorphoRepay(address,uint256,bytes)": TypedContractEvent<OnMorphoRepayEvent.InputTuple, OnMorphoRepayEvent.OutputTuple, OnMorphoRepayEvent.OutputObject>;
1342
+ OnMorphoRepay: TypedContractEvent<OnMorphoRepayEvent.InputTuple, OnMorphoRepayEvent.OutputTuple, OnMorphoRepayEvent.OutputObject>;
1343
+ "Payment(bytes32,address,bytes32,address,bytes32,uint256,uint256)": TypedContractEvent<PaymentEvent.InputTuple, PaymentEvent.OutputTuple, PaymentEvent.OutputObject>;
1247
1344
  Payment: TypedContractEvent<PaymentEvent.InputTuple, PaymentEvent.OutputTuple, PaymentEvent.OutputObject>;
1345
+ "ProfitTaken(bytes32,address,address,uint256)": TypedContractEvent<ProfitTakenEvent.InputTuple, ProfitTakenEvent.OutputTuple, ProfitTakenEvent.OutputObject>;
1346
+ ProfitTaken: TypedContractEvent<ProfitTakenEvent.InputTuple, ProfitTakenEvent.OutputTuple, ProfitTakenEvent.OutputObject>;
1347
+ "Refunded(bytes32,address,address,uint256)": TypedContractEvent<RefundedEvent.InputTuple, RefundedEvent.OutputTuple, RefundedEvent.OutputObject>;
1348
+ Refunded: TypedContractEvent<RefundedEvent.InputTuple, RefundedEvent.OutputTuple, RefundedEvent.OutputObject>;
1248
1349
  };
1249
1350
  }
1250
1351
 
@@ -3787,19 +3888,11 @@ declare class ERC20__factory {
3787
3888
  static connect(address: string, runner?: ContractRunner | null): ERC20;
3788
3889
  }
3789
3890
 
3790
- declare class LendingLiquidation__factory {
3891
+ declare class MorphoLiquidator__factory {
3791
3892
  static readonly abi: readonly [{
3792
3893
  readonly inputs: readonly [{
3793
3894
  readonly internalType: "address";
3794
- readonly name: "_owBtc";
3795
- readonly type: "address";
3796
- }, {
3797
- readonly internalType: "address";
3798
- readonly name: "_morpho";
3799
- readonly type: "address";
3800
- }, {
3801
- readonly internalType: "address";
3802
- readonly name: "_lendingManagement";
3895
+ readonly name: "morphoManagement";
3803
3896
  readonly type: "address";
3804
3897
  }, {
3805
3898
  readonly internalType: "string";
@@ -3832,10 +3925,30 @@ declare class LendingLiquidation__factory {
3832
3925
  }];
3833
3926
  readonly name: "ECDSAInvalidSignatureS";
3834
3927
  readonly type: "error";
3928
+ }, {
3929
+ readonly inputs: readonly [{
3930
+ readonly internalType: "address";
3931
+ readonly name: "expected";
3932
+ readonly type: "address";
3933
+ }, {
3934
+ readonly internalType: "address";
3935
+ readonly name: "actual";
3936
+ readonly type: "address";
3937
+ }];
3938
+ readonly name: "InconsistentAsset";
3939
+ readonly type: "error";
3835
3940
  }, {
3836
3941
  readonly inputs: readonly [];
3837
3942
  readonly name: "InvalidMorpho";
3838
3943
  readonly type: "error";
3944
+ }, {
3945
+ readonly inputs: readonly [{
3946
+ readonly internalType: "bytes32";
3947
+ readonly name: "positionId";
3948
+ readonly type: "bytes32";
3949
+ }];
3950
+ readonly name: "InvalidPositionId";
3951
+ readonly type: "error";
3839
3952
  }, {
3840
3953
  readonly inputs: readonly [];
3841
3954
  readonly name: "InvalidShortString";
@@ -3852,6 +3965,34 @@ declare class LendingLiquidation__factory {
3852
3965
  readonly inputs: readonly [];
3853
3966
  readonly name: "NotEnoughPaymentAmount";
3854
3967
  readonly type: "error";
3968
+ }, {
3969
+ readonly inputs: readonly [];
3970
+ readonly name: "ReentrancyGuardReentrantCall";
3971
+ readonly type: "error";
3972
+ }, {
3973
+ readonly inputs: readonly [{
3974
+ readonly internalType: "address";
3975
+ readonly name: "spender";
3976
+ readonly type: "address";
3977
+ }, {
3978
+ readonly internalType: "uint256";
3979
+ readonly name: "currentAllowance";
3980
+ readonly type: "uint256";
3981
+ }, {
3982
+ readonly internalType: "uint256";
3983
+ readonly name: "requestedDecrease";
3984
+ readonly type: "uint256";
3985
+ }];
3986
+ readonly name: "SafeERC20FailedDecreaseAllowance";
3987
+ readonly type: "error";
3988
+ }, {
3989
+ readonly inputs: readonly [{
3990
+ readonly internalType: "address";
3991
+ readonly name: "token";
3992
+ readonly type: "address";
3993
+ }];
3994
+ readonly name: "SafeERC20FailedOperation";
3995
+ readonly type: "error";
3855
3996
  }, {
3856
3997
  readonly inputs: readonly [{
3857
3998
  readonly internalType: "string";
@@ -3860,6 +4001,14 @@ declare class LendingLiquidation__factory {
3860
4001
  }];
3861
4002
  readonly name: "StringTooLong";
3862
4003
  readonly type: "error";
4004
+ }, {
4005
+ readonly inputs: readonly [];
4006
+ readonly name: "ZeroAddress";
4007
+ readonly type: "error";
4008
+ }, {
4009
+ readonly inputs: readonly [];
4010
+ readonly name: "ZeroAmount";
4011
+ readonly type: "error";
3863
4012
  }, {
3864
4013
  readonly anonymous: false;
3865
4014
  readonly inputs: readonly [];
@@ -3877,11 +4026,6 @@ declare class LendingLiquidation__factory {
3877
4026
  readonly internalType: "bytes32";
3878
4027
  readonly name: "positionId";
3879
4028
  readonly type: "bytes32";
3880
- }, {
3881
- readonly indexed: true;
3882
- readonly internalType: "bytes32";
3883
- readonly name: "tradeId";
3884
- readonly type: "bytes32";
3885
4029
  }, {
3886
4030
  readonly indexed: false;
3887
4031
  readonly internalType: "bytes32";
@@ -3890,12 +4034,17 @@ declare class LendingLiquidation__factory {
3890
4034
  }, {
3891
4035
  readonly indexed: false;
3892
4036
  readonly internalType: "uint256";
3893
- readonly name: "repaidLoan";
4037
+ readonly name: "totalCollateral";
3894
4038
  readonly type: "uint256";
3895
4039
  }, {
3896
4040
  readonly indexed: false;
3897
4041
  readonly internalType: "uint256";
3898
- readonly name: "userRefund";
4042
+ readonly name: "totalPayment";
4043
+ readonly type: "uint256";
4044
+ }, {
4045
+ readonly indexed: false;
4046
+ readonly internalType: "uint256";
4047
+ readonly name: "repaidDebt";
3899
4048
  readonly type: "uint256";
3900
4049
  }];
3901
4050
  readonly name: "ForceClose";
@@ -3912,11 +4061,6 @@ declare class LendingLiquidation__factory {
3912
4061
  readonly internalType: "bytes32";
3913
4062
  readonly name: "positionId";
3914
4063
  readonly type: "bytes32";
3915
- }, {
3916
- readonly indexed: true;
3917
- readonly internalType: "bytes32";
3918
- readonly name: "tradeId";
3919
- readonly type: "bytes32";
3920
4064
  }, {
3921
4065
  readonly indexed: false;
3922
4066
  readonly internalType: "bytes32";
@@ -3925,22 +4069,22 @@ declare class LendingLiquidation__factory {
3925
4069
  }, {
3926
4070
  readonly indexed: false;
3927
4071
  readonly internalType: "uint256";
3928
- readonly name: "seizedCollateral";
4072
+ readonly name: "totalCollateral";
3929
4073
  readonly type: "uint256";
3930
4074
  }, {
3931
4075
  readonly indexed: false;
3932
4076
  readonly internalType: "uint256";
3933
- readonly name: "remainingCollateral";
4077
+ readonly name: "seizedCollateral";
3934
4078
  readonly type: "uint256";
3935
4079
  }, {
3936
4080
  readonly indexed: false;
3937
4081
  readonly internalType: "uint256";
3938
- readonly name: "repaidLoan";
4082
+ readonly name: "totalPayment";
3939
4083
  readonly type: "uint256";
3940
4084
  }, {
3941
4085
  readonly indexed: false;
3942
4086
  readonly internalType: "uint256";
3943
- readonly name: "bonusLoan";
4087
+ readonly name: "repaidDebt";
3944
4088
  readonly type: "uint256";
3945
4089
  }];
3946
4090
  readonly name: "Liquidate";
@@ -3953,14 +4097,54 @@ declare class LendingLiquidation__factory {
3953
4097
  readonly name: "positionManager";
3954
4098
  readonly type: "address";
3955
4099
  }, {
4100
+ readonly indexed: false;
4101
+ readonly internalType: "uint256";
4102
+ readonly name: "repaidAssets";
4103
+ readonly type: "uint256";
4104
+ }, {
4105
+ readonly indexed: false;
4106
+ readonly internalType: "bytes";
4107
+ readonly name: "data";
4108
+ readonly type: "bytes";
4109
+ }];
4110
+ readonly name: "OnMorphoLiquidate";
4111
+ readonly type: "event";
4112
+ }, {
4113
+ readonly anonymous: false;
4114
+ readonly inputs: readonly [{
4115
+ readonly indexed: true;
4116
+ readonly internalType: "address";
4117
+ readonly name: "positionManager";
4118
+ readonly type: "address";
4119
+ }, {
4120
+ readonly indexed: false;
4121
+ readonly internalType: "uint256";
4122
+ readonly name: "repaidAssets";
4123
+ readonly type: "uint256";
4124
+ }, {
4125
+ readonly indexed: false;
4126
+ readonly internalType: "bytes";
4127
+ readonly name: "data";
4128
+ readonly type: "bytes";
4129
+ }];
4130
+ readonly name: "OnMorphoRepay";
4131
+ readonly type: "event";
4132
+ }, {
4133
+ readonly anonymous: false;
4134
+ readonly inputs: readonly [{
3956
4135
  readonly indexed: true;
3957
4136
  readonly internalType: "bytes32";
3958
- readonly name: "positionId";
4137
+ readonly name: "tradeId";
3959
4138
  readonly type: "bytes32";
4139
+ }, {
4140
+ readonly indexed: true;
4141
+ readonly internalType: "address";
4142
+ readonly name: "positionManager";
4143
+ readonly type: "address";
3960
4144
  }, {
3961
4145
  readonly indexed: true;
3962
4146
  readonly internalType: "bytes32";
3963
- readonly name: "tradeId";
4147
+ readonly name: "positionId";
3964
4148
  readonly type: "bytes32";
3965
4149
  }, {
3966
4150
  readonly indexed: false;
@@ -3986,32 +4170,62 @@ declare class LendingLiquidation__factory {
3986
4170
  readonly name: "Payment";
3987
4171
  readonly type: "event";
3988
4172
  }, {
3989
- readonly inputs: readonly [];
3990
- readonly name: "LENDING_MANAGEMENT";
3991
- readonly outputs: readonly [{
3992
- readonly internalType: "contract ILendingManagement";
3993
- readonly name: "";
4173
+ readonly anonymous: false;
4174
+ readonly inputs: readonly [{
4175
+ readonly indexed: true;
4176
+ readonly internalType: "bytes32";
4177
+ readonly name: "positionId";
4178
+ readonly type: "bytes32";
4179
+ }, {
4180
+ readonly indexed: true;
4181
+ readonly internalType: "address";
4182
+ readonly name: "token";
4183
+ readonly type: "address";
4184
+ }, {
4185
+ readonly indexed: true;
4186
+ readonly internalType: "address";
4187
+ readonly name: "pFeeReceiver";
3994
4188
  readonly type: "address";
4189
+ }, {
4190
+ readonly indexed: false;
4191
+ readonly internalType: "uint256";
4192
+ readonly name: "amount";
4193
+ readonly type: "uint256";
3995
4194
  }];
3996
- readonly stateMutability: "view";
3997
- readonly type: "function";
4195
+ readonly name: "ProfitTaken";
4196
+ readonly type: "event";
3998
4197
  }, {
3999
- readonly inputs: readonly [];
4000
- readonly name: "MORPHO";
4001
- readonly outputs: readonly [{
4002
- readonly internalType: "contract IMorpho";
4003
- readonly name: "";
4198
+ readonly anonymous: false;
4199
+ readonly inputs: readonly [{
4200
+ readonly indexed: true;
4201
+ readonly internalType: "bytes32";
4202
+ readonly name: "positionId";
4203
+ readonly type: "bytes32";
4204
+ }, {
4205
+ readonly indexed: true;
4206
+ readonly internalType: "address";
4207
+ readonly name: "token";
4004
4208
  readonly type: "address";
4209
+ }, {
4210
+ readonly indexed: true;
4211
+ readonly internalType: "address";
4212
+ readonly name: "recipient";
4213
+ readonly type: "address";
4214
+ }, {
4215
+ readonly indexed: false;
4216
+ readonly internalType: "uint256";
4217
+ readonly name: "refundedAmount";
4218
+ readonly type: "uint256";
4005
4219
  }];
4006
- readonly stateMutability: "view";
4007
- readonly type: "function";
4220
+ readonly name: "Refunded";
4221
+ readonly type: "event";
4008
4222
  }, {
4009
4223
  readonly inputs: readonly [];
4010
- readonly name: "VALIDATOR_FORCE_CLOSE_TYPEHASH";
4224
+ readonly name: "MORPHO_MANAGEMENT";
4011
4225
  readonly outputs: readonly [{
4012
- readonly internalType: "bytes32";
4226
+ readonly internalType: "contract IMorphoManagement";
4013
4227
  readonly name: "";
4014
- readonly type: "bytes32";
4228
+ readonly type: "address";
4015
4229
  }];
4016
4230
  readonly stateMutability: "view";
4017
4231
  readonly type: "function";
@@ -4063,6 +4277,20 @@ declare class LendingLiquidation__factory {
4063
4277
  readonly outputs: readonly [];
4064
4278
  readonly stateMutability: "nonpayable";
4065
4279
  readonly type: "function";
4280
+ }, {
4281
+ readonly inputs: readonly [{
4282
+ readonly internalType: "uint256";
4283
+ readonly name: "repaidAssets";
4284
+ readonly type: "uint256";
4285
+ }, {
4286
+ readonly internalType: "bytes";
4287
+ readonly name: "data";
4288
+ readonly type: "bytes";
4289
+ }];
4290
+ readonly name: "onMorphoRepay";
4291
+ readonly outputs: readonly [];
4292
+ readonly stateMutability: "nonpayable";
4293
+ readonly type: "function";
4066
4294
  }, {
4067
4295
  readonly inputs: readonly [];
4068
4296
  readonly name: "optimexDomain";
@@ -4077,23 +4305,13 @@ declare class LendingLiquidation__factory {
4077
4305
  }];
4078
4306
  readonly stateMutability: "view";
4079
4307
  readonly type: "function";
4080
- }, {
4081
- readonly inputs: readonly [];
4082
- readonly name: "owBtc";
4083
- readonly outputs: readonly [{
4084
- readonly internalType: "contract OW_BTC";
4085
- readonly name: "";
4086
- readonly type: "address";
4087
- }];
4088
- readonly stateMutability: "view";
4089
- readonly type: "function";
4090
4308
  }, {
4091
4309
  readonly inputs: readonly [{
4092
4310
  readonly internalType: "bytes32";
4093
4311
  readonly name: "tradeId";
4094
4312
  readonly type: "bytes32";
4095
4313
  }, {
4096
- readonly internalType: "contract IAccountPositionManager";
4314
+ readonly internalType: "address";
4097
4315
  readonly name: "positionManager";
4098
4316
  readonly type: "address";
4099
4317
  }, {
@@ -4118,8 +4336,8 @@ declare class LendingLiquidation__factory {
4118
4336
  readonly stateMutability: "nonpayable";
4119
4337
  readonly type: "function";
4120
4338
  }];
4121
- static createInterface(): LendingLiquidationInterface;
4122
- static connect(address: string, runner?: ContractRunner | null): LendingLiquidation;
4339
+ static createInterface(): MorphoLiquidatorInterface;
4340
+ static connect(address: string, runner?: ContractRunner | null): MorphoLiquidator;
4123
4341
  }
4124
4342
 
4125
4343
  declare class Payment__factory {
@@ -6115,8 +6333,8 @@ declare class Signer__factory {
6115
6333
 
6116
6334
  type index_ERC20__factory = ERC20__factory;
6117
6335
  declare const index_ERC20__factory: typeof ERC20__factory;
6118
- type index_LendingLiquidation__factory = LendingLiquidation__factory;
6119
- declare const index_LendingLiquidation__factory: typeof LendingLiquidation__factory;
6336
+ type index_MorphoLiquidator__factory = MorphoLiquidator__factory;
6337
+ declare const index_MorphoLiquidator__factory: typeof MorphoLiquidator__factory;
6120
6338
  type index_Payment__factory = Payment__factory;
6121
6339
  declare const index_Payment__factory: typeof Payment__factory;
6122
6340
  type index_ProtocolFetcherProxy__factory = ProtocolFetcherProxy__factory;
@@ -6126,7 +6344,7 @@ declare const index_Router__factory: typeof Router__factory;
6126
6344
  type index_Signer__factory = Signer__factory;
6127
6345
  declare const index_Signer__factory: typeof Signer__factory;
6128
6346
  declare namespace index {
6129
- export { index_ERC20__factory as ERC20__factory, index_LendingLiquidation__factory as LendingLiquidation__factory, index_Payment__factory as Payment__factory, index_ProtocolFetcherProxy__factory as ProtocolFetcherProxy__factory, index_Router__factory as Router__factory, index_Signer__factory as Signer__factory };
6347
+ export { index_ERC20__factory as ERC20__factory, index_MorphoLiquidator__factory as MorphoLiquidator__factory, index_Payment__factory as Payment__factory, index_ProtocolFetcherProxy__factory as ProtocolFetcherProxy__factory, index_Router__factory as Router__factory, index_Signer__factory as Signer__factory };
6130
6348
  }
6131
6349
 
6132
6350
  declare namespace ITypes {
@@ -6804,4 +7022,4 @@ declare function camelToSnakeCase(str: string): string;
6804
7022
  declare const ensureHexPrefix: (value: string) => string;
6805
7023
  declare const removeHexPrefix: (value: string) => string;
6806
7024
 
6807
- export { type AppConfig, type ConfigObserver, type ERC20, ERC20__factory, type Environment, type EnvironmentConfig, ITypes, type LendingLiquidation, LendingLiquidation__factory, type Payment, Payment__factory, type ProtocolFetcherProxy, ProtocolFetcherProxy__factory, ProtocolService, type Router, RouterService, Router__factory, SDK, SignatureType, type Signer, SignerService, Signer__factory, SolverService, type Token, TokenSchema, TokenService, camelToSnakeCase, config, confirmDepositType, confirmPaymentType, confirmSettlementType, convertToCamelCase, convertToSnakeCase, ensureHexPrefix, index as factories, getCommitInfoHash, getMakePaymentHash, getSignature, getSigner, getTradeIdsHash, makePaymentType, presignType, protocolService, removeHexPrefix, rfqAuthenticationTypes, routerService, sdk, selectionType, signerService, snakeToCamelCase, solverService, tokenService };
7025
+ export { type AppConfig, type ConfigObserver, type ERC20, ERC20__factory, type Environment, type EnvironmentConfig, ITypes, type MorphoLiquidator, MorphoLiquidator__factory, type Payment, Payment__factory, type ProtocolFetcherProxy, ProtocolFetcherProxy__factory, ProtocolService, type Router, RouterService, Router__factory, SDK, SignatureType, type Signer, SignerService, Signer__factory, SolverService, type Token, TokenSchema, TokenService, camelToSnakeCase, config, confirmDepositType, confirmPaymentType, confirmSettlementType, convertToCamelCase, convertToSnakeCase, ensureHexPrefix, index as factories, getCommitInfoHash, getMakePaymentHash, getSignature, getSigner, getTradeIdsHash, makePaymentType, presignType, protocolService, removeHexPrefix, rfqAuthenticationTypes, routerService, sdk, selectionType, signerService, snakeToCamelCase, solverService, tokenService };