@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.
- package/cjs/aaveV4/lend.js +1 -0
- package/cjs/aaveV4/merkl.js +50 -10
- package/cjs/config/contracts.d.ts +516 -4
- package/cjs/config/contracts.js +17 -5
- package/cjs/contracts.d.ts +120 -0
- package/cjs/savings/index.js +6 -6
- package/cjs/savings/morphoVaults/index.d.ts +15 -3
- package/cjs/savings/morphoVaults/index.js +97 -26
- package/cjs/types/common.d.ts +2 -0
- package/cjs/types/merkl.d.ts +37 -2
- package/esm/aaveV4/lend.js +1 -0
- package/esm/aaveV4/merkl.js +51 -11
- package/esm/config/contracts.d.ts +516 -4
- package/esm/config/contracts.js +17 -5
- package/esm/contracts.d.ts +120 -0
- package/esm/savings/index.js +6 -6
- package/esm/savings/morphoVaults/index.d.ts +15 -3
- package/esm/savings/morphoVaults/index.js +93 -24
- package/esm/types/common.d.ts +2 -0
- package/esm/types/merkl.d.ts +37 -2
- package/package.json +1 -1
- package/src/aaveV4/lend.ts +1 -0
- package/src/aaveV4/merkl.ts +45 -6
- package/src/config/contracts.ts +17 -5
- package/src/savings/index.ts +6 -6
- package/src/savings/morphoVaults/index.ts +108 -27
- package/src/types/common.ts +2 -0
- package/src/types/merkl.ts +20 -2
package/cjs/aaveV4/lend.js
CHANGED
|
@@ -35,6 +35,7 @@ exports.AAVE_V4_TOKENIZED_SPOKES = {
|
|
|
35
35
|
USDC_PRIME: '0x486415fb1F8b062c89ED548f871cf64304AACb31',
|
|
36
36
|
USDT_PRIME: '0x46c588DD8453aC259c1f6a54b4C9A93C2aC3762D',
|
|
37
37
|
USDC_PAXOS: '0xaed7c529bD2878170B61C758DfAa215AC7a4FD07',
|
|
38
|
+
USDG_PAXOS: '0x378B4a7c394E22bd562F66eB612165893533c124',
|
|
38
39
|
USDT_PAXOS: '0xa0e97e45C2f89003730E467Bd484fA3eEcE5B4Cf',
|
|
39
40
|
PT_USDG_Sep_PAXOS: '0x7Df10B4A01350D2A1d95cFbE7c9207d7210A2663',
|
|
40
41
|
};
|
package/cjs/aaveV4/merkl.js
CHANGED
|
@@ -19,8 +19,12 @@ const merkl_1 = require("../services/merkl");
|
|
|
19
19
|
const types_1 = require("../types");
|
|
20
20
|
/**
|
|
21
21
|
* Merkl tags Aave V4 reward campaigns by scope via the `type` field:
|
|
22
|
-
* - AAVE_V4_HUB_SUPPLY / AAVE_V4_HUB_BORROW
|
|
22
|
+
* - AAVE_V4_HUB_SUPPLY / AAVE_V4_HUB_BORROW → reward tied to a hub asset
|
|
23
23
|
* - AAVE_V4_SPOKE_SUPPLY / AAVE_V4_SPOKE_BORROW → reward tied to a spoke reserve
|
|
24
|
+
* - AAVE_V4_HUB_NET_LENDING / AAVE_V4_SPOKE_NET_BORROWING → reward on the NET position
|
|
25
|
+
* (supply minus same-token borrows, or vice versa); params list scopes as `hubs[]`/`spokes[]`
|
|
26
|
+
* arrays instead of a flat address+id pair, and only the campaign's own side maps to a reward
|
|
27
|
+
* (the opposite-side ids describe what reduces the accrual)
|
|
24
28
|
* Embedded campaign params provide the exact on-chain identifiers. Token addresses cannot safely
|
|
25
29
|
* identify Aave V4 rewards because one spoke can expose the same underlying from multiple hubs.
|
|
26
30
|
* Each stored reward is also tagged with campaign identity (`campaignIds`/`parentCampaignIds`) so
|
|
@@ -36,11 +40,22 @@ const buildIncentive = (opportunity) => {
|
|
|
36
40
|
apy: (0, moneymarket_1.aprToApy)(opportunity.apr),
|
|
37
41
|
token,
|
|
38
42
|
incentiveKind: types_1.IncentiveKind.Reward,
|
|
39
|
-
|
|
43
|
+
source: types_1.IncentiveSource.Merkl,
|
|
44
|
+
name: opportunity.name,
|
|
45
|
+
description: opportunity.description || `Eligible for ${token} rewards through Merkl.`,
|
|
40
46
|
};
|
|
41
47
|
};
|
|
42
48
|
const buildAaveV4MerklRewardMap = (opportunities, chainId) => {
|
|
43
49
|
const result = { hub: {}, spoke: {} };
|
|
50
|
+
const endByCampaignId = {};
|
|
51
|
+
opportunities.forEach((o) => {
|
|
52
|
+
var _a;
|
|
53
|
+
return (_a = o.campaigns) === null || _a === void 0 ? void 0 : _a.forEach((c) => {
|
|
54
|
+
if (c.id && c.endTimestamp)
|
|
55
|
+
endByCampaignId[c.id] = +c.endTimestamp;
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
const effectiveEndTimestamp = (campaign) => Math.max(campaign.endTimestamp ? +campaign.endTimestamp : 0, ...(campaign.childCampaignIds || []).map((id) => endByCampaignId[id] || 0));
|
|
44
59
|
opportunities
|
|
45
60
|
.filter((o) => o.chainId === chainId)
|
|
46
61
|
.filter((o) => o.status === types_1.OpportunityStatus.LIVE)
|
|
@@ -69,12 +84,24 @@ const buildAaveV4MerklRewardMap = (opportunities, chainId) => {
|
|
|
69
84
|
idsByKey[key].campaignIds.add(campaign.id);
|
|
70
85
|
if (campaign.parentCampaignId)
|
|
71
86
|
idsByKey[key].parentCampaignIds.add(campaign.parentCampaignId);
|
|
87
|
+
const endTimestamp = effectiveEndTimestamp(campaign);
|
|
88
|
+
if (endTimestamp)
|
|
89
|
+
idsByKey[key].endTimestamp = Math.max(idsByKey[key].endTimestamp || 0, endTimestamp);
|
|
72
90
|
};
|
|
73
91
|
if (o.type.includes('HUB')) {
|
|
74
92
|
(_b = o.campaigns) === null || _b === void 0 ? void 0 : _b.forEach((c) => {
|
|
75
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
76
|
-
|
|
77
|
-
|
|
93
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
94
|
+
if ((_b = (_a = c.params) === null || _a === void 0 ? void 0 : _a.hubs) === null || _b === void 0 ? void 0 : _b.length) {
|
|
95
|
+
c.params.hubs.forEach((hub) => {
|
|
96
|
+
if (!hub.hubAddress)
|
|
97
|
+
return;
|
|
98
|
+
const rewardedIds = (side === types_1.IncentiveSide.Borrow ? hub.borrowAssetIds : hub.lendingAssetIds) || [];
|
|
99
|
+
rewardedIds.forEach((assetId) => collect(scopeKey(hub.hubAddress, assetId), c));
|
|
100
|
+
});
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
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;
|
|
104
|
+
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;
|
|
78
105
|
if (!hubAddress || assetId === undefined || assetId === null)
|
|
79
106
|
return;
|
|
80
107
|
collect(scopeKey(hubAddress, assetId), c);
|
|
@@ -82,20 +109,33 @@ const buildAaveV4MerklRewardMap = (opportunities, chainId) => {
|
|
|
82
109
|
Object.entries(idsByKey).forEach(([key, ids]) => {
|
|
83
110
|
if (!result.hub[key])
|
|
84
111
|
result.hub[key] = {};
|
|
85
|
-
result.hub[key][side] = [...(result.hub[key][side] || []), Object.assign(Object.assign({}, incentive), { campaignIds: [...ids.campaignIds] })];
|
|
112
|
+
result.hub[key][side] = [...(result.hub[key][side] || []), Object.assign(Object.assign({}, incentive), { endTimestamp: ids.endTimestamp, campaignIds: [...ids.campaignIds] })];
|
|
86
113
|
});
|
|
87
114
|
}
|
|
88
115
|
else if (o.type.includes('SPOKE')) {
|
|
89
116
|
(_c = o.campaigns) === null || _c === void 0 ? void 0 : _c.forEach((c) => {
|
|
90
|
-
var _a;
|
|
91
|
-
if (
|
|
117
|
+
var _a, _b, _c;
|
|
118
|
+
if ((_b = (_a = c.params) === null || _a === void 0 ? void 0 : _a.spokes) === null || _b === void 0 ? void 0 : _b.length) {
|
|
119
|
+
c.params.spokes.forEach((spoke) => {
|
|
120
|
+
if (!spoke.spokeAddress)
|
|
121
|
+
return;
|
|
122
|
+
const rewardedTokens = (side === types_1.IncentiveSide.Borrow ? spoke.borrowTokens : spoke.supplyTokens) || [];
|
|
123
|
+
rewardedTokens.forEach((tokenScope) => {
|
|
124
|
+
if (tokenScope.reserveId === undefined || tokenScope.reserveId === null)
|
|
125
|
+
return;
|
|
126
|
+
collect(scopeKey(spoke.spokeAddress, tokenScope.reserveId), c);
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (!((_c = c.params) === null || _c === void 0 ? void 0 : _c.spokeAddress) || c.params.reserveId === undefined || c.params.reserveId === null)
|
|
92
132
|
return;
|
|
93
133
|
collect(scopeKey(c.params.spokeAddress, c.params.reserveId), c);
|
|
94
134
|
});
|
|
95
135
|
Object.entries(idsByKey).forEach(([key, ids]) => {
|
|
96
136
|
if (!result.spoke[key])
|
|
97
137
|
result.spoke[key] = {};
|
|
98
|
-
result.spoke[key][side] = [...(result.spoke[key][side] || []), Object.assign(Object.assign({}, incentive), { campaignIds: [...ids.campaignIds], parentCampaignIds: [...ids.parentCampaignIds] })];
|
|
138
|
+
result.spoke[key][side] = [...(result.spoke[key][side] || []), Object.assign(Object.assign({}, incentive), { endTimestamp: ids.endTimestamp, campaignIds: [...ids.campaignIds], parentCampaignIds: [...ids.parentCampaignIds] })];
|
|
99
139
|
});
|
|
100
140
|
}
|
|
101
141
|
});
|
|
@@ -106,7 +146,7 @@ const getAaveV4MerkleCampaigns = (chainId) => __awaiter(void 0, void 0, void 0,
|
|
|
106
146
|
try {
|
|
107
147
|
const opportunities = yield (0, merkl_1.fetchAllMerklOpportunities)({
|
|
108
148
|
mainProtocolId: 'aave',
|
|
109
|
-
type: 'AAVE_V4_HUB_SUPPLY,AAVE_V4_HUB_BORROW,AAVE_V4_HUB_NET_LENDING,
|
|
149
|
+
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',
|
|
110
150
|
status: types_1.OpportunityStatus.LIVE,
|
|
111
151
|
campaigns: 'true',
|
|
112
152
|
});
|
|
@@ -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: "
|
|
89751
|
-
readonly createdBlock:
|
|
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: "
|
|
89755
|
-
readonly createdBlock:
|
|
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
|
};
|