@defisaver/positions-sdk 2.1.157 → 2.1.158-morpho-batch-dev

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.
@@ -10,11 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import Dec from 'decimal.js';
11
11
  import { aprToApy } from '../moneymarket';
12
12
  import { fetchAllMerklOpportunities } from '../services/merkl';
13
- import { IncentiveKind, IncentiveSide, OpportunityAction, OpportunityStatus, } from '../types';
13
+ import { IncentiveKind, IncentiveSide, IncentiveSource, OpportunityAction, OpportunityStatus, } from '../types';
14
14
  /**
15
15
  * Merkl tags Aave V4 reward campaigns by scope via the `type` field:
16
- * - AAVE_V4_HUB_SUPPLY / AAVE_V4_HUB_BORROW / AAVE_V4_HUB_NET_LENDING → hub asset
16
+ * - AAVE_V4_HUB_SUPPLY / AAVE_V4_HUB_BORROW → reward tied to a hub asset
17
17
  * - AAVE_V4_SPOKE_SUPPLY / AAVE_V4_SPOKE_BORROW → reward tied to a spoke reserve
18
+ * - AAVE_V4_HUB_NET_LENDING / AAVE_V4_SPOKE_NET_BORROWING → reward on the NET position
19
+ * (supply minus same-token borrows, or vice versa); params list scopes as `hubs[]`/`spokes[]`
20
+ * arrays instead of a flat address+id pair, and only the campaign's own side maps to a reward
21
+ * (the opposite-side ids describe what reduces the accrual)
18
22
  * Embedded campaign params provide the exact on-chain identifiers. Token addresses cannot safely
19
23
  * identify Aave V4 rewards because one spoke can expose the same underlying from multiple hubs.
20
24
  * Each stored reward is also tagged with campaign identity (`campaignIds`/`parentCampaignIds`) so
@@ -30,11 +34,22 @@ const buildIncentive = (opportunity) => {
30
34
  apy: aprToApy(opportunity.apr),
31
35
  token,
32
36
  incentiveKind: IncentiveKind.Reward,
33
- description: `Eligible for ${token} rewards through Merkl.${opportunity.description ? `\n${opportunity.description}` : ''}`,
37
+ source: IncentiveSource.Merkl,
38
+ name: opportunity.name,
39
+ description: opportunity.description || `Eligible for ${token} rewards through Merkl.`,
34
40
  };
35
41
  };
36
42
  export const buildAaveV4MerklRewardMap = (opportunities, chainId) => {
37
43
  const result = { hub: {}, spoke: {} };
44
+ const endByCampaignId = {};
45
+ opportunities.forEach((o) => {
46
+ var _a;
47
+ return (_a = o.campaigns) === null || _a === void 0 ? void 0 : _a.forEach((c) => {
48
+ if (c.id && c.endTimestamp)
49
+ endByCampaignId[c.id] = +c.endTimestamp;
50
+ });
51
+ });
52
+ const effectiveEndTimestamp = (campaign) => Math.max(campaign.endTimestamp ? +campaign.endTimestamp : 0, ...(campaign.childCampaignIds || []).map((id) => endByCampaignId[id] || 0));
38
53
  opportunities
39
54
  .filter((o) => o.chainId === chainId)
40
55
  .filter((o) => o.status === OpportunityStatus.LIVE)
@@ -63,12 +78,24 @@ export const buildAaveV4MerklRewardMap = (opportunities, chainId) => {
63
78
  idsByKey[key].campaignIds.add(campaign.id);
64
79
  if (campaign.parentCampaignId)
65
80
  idsByKey[key].parentCampaignIds.add(campaign.parentCampaignId);
81
+ const endTimestamp = effectiveEndTimestamp(campaign);
82
+ if (endTimestamp)
83
+ idsByKey[key].endTimestamp = Math.max(idsByKey[key].endTimestamp || 0, endTimestamp);
66
84
  };
67
85
  if (o.type.includes('HUB')) {
68
86
  (_b = o.campaigns) === null || _b === void 0 ? void 0 : _b.forEach((c) => {
69
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
70
- const hubAddress = (_b = (_a = c.params) === null || _a === void 0 ? void 0 : _a.hubAddress) !== null && _b !== void 0 ? _b : (_e = (_d = (_c = c.params) === null || _c === void 0 ? void 0 : _c.distributionMethodParameters) === null || _d === void 0 ? void 0 : _d.distributionSettings) === null || _e === void 0 ? void 0 : _e.hubAddress;
71
- const assetId = (_g = (_f = c.params) === null || _f === void 0 ? void 0 : _f.assetId) !== null && _g !== void 0 ? _g : (_k = (_j = (_h = c.params) === null || _h === void 0 ? void 0 : _h.distributionMethodParameters) === null || _j === void 0 ? void 0 : _j.distributionSettings) === null || _k === void 0 ? void 0 : _k.assetId;
87
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
88
+ if ((_b = (_a = c.params) === null || _a === void 0 ? void 0 : _a.hubs) === null || _b === void 0 ? void 0 : _b.length) {
89
+ c.params.hubs.forEach((hub) => {
90
+ if (!hub.hubAddress)
91
+ return;
92
+ const rewardedIds = (side === IncentiveSide.Borrow ? hub.borrowAssetIds : hub.lendingAssetIds) || [];
93
+ rewardedIds.forEach((assetId) => collect(scopeKey(hub.hubAddress, assetId), c));
94
+ });
95
+ return;
96
+ }
97
+ const hubAddress = (_d = (_c = c.params) === null || _c === void 0 ? void 0 : _c.hubAddress) !== null && _d !== void 0 ? _d : (_g = (_f = (_e = c.params) === null || _e === void 0 ? void 0 : _e.distributionMethodParameters) === null || _f === void 0 ? void 0 : _f.distributionSettings) === null || _g === void 0 ? void 0 : _g.hubAddress;
98
+ const assetId = (_j = (_h = c.params) === null || _h === void 0 ? void 0 : _h.assetId) !== null && _j !== void 0 ? _j : (_m = (_l = (_k = c.params) === null || _k === void 0 ? void 0 : _k.distributionMethodParameters) === null || _l === void 0 ? void 0 : _l.distributionSettings) === null || _m === void 0 ? void 0 : _m.assetId;
72
99
  if (!hubAddress || assetId === undefined || assetId === null)
73
100
  return;
74
101
  collect(scopeKey(hubAddress, assetId), c);
@@ -76,20 +103,33 @@ export const buildAaveV4MerklRewardMap = (opportunities, chainId) => {
76
103
  Object.entries(idsByKey).forEach(([key, ids]) => {
77
104
  if (!result.hub[key])
78
105
  result.hub[key] = {};
79
- result.hub[key][side] = [...(result.hub[key][side] || []), Object.assign(Object.assign({}, incentive), { campaignIds: [...ids.campaignIds] })];
106
+ result.hub[key][side] = [...(result.hub[key][side] || []), Object.assign(Object.assign({}, incentive), { endTimestamp: ids.endTimestamp, campaignIds: [...ids.campaignIds] })];
80
107
  });
81
108
  }
82
109
  else if (o.type.includes('SPOKE')) {
83
110
  (_c = o.campaigns) === null || _c === void 0 ? void 0 : _c.forEach((c) => {
84
- var _a;
85
- if (!((_a = c.params) === null || _a === void 0 ? void 0 : _a.spokeAddress) || c.params.reserveId === undefined || c.params.reserveId === null)
111
+ var _a, _b, _c;
112
+ if ((_b = (_a = c.params) === null || _a === void 0 ? void 0 : _a.spokes) === null || _b === void 0 ? void 0 : _b.length) {
113
+ c.params.spokes.forEach((spoke) => {
114
+ if (!spoke.spokeAddress)
115
+ return;
116
+ const rewardedTokens = (side === IncentiveSide.Borrow ? spoke.borrowTokens : spoke.supplyTokens) || [];
117
+ rewardedTokens.forEach((tokenScope) => {
118
+ if (tokenScope.reserveId === undefined || tokenScope.reserveId === null)
119
+ return;
120
+ collect(scopeKey(spoke.spokeAddress, tokenScope.reserveId), c);
121
+ });
122
+ });
123
+ return;
124
+ }
125
+ if (!((_c = c.params) === null || _c === void 0 ? void 0 : _c.spokeAddress) || c.params.reserveId === undefined || c.params.reserveId === null)
86
126
  return;
87
127
  collect(scopeKey(c.params.spokeAddress, c.params.reserveId), c);
88
128
  });
89
129
  Object.entries(idsByKey).forEach(([key, ids]) => {
90
130
  if (!result.spoke[key])
91
131
  result.spoke[key] = {};
92
- result.spoke[key][side] = [...(result.spoke[key][side] || []), Object.assign(Object.assign({}, incentive), { campaignIds: [...ids.campaignIds], parentCampaignIds: [...ids.parentCampaignIds] })];
132
+ result.spoke[key][side] = [...(result.spoke[key][side] || []), Object.assign(Object.assign({}, incentive), { endTimestamp: ids.endTimestamp, campaignIds: [...ids.campaignIds], parentCampaignIds: [...ids.parentCampaignIds] })];
93
133
  });
94
134
  }
95
135
  });
@@ -99,7 +139,7 @@ export const getAaveV4MerkleCampaigns = (chainId) => __awaiter(void 0, void 0, v
99
139
  try {
100
140
  const opportunities = yield fetchAllMerklOpportunities({
101
141
  mainProtocolId: 'aave',
102
- type: 'AAVE_V4_HUB_SUPPLY,AAVE_V4_HUB_BORROW,AAVE_V4_HUB_NET_LENDING,AAVE_V4_SPOKE_SUPPLY,AAVE_V4_SPOKE_BORROW',
142
+ type: 'AAVE_V4_HUB_SUPPLY,AAVE_V4_HUB_BORROW,AAVE_V4_SPOKE_SUPPLY,AAVE_V4_SPOKE_BORROW,AAVE_V4_HUB_NET_LENDING,AAVE_V4_HUB_NET_BORROWING,AAVE_V4_SPOKE_NET_LENDING,AAVE_V4_SPOKE_NET_BORROWING',
103
143
  status: OpportunityStatus.LIVE,
104
144
  campaigns: 'true',
105
145
  });
@@ -89505,6 +89505,26 @@ export declare const MorphoBlueView: {
89505
89505
  };
89506
89506
  export declare const MidnightView: {
89507
89507
  readonly abi: readonly [{
89508
+ readonly inputs: readonly [];
89509
+ readonly name: "InvalidCollateralIndex";
89510
+ readonly type: "error";
89511
+ }, {
89512
+ readonly inputs: readonly [];
89513
+ readonly name: "InvalidOfferMarketId";
89514
+ readonly type: "error";
89515
+ }, {
89516
+ readonly inputs: readonly [];
89517
+ readonly name: "InvalidOfferType";
89518
+ readonly type: "error";
89519
+ }, {
89520
+ readonly inputs: readonly [];
89521
+ readonly name: "NoOrdersProvided";
89522
+ readonly type: "error";
89523
+ }, {
89524
+ readonly inputs: readonly [];
89525
+ readonly name: "ZeroAmountRequested";
89526
+ readonly type: "error";
89527
+ }, {
89508
89528
  readonly inputs: readonly [{
89509
89529
  readonly internalType: "bytes32";
89510
89530
  readonly name: "_id";
@@ -89747,12 +89767,504 @@ export declare const MidnightView: {
89747
89767
  }];
89748
89768
  readonly networks: {
89749
89769
  readonly "1": {
89750
- readonly address: "0xB64FBf011343961D9AC4A04b714414E35ebE6BE0";
89751
- readonly createdBlock: 25938908;
89770
+ readonly address: "0xb8e1dAAd42e18203cfCED7193FE0e2E19d713A56";
89771
+ readonly createdBlock: 25983494;
89772
+ readonly oldVersions: {
89773
+ readonly "25938908": {
89774
+ readonly abi: readonly [{
89775
+ readonly inputs: readonly [{
89776
+ readonly internalType: "bytes32";
89777
+ readonly name: "_id";
89778
+ readonly type: "bytes32";
89779
+ }];
89780
+ readonly name: "getMarketInfo";
89781
+ readonly outputs: readonly [{
89782
+ readonly components: readonly [{
89783
+ readonly internalType: "bytes32";
89784
+ readonly name: "id";
89785
+ readonly type: "bytes32";
89786
+ }, {
89787
+ readonly internalType: "uint128";
89788
+ readonly name: "totalUnits";
89789
+ readonly type: "uint128";
89790
+ }, {
89791
+ readonly internalType: "uint128";
89792
+ readonly name: "lossFactor";
89793
+ readonly type: "uint128";
89794
+ }, {
89795
+ readonly internalType: "uint128";
89796
+ readonly name: "withdrawable";
89797
+ readonly type: "uint128";
89798
+ }, {
89799
+ readonly internalType: "uint128";
89800
+ readonly name: "continuousFeeCredit";
89801
+ readonly type: "uint128";
89802
+ }, {
89803
+ readonly internalType: "uint16[7]";
89804
+ readonly name: "settlementFees";
89805
+ readonly type: "uint16[7]";
89806
+ }, {
89807
+ readonly internalType: "uint32";
89808
+ readonly name: "continuousFee";
89809
+ readonly type: "uint32";
89810
+ }, {
89811
+ readonly internalType: "uint8";
89812
+ readonly name: "tickSpacing";
89813
+ readonly type: "uint8";
89814
+ }, {
89815
+ readonly internalType: "uint256[]";
89816
+ readonly name: "prices";
89817
+ readonly type: "uint256[]";
89818
+ }];
89819
+ readonly internalType: "struct MidnightView.MarketInfo";
89820
+ readonly name: "info";
89821
+ readonly type: "tuple";
89822
+ }];
89823
+ readonly stateMutability: "view";
89824
+ readonly type: "function";
89825
+ }, {
89826
+ readonly inputs: readonly [{
89827
+ readonly internalType: "bytes32";
89828
+ readonly name: "_id";
89829
+ readonly type: "bytes32";
89830
+ }, {
89831
+ readonly internalType: "address";
89832
+ readonly name: "_user";
89833
+ readonly type: "address";
89834
+ }];
89835
+ readonly name: "getPositionInfo";
89836
+ readonly outputs: readonly [{
89837
+ readonly components: readonly [{
89838
+ readonly internalType: "uint128";
89839
+ readonly name: "credit";
89840
+ readonly type: "uint128";
89841
+ }, {
89842
+ readonly internalType: "uint128";
89843
+ readonly name: "pendingFee";
89844
+ readonly type: "uint128";
89845
+ }, {
89846
+ readonly internalType: "uint128";
89847
+ readonly name: "debt";
89848
+ readonly type: "uint128";
89849
+ }, {
89850
+ readonly internalType: "uint128";
89851
+ readonly name: "collateralBitmap";
89852
+ readonly type: "uint128";
89853
+ }, {
89854
+ readonly internalType: "uint128[]";
89855
+ readonly name: "collateral";
89856
+ readonly type: "uint128[]";
89857
+ }, {
89858
+ readonly internalType: "uint256";
89859
+ readonly name: "ratio";
89860
+ readonly type: "uint256";
89861
+ }];
89862
+ readonly internalType: "struct MidnightView.PositionInfo";
89863
+ readonly name: "pos";
89864
+ readonly type: "tuple";
89865
+ }];
89866
+ readonly stateMutability: "view";
89867
+ readonly type: "function";
89868
+ }, {
89869
+ readonly inputs: readonly [{
89870
+ readonly internalType: "bytes32";
89871
+ readonly name: "_id";
89872
+ readonly type: "bytes32";
89873
+ }, {
89874
+ readonly internalType: "address";
89875
+ readonly name: "_user";
89876
+ readonly type: "address";
89877
+ }];
89878
+ readonly name: "getRatio";
89879
+ readonly outputs: readonly [{
89880
+ readonly internalType: "uint256";
89881
+ readonly name: "ratio";
89882
+ readonly type: "uint256";
89883
+ }];
89884
+ readonly stateMutability: "view";
89885
+ readonly type: "function";
89886
+ }, {
89887
+ readonly inputs: readonly [{
89888
+ readonly components: readonly [{
89889
+ readonly internalType: "uint256";
89890
+ readonly name: "chainId";
89891
+ readonly type: "uint256";
89892
+ }, {
89893
+ readonly internalType: "address";
89894
+ readonly name: "midnight";
89895
+ readonly type: "address";
89896
+ }, {
89897
+ readonly internalType: "address";
89898
+ readonly name: "loanToken";
89899
+ readonly type: "address";
89900
+ }, {
89901
+ readonly components: readonly [{
89902
+ readonly internalType: "address";
89903
+ readonly name: "token";
89904
+ readonly type: "address";
89905
+ }, {
89906
+ readonly internalType: "uint256";
89907
+ readonly name: "lltv";
89908
+ readonly type: "uint256";
89909
+ }, {
89910
+ readonly internalType: "uint256";
89911
+ readonly name: "liquidationCursor";
89912
+ readonly type: "uint256";
89913
+ }, {
89914
+ readonly internalType: "address";
89915
+ readonly name: "oracle";
89916
+ readonly type: "address";
89917
+ }];
89918
+ readonly internalType: "struct CollateralParams[]";
89919
+ readonly name: "collateralParams";
89920
+ readonly type: "tuple[]";
89921
+ }, {
89922
+ readonly internalType: "uint256";
89923
+ readonly name: "maturity";
89924
+ readonly type: "uint256";
89925
+ }, {
89926
+ readonly internalType: "uint256";
89927
+ readonly name: "rcfThreshold";
89928
+ readonly type: "uint256";
89929
+ }, {
89930
+ readonly internalType: "address";
89931
+ readonly name: "enterGate";
89932
+ readonly type: "address";
89933
+ }, {
89934
+ readonly internalType: "address";
89935
+ readonly name: "liquidatorGate";
89936
+ readonly type: "address";
89937
+ }];
89938
+ readonly internalType: "struct Market";
89939
+ readonly name: "_market";
89940
+ readonly type: "tuple";
89941
+ }];
89942
+ readonly name: "toId";
89943
+ readonly outputs: readonly [{
89944
+ readonly internalType: "bytes32";
89945
+ readonly name: "id";
89946
+ readonly type: "bytes32";
89947
+ }];
89948
+ readonly stateMutability: "pure";
89949
+ readonly type: "function";
89950
+ }, {
89951
+ readonly inputs: readonly [{
89952
+ readonly internalType: "bytes32";
89953
+ readonly name: "_id";
89954
+ readonly type: "bytes32";
89955
+ }];
89956
+ readonly name: "toMarket";
89957
+ readonly outputs: readonly [{
89958
+ readonly components: readonly [{
89959
+ readonly internalType: "uint256";
89960
+ readonly name: "chainId";
89961
+ readonly type: "uint256";
89962
+ }, {
89963
+ readonly internalType: "address";
89964
+ readonly name: "midnight";
89965
+ readonly type: "address";
89966
+ }, {
89967
+ readonly internalType: "address";
89968
+ readonly name: "loanToken";
89969
+ readonly type: "address";
89970
+ }, {
89971
+ readonly components: readonly [{
89972
+ readonly internalType: "address";
89973
+ readonly name: "token";
89974
+ readonly type: "address";
89975
+ }, {
89976
+ readonly internalType: "uint256";
89977
+ readonly name: "lltv";
89978
+ readonly type: "uint256";
89979
+ }, {
89980
+ readonly internalType: "uint256";
89981
+ readonly name: "liquidationCursor";
89982
+ readonly type: "uint256";
89983
+ }, {
89984
+ readonly internalType: "address";
89985
+ readonly name: "oracle";
89986
+ readonly type: "address";
89987
+ }];
89988
+ readonly internalType: "struct CollateralParams[]";
89989
+ readonly name: "collateralParams";
89990
+ readonly type: "tuple[]";
89991
+ }, {
89992
+ readonly internalType: "uint256";
89993
+ readonly name: "maturity";
89994
+ readonly type: "uint256";
89995
+ }, {
89996
+ readonly internalType: "uint256";
89997
+ readonly name: "rcfThreshold";
89998
+ readonly type: "uint256";
89999
+ }, {
90000
+ readonly internalType: "address";
90001
+ readonly name: "enterGate";
90002
+ readonly type: "address";
90003
+ }, {
90004
+ readonly internalType: "address";
90005
+ readonly name: "liquidatorGate";
90006
+ readonly type: "address";
90007
+ }];
90008
+ readonly internalType: "struct Market";
90009
+ readonly name: "market";
90010
+ readonly type: "tuple";
90011
+ }];
90012
+ readonly stateMutability: "view";
90013
+ readonly type: "function";
90014
+ }];
90015
+ readonly address: "0xB64FBf011343961D9AC4A04b714414E35ebE6BE0";
90016
+ };
90017
+ };
89752
90018
  };
89753
90019
  readonly "8453": {
89754
- readonly address: "0x3aa272f329E8B562A3bA56Bb6979a44D23A28839";
89755
- readonly createdBlock: 48932293;
90020
+ readonly address: "0xdEab43eb1519bD4314bc99c4019866734103D3Ae";
90021
+ readonly createdBlock: 51346932;
90022
+ readonly oldVersions: {
90023
+ readonly "48932293": {
90024
+ readonly abi: readonly [{
90025
+ readonly inputs: readonly [{
90026
+ readonly internalType: "bytes32";
90027
+ readonly name: "_id";
90028
+ readonly type: "bytes32";
90029
+ }];
90030
+ readonly name: "getMarketInfo";
90031
+ readonly outputs: readonly [{
90032
+ readonly components: readonly [{
90033
+ readonly internalType: "bytes32";
90034
+ readonly name: "id";
90035
+ readonly type: "bytes32";
90036
+ }, {
90037
+ readonly internalType: "uint128";
90038
+ readonly name: "totalUnits";
90039
+ readonly type: "uint128";
90040
+ }, {
90041
+ readonly internalType: "uint128";
90042
+ readonly name: "lossFactor";
90043
+ readonly type: "uint128";
90044
+ }, {
90045
+ readonly internalType: "uint128";
90046
+ readonly name: "withdrawable";
90047
+ readonly type: "uint128";
90048
+ }, {
90049
+ readonly internalType: "uint128";
90050
+ readonly name: "continuousFeeCredit";
90051
+ readonly type: "uint128";
90052
+ }, {
90053
+ readonly internalType: "uint16[7]";
90054
+ readonly name: "settlementFees";
90055
+ readonly type: "uint16[7]";
90056
+ }, {
90057
+ readonly internalType: "uint32";
90058
+ readonly name: "continuousFee";
90059
+ readonly type: "uint32";
90060
+ }, {
90061
+ readonly internalType: "uint8";
90062
+ readonly name: "tickSpacing";
90063
+ readonly type: "uint8";
90064
+ }, {
90065
+ readonly internalType: "uint256[]";
90066
+ readonly name: "prices";
90067
+ readonly type: "uint256[]";
90068
+ }];
90069
+ readonly internalType: "struct MidnightView.MarketInfo";
90070
+ readonly name: "info";
90071
+ readonly type: "tuple";
90072
+ }];
90073
+ readonly stateMutability: "view";
90074
+ readonly type: "function";
90075
+ }, {
90076
+ readonly inputs: readonly [{
90077
+ readonly internalType: "bytes32";
90078
+ readonly name: "_id";
90079
+ readonly type: "bytes32";
90080
+ }, {
90081
+ readonly internalType: "address";
90082
+ readonly name: "_user";
90083
+ readonly type: "address";
90084
+ }];
90085
+ readonly name: "getPositionInfo";
90086
+ readonly outputs: readonly [{
90087
+ readonly components: readonly [{
90088
+ readonly internalType: "uint128";
90089
+ readonly name: "credit";
90090
+ readonly type: "uint128";
90091
+ }, {
90092
+ readonly internalType: "uint128";
90093
+ readonly name: "pendingFee";
90094
+ readonly type: "uint128";
90095
+ }, {
90096
+ readonly internalType: "uint128";
90097
+ readonly name: "debt";
90098
+ readonly type: "uint128";
90099
+ }, {
90100
+ readonly internalType: "uint128";
90101
+ readonly name: "collateralBitmap";
90102
+ readonly type: "uint128";
90103
+ }, {
90104
+ readonly internalType: "uint128[]";
90105
+ readonly name: "collateral";
90106
+ readonly type: "uint128[]";
90107
+ }, {
90108
+ readonly internalType: "uint256";
90109
+ readonly name: "ratio";
90110
+ readonly type: "uint256";
90111
+ }];
90112
+ readonly internalType: "struct MidnightView.PositionInfo";
90113
+ readonly name: "pos";
90114
+ readonly type: "tuple";
90115
+ }];
90116
+ readonly stateMutability: "view";
90117
+ readonly type: "function";
90118
+ }, {
90119
+ readonly inputs: readonly [{
90120
+ readonly internalType: "bytes32";
90121
+ readonly name: "_id";
90122
+ readonly type: "bytes32";
90123
+ }, {
90124
+ readonly internalType: "address";
90125
+ readonly name: "_user";
90126
+ readonly type: "address";
90127
+ }];
90128
+ readonly name: "getRatio";
90129
+ readonly outputs: readonly [{
90130
+ readonly internalType: "uint256";
90131
+ readonly name: "ratio";
90132
+ readonly type: "uint256";
90133
+ }];
90134
+ readonly stateMutability: "view";
90135
+ readonly type: "function";
90136
+ }, {
90137
+ readonly inputs: readonly [{
90138
+ readonly components: readonly [{
90139
+ readonly internalType: "uint256";
90140
+ readonly name: "chainId";
90141
+ readonly type: "uint256";
90142
+ }, {
90143
+ readonly internalType: "address";
90144
+ readonly name: "midnight";
90145
+ readonly type: "address";
90146
+ }, {
90147
+ readonly internalType: "address";
90148
+ readonly name: "loanToken";
90149
+ readonly type: "address";
90150
+ }, {
90151
+ readonly components: readonly [{
90152
+ readonly internalType: "address";
90153
+ readonly name: "token";
90154
+ readonly type: "address";
90155
+ }, {
90156
+ readonly internalType: "uint256";
90157
+ readonly name: "lltv";
90158
+ readonly type: "uint256";
90159
+ }, {
90160
+ readonly internalType: "uint256";
90161
+ readonly name: "liquidationCursor";
90162
+ readonly type: "uint256";
90163
+ }, {
90164
+ readonly internalType: "address";
90165
+ readonly name: "oracle";
90166
+ readonly type: "address";
90167
+ }];
90168
+ readonly internalType: "struct CollateralParams[]";
90169
+ readonly name: "collateralParams";
90170
+ readonly type: "tuple[]";
90171
+ }, {
90172
+ readonly internalType: "uint256";
90173
+ readonly name: "maturity";
90174
+ readonly type: "uint256";
90175
+ }, {
90176
+ readonly internalType: "uint256";
90177
+ readonly name: "rcfThreshold";
90178
+ readonly type: "uint256";
90179
+ }, {
90180
+ readonly internalType: "address";
90181
+ readonly name: "enterGate";
90182
+ readonly type: "address";
90183
+ }, {
90184
+ readonly internalType: "address";
90185
+ readonly name: "liquidatorGate";
90186
+ readonly type: "address";
90187
+ }];
90188
+ readonly internalType: "struct Market";
90189
+ readonly name: "_market";
90190
+ readonly type: "tuple";
90191
+ }];
90192
+ readonly name: "toId";
90193
+ readonly outputs: readonly [{
90194
+ readonly internalType: "bytes32";
90195
+ readonly name: "id";
90196
+ readonly type: "bytes32";
90197
+ }];
90198
+ readonly stateMutability: "pure";
90199
+ readonly type: "function";
90200
+ }, {
90201
+ readonly inputs: readonly [{
90202
+ readonly internalType: "bytes32";
90203
+ readonly name: "_id";
90204
+ readonly type: "bytes32";
90205
+ }];
90206
+ readonly name: "toMarket";
90207
+ readonly outputs: readonly [{
90208
+ readonly components: readonly [{
90209
+ readonly internalType: "uint256";
90210
+ readonly name: "chainId";
90211
+ readonly type: "uint256";
90212
+ }, {
90213
+ readonly internalType: "address";
90214
+ readonly name: "midnight";
90215
+ readonly type: "address";
90216
+ }, {
90217
+ readonly internalType: "address";
90218
+ readonly name: "loanToken";
90219
+ readonly type: "address";
90220
+ }, {
90221
+ readonly components: readonly [{
90222
+ readonly internalType: "address";
90223
+ readonly name: "token";
90224
+ readonly type: "address";
90225
+ }, {
90226
+ readonly internalType: "uint256";
90227
+ readonly name: "lltv";
90228
+ readonly type: "uint256";
90229
+ }, {
90230
+ readonly internalType: "uint256";
90231
+ readonly name: "liquidationCursor";
90232
+ readonly type: "uint256";
90233
+ }, {
90234
+ readonly internalType: "address";
90235
+ readonly name: "oracle";
90236
+ readonly type: "address";
90237
+ }];
90238
+ readonly internalType: "struct CollateralParams[]";
90239
+ readonly name: "collateralParams";
90240
+ readonly type: "tuple[]";
90241
+ }, {
90242
+ readonly internalType: "uint256";
90243
+ readonly name: "maturity";
90244
+ readonly type: "uint256";
90245
+ }, {
90246
+ readonly internalType: "uint256";
90247
+ readonly name: "rcfThreshold";
90248
+ readonly type: "uint256";
90249
+ }, {
90250
+ readonly internalType: "address";
90251
+ readonly name: "enterGate";
90252
+ readonly type: "address";
90253
+ }, {
90254
+ readonly internalType: "address";
90255
+ readonly name: "liquidatorGate";
90256
+ readonly type: "address";
90257
+ }];
90258
+ readonly internalType: "struct Market";
90259
+ readonly name: "market";
90260
+ readonly type: "tuple";
90261
+ }];
90262
+ readonly stateMutability: "view";
90263
+ readonly type: "function";
90264
+ }];
90265
+ readonly address: "0x3aa272f329E8B562A3bA56Bb6979a44D23A28839";
90266
+ };
90267
+ };
89756
90268
  };
89757
90269
  };
89758
90270
  };