@varla/sdk 1.2.0 → 1.2.1
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/README.md +42 -0
- package/dist/views/admin.d.ts +7 -1
- package/dist/views/admin.d.ts.map +1 -1
- package/dist/views/admin.js +22 -1
- package/dist/views/core.d.ts +42 -0
- package/dist/views/core.d.ts.map +1 -1
- package/dist/views/core.js +84 -0
- package/dist/views/index.d.ts +1 -0
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +1 -0
- package/dist/views/oracle.d.ts +84 -0
- package/dist/views/oracle.d.ts.map +1 -1
- package/dist/views/oracle.js +187 -0
- package/dist/views/system.d.ts +24 -0
- package/dist/views/system.d.ts.map +1 -0
- package/dist/views/system.js +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -103,6 +103,48 @@ const hf = await c.core.read.getHealthFactor(["0xYourUserAddress"]); // note vie
|
|
|
103
103
|
|
|
104
104
|
These are convenience helpers built on top of the contract bindings.
|
|
105
105
|
|
|
106
|
+
<!-- BEGIN GENERATED:VIEW_HELPERS -->
|
|
107
|
+
- `getInterestRateStrategyFromPool`
|
|
108
|
+
- `hydrateOraclePositionIds`
|
|
109
|
+
- `readAccessManagerBasics`
|
|
110
|
+
- `readAccountPositions`
|
|
111
|
+
- `readAccountSnapshot`
|
|
112
|
+
- `readAdapterInfo`
|
|
113
|
+
- `readBorrowersPage`
|
|
114
|
+
- `readConvertLiquidatorBasics`
|
|
115
|
+
- `readDefaultLtvConfig`
|
|
116
|
+
- `readHasRole`
|
|
117
|
+
- `readHealthFactor`
|
|
118
|
+
- `readInterestRateStrategyBasics`
|
|
119
|
+
- `readLiquidationBonusBps`
|
|
120
|
+
- `readLiquidationConfig`
|
|
121
|
+
- `readLiquidationParamsForPosition`
|
|
122
|
+
- `readLiquidatorBasics`
|
|
123
|
+
- `readLtvForPosition`
|
|
124
|
+
- `readManyAccountSnapshots`
|
|
125
|
+
- `readManyHasRole`
|
|
126
|
+
- `readManyLiquidationBonusBps`
|
|
127
|
+
- `readManyOraclePositionMeta`
|
|
128
|
+
- `readManyPositionSnapshots`
|
|
129
|
+
- `readManyTargetConfigs`
|
|
130
|
+
- `readManyTargetFunctionRoles`
|
|
131
|
+
- `readMergeLiquidatorBasics`
|
|
132
|
+
- `readOracleConfig`
|
|
133
|
+
- `readOraclePositionMeta`
|
|
134
|
+
- `readOracleRegistry`
|
|
135
|
+
- `readOracleRegistryPage`
|
|
136
|
+
- `readPoolAccounting`
|
|
137
|
+
- `readPoolCaps`
|
|
138
|
+
- `readPoolSnapshot`
|
|
139
|
+
- `readPositionLtvOverride`
|
|
140
|
+
- `readPositionSnapshot`
|
|
141
|
+
- `readProxyAdminPaused`
|
|
142
|
+
- `readRoleSummary`
|
|
143
|
+
- `readSystemSnapshot`
|
|
144
|
+
- `readTargetConfig`
|
|
145
|
+
- `readTierLiquidationConfig`
|
|
146
|
+
<!-- END GENERATED:VIEW_HELPERS -->
|
|
147
|
+
|
|
106
148
|
```ts
|
|
107
149
|
import { readOracleRegistry, readPoolSnapshot } from "@varla/sdk";
|
|
108
150
|
|
package/dist/views/admin.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ type StrategyLike = {
|
|
|
5
5
|
getRateParams: () => Promise<unknown>;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
+
export type InterestRateParams = {
|
|
9
|
+
optimalUsageRatio: number;
|
|
10
|
+
baseVariableBorrowRate: number;
|
|
11
|
+
variableRateSlope1: number;
|
|
12
|
+
variableRateSlope2: number;
|
|
13
|
+
};
|
|
8
14
|
type PoolLike = {
|
|
9
15
|
read: {
|
|
10
16
|
interestRateStrategy: () => Promise<Address>;
|
|
@@ -14,7 +20,7 @@ export declare function readInterestRateStrategyBasics(params: {
|
|
|
14
20
|
strategy: StrategyLike;
|
|
15
21
|
}): Promise<{
|
|
16
22
|
pool: Address;
|
|
17
|
-
rateParams:
|
|
23
|
+
rateParams: InterestRateParams;
|
|
18
24
|
}>;
|
|
19
25
|
/**
|
|
20
26
|
* Convenience: some deployments may not export `interestRateStrategy` via the SDK addressbook.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/views/admin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AAIpE,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7B,aAAa,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;KACvC,CAAC;CACH,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE;QACJ,oBAAoB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;KAC9C,CAAC;CACH,CAAC;AAEF,wBAAsB,8BAA8B,CAAC,MAAM,EAAE;IAC3D,QAAQ,EAAE,YAAY,CAAC;CACxB,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,CAMlD;AAED;;;GAGG;AACH,wBAAsB,+BAA+B,CAAC,MAAM,EAAE;IAC5D,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;CAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOA;AAED,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;KAChC,CAAC;CACH,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,MAAM,EAAE;IACjD,UAAU,EAAE,cAAc,CAAC;CAC5B,GAAG,OAAO,CAAC,OAAO,CAAC,CAEnB"}
|
package/dist/views/admin.js
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
// Note: explicit .js extension is required for Node ESM resolution.
|
|
2
2
|
import { getContract } from "viem";
|
|
3
3
|
import { abis } from "../generated.js";
|
|
4
|
+
function normalizeRateParams(raw) {
|
|
5
|
+
const r = raw;
|
|
6
|
+
const optimalUsageRatio = r.optimalUsageRatio ?? r[0];
|
|
7
|
+
const baseVariableBorrowRate = r.baseVariableBorrowRate ?? r[1];
|
|
8
|
+
const variableRateSlope1 = r.variableRateSlope1 ?? r[2];
|
|
9
|
+
const variableRateSlope2 = r.variableRateSlope2 ?? r[3];
|
|
10
|
+
const toNum = (v) => (typeof v === "bigint" ? Number(v) : v);
|
|
11
|
+
const o = toNum(optimalUsageRatio);
|
|
12
|
+
const b = toNum(baseVariableBorrowRate);
|
|
13
|
+
const s1 = toNum(variableRateSlope1);
|
|
14
|
+
const s2 = toNum(variableRateSlope2);
|
|
15
|
+
if (![o, b, s1, s2].every((x) => typeof x === "number" && Number.isFinite(x))) {
|
|
16
|
+
throw new Error("Unexpected getRateParams() return shape");
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
optimalUsageRatio: o,
|
|
20
|
+
baseVariableBorrowRate: b,
|
|
21
|
+
variableRateSlope1: s1,
|
|
22
|
+
variableRateSlope2: s2,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
4
25
|
export async function readInterestRateStrategyBasics(params) {
|
|
5
26
|
const [pool, rateParams] = await Promise.all([
|
|
6
27
|
params.strategy.read.pool(),
|
|
7
28
|
params.strategy.read.getRateParams(),
|
|
8
29
|
]);
|
|
9
|
-
return { pool, rateParams };
|
|
30
|
+
return { pool, rateParams: normalizeRateParams(rateParams) };
|
|
10
31
|
}
|
|
11
32
|
/**
|
|
12
33
|
* Convenience: some deployments may not export `interestRateStrategy` via the SDK addressbook.
|
package/dist/views/core.d.ts
CHANGED
|
@@ -30,6 +30,48 @@ export declare function readAccountPositions(params: {
|
|
|
30
30
|
positionIds: bigint[];
|
|
31
31
|
balances: bigint[];
|
|
32
32
|
}>;
|
|
33
|
+
export type ReadBorrowersPage = {
|
|
34
|
+
total: number;
|
|
35
|
+
start: number;
|
|
36
|
+
end: number;
|
|
37
|
+
borrowers: Address[];
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Paged read of Core's `_borrowers` set.
|
|
41
|
+
*
|
|
42
|
+
* This is intended for monitoring/indexers; it avoids returning a massive array.
|
|
43
|
+
*/
|
|
44
|
+
export declare function readBorrowersPage(params: {
|
|
45
|
+
core: {
|
|
46
|
+
address: Address;
|
|
47
|
+
read: {
|
|
48
|
+
getBorrowersCount: () => Promise<bigint>;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
client: {
|
|
52
|
+
multicall: (args: any) => Promise<any>;
|
|
53
|
+
};
|
|
54
|
+
start: number;
|
|
55
|
+
limit: number;
|
|
56
|
+
chunkSize?: number;
|
|
57
|
+
}): Promise<ReadBorrowersPage>;
|
|
58
|
+
/**
|
|
59
|
+
* Hydrates a list of borrowers into normalized snapshots.
|
|
60
|
+
*
|
|
61
|
+
* Returns results aligned to input order.
|
|
62
|
+
*/
|
|
63
|
+
export declare function readManyAccountSnapshots(params: {
|
|
64
|
+
core: {
|
|
65
|
+
address: Address;
|
|
66
|
+
};
|
|
67
|
+
client: {
|
|
68
|
+
multicall: (args: any) => Promise<any>;
|
|
69
|
+
};
|
|
70
|
+
users: readonly Address[];
|
|
71
|
+
chunkSize?: number;
|
|
72
|
+
}): Promise<Array<{
|
|
73
|
+
user: Address;
|
|
74
|
+
} & ReadAccountSnapshot>>;
|
|
33
75
|
export type ReadHealthFactor = {
|
|
34
76
|
healthFactor: bigint;
|
|
35
77
|
canBeLiquidated: boolean;
|
package/dist/views/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/views/core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAsB,mBAAmB,CAAC,MAAM,EAAE;IAChD,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,iBAAiB,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;SACnE,CAAC;KACH,CAAC;IACF,IAAI,EAAE,OAAO,CAAC;CACf,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAyB/B;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE;IACjD,IAAI,EAAE;QACJ,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,EAAE;YACJ,cAAc,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;SAC1E,CAAC;KACH,CAAC;IACF,MAAM,EAAE;QACN,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,C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Positions(params) {
|
|
|
48
48
|
}
|
|
49
49
|
return { positionIds, balances };
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Paged read of Core's `_borrowers` set.
|
|
53
|
+
*
|
|
54
|
+
* This is intended for monitoring/indexers; it avoids returning a massive array.
|
|
55
|
+
*/
|
|
56
|
+
export async function readBorrowersPage(params) {
|
|
57
|
+
const chunkSize = params.chunkSize ?? 256;
|
|
58
|
+
if (!Number.isInteger(params.start) || params.start < 0) {
|
|
59
|
+
throw new Error(`Invalid start: ${params.start}`);
|
|
60
|
+
}
|
|
61
|
+
if (!Number.isInteger(params.limit) || params.limit <= 0) {
|
|
62
|
+
throw new Error(`Invalid limit: ${params.limit}`);
|
|
63
|
+
}
|
|
64
|
+
const count = await params.core.read.getBorrowersCount();
|
|
65
|
+
const total = Number(count);
|
|
66
|
+
if (!Number.isSafeInteger(total) || total < 0) {
|
|
67
|
+
throw new Error(`Invalid borrowers count: ${count}`);
|
|
68
|
+
}
|
|
69
|
+
const start = Math.min(params.start, total);
|
|
70
|
+
const end = Math.min(total, start + params.limit);
|
|
71
|
+
if (end <= start) {
|
|
72
|
+
return { total, start, end, borrowers: [] };
|
|
73
|
+
}
|
|
74
|
+
const calls = Array.from({ length: end - start }, (_, j) => {
|
|
75
|
+
const i = start + j;
|
|
76
|
+
return {
|
|
77
|
+
address: params.core.address,
|
|
78
|
+
abi: abis.VARLACORE_ABI,
|
|
79
|
+
functionName: "getBorrowerAt",
|
|
80
|
+
args: [BigInt(i)],
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
const res = await multicallChunks({
|
|
84
|
+
client: params.client,
|
|
85
|
+
contracts: calls,
|
|
86
|
+
chunkSize,
|
|
87
|
+
});
|
|
88
|
+
const borrowers = [];
|
|
89
|
+
for (const r of res) {
|
|
90
|
+
if (r.status !== "success") {
|
|
91
|
+
throw new Error(`Core getBorrowerAt multicall failed: ${String(r.error ?? "unknown")}`);
|
|
92
|
+
}
|
|
93
|
+
borrowers.push(r.result);
|
|
94
|
+
}
|
|
95
|
+
return { total, start, end, borrowers };
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Hydrates a list of borrowers into normalized snapshots.
|
|
99
|
+
*
|
|
100
|
+
* Returns results aligned to input order.
|
|
101
|
+
*/
|
|
102
|
+
export async function readManyAccountSnapshots(params) {
|
|
103
|
+
const chunkSize = params.chunkSize ?? 256;
|
|
104
|
+
if (params.users.length === 0)
|
|
105
|
+
return [];
|
|
106
|
+
const calls = params.users.map((user) => ({
|
|
107
|
+
address: params.core.address,
|
|
108
|
+
abi: abis.VARLACORE_ABI,
|
|
109
|
+
functionName: "getAccountSummary",
|
|
110
|
+
args: [user],
|
|
111
|
+
}));
|
|
112
|
+
const res = await multicallChunks({
|
|
113
|
+
client: params.client,
|
|
114
|
+
contracts: calls,
|
|
115
|
+
chunkSize,
|
|
116
|
+
});
|
|
117
|
+
const out = [];
|
|
118
|
+
for (let i = 0; i < res.length; i++) {
|
|
119
|
+
const r = res[i];
|
|
120
|
+
if (r.status !== "success") {
|
|
121
|
+
throw new Error(`Core getAccountSummary multicall failed: ${String(r.error ?? "unknown")}`);
|
|
122
|
+
}
|
|
123
|
+
const snap = await readAccountSnapshot({
|
|
124
|
+
core: {
|
|
125
|
+
read: {
|
|
126
|
+
getAccountSummary: async () => r.result,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
user: params.users[i],
|
|
130
|
+
});
|
|
131
|
+
out.push({ user: params.users[i], ...snap });
|
|
132
|
+
}
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
51
135
|
/**
|
|
52
136
|
* Read the user's health factor and whether liquidation is currently allowed.
|
|
53
137
|
*
|
package/dist/views/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
|
package/dist/views/index.js
CHANGED
package/dist/views/oracle.d.ts
CHANGED
|
@@ -23,6 +23,30 @@ export type ReadOracleRegistryParams = {
|
|
|
23
23
|
* - `getConfiguredPositionAt(i)` via multicall
|
|
24
24
|
*/
|
|
25
25
|
export declare function readOracleRegistry(params: ReadOracleRegistryParams): Promise<bigint[]>;
|
|
26
|
+
export type ReadOracleRegistryPage = {
|
|
27
|
+
/** Total configured positions (same value returned by getConfiguredPositionsCount). */
|
|
28
|
+
total: number;
|
|
29
|
+
/** Start index used (0-based). */
|
|
30
|
+
start: number;
|
|
31
|
+
/** End index used (exclusive). */
|
|
32
|
+
end: number;
|
|
33
|
+
/** PositionIds for [start, end), aligned with registry index ordering. */
|
|
34
|
+
positionIds: bigint[];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Paged oracle registry read.
|
|
38
|
+
*
|
|
39
|
+
* Useful for:
|
|
40
|
+
* - frontends that want lazy loading
|
|
41
|
+
* - indexers that want checkpointing
|
|
42
|
+
*/
|
|
43
|
+
export declare function readOracleRegistryPage(params: {
|
|
44
|
+
oracle: ReadOracleRegistryParams["oracle"];
|
|
45
|
+
client: ReadOracleRegistryParams["client"];
|
|
46
|
+
start: number;
|
|
47
|
+
limit: number;
|
|
48
|
+
chunkSize?: number;
|
|
49
|
+
}): Promise<ReadOracleRegistryPage>;
|
|
26
50
|
export type ReadOracleConfig = {
|
|
27
51
|
maxStaleness: bigint;
|
|
28
52
|
liquidationGracePeriod: bigint;
|
|
@@ -73,4 +97,64 @@ export declare function readManyPositionSnapshots(params: {
|
|
|
73
97
|
positionIds: readonly bigint[];
|
|
74
98
|
chunkSize?: number;
|
|
75
99
|
}): Promise<ReadPositionSnapshot[]>;
|
|
100
|
+
export type ReadOraclePositionMeta = {
|
|
101
|
+
positionId: bigint;
|
|
102
|
+
conditionId: `0x${string}`;
|
|
103
|
+
resolutionTime: bigint;
|
|
104
|
+
oppositePositionId: bigint;
|
|
105
|
+
isNegRisk: boolean;
|
|
106
|
+
negRiskMarketId: `0x${string}`;
|
|
107
|
+
isManuallyInvalidated: boolean;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Reads frequently-needed oracle metadata for a position.
|
|
111
|
+
*
|
|
112
|
+
* This is intentionally split out from `getPositionSnapshot`, since snapshot focuses on
|
|
113
|
+
* pricing/tier/factor, while this focuses on market identity + registry wiring.
|
|
114
|
+
*/
|
|
115
|
+
export declare function readOraclePositionMeta(params: {
|
|
116
|
+
oracle: {
|
|
117
|
+
read: {
|
|
118
|
+
getConditionId: (args: readonly [bigint]) => Promise<`0x${string}`>;
|
|
119
|
+
getResolutionTime: (args: readonly [bigint]) => Promise<bigint>;
|
|
120
|
+
getOppositePositionId: (args: readonly [bigint]) => Promise<bigint>;
|
|
121
|
+
isNegRisk: (args: readonly [bigint]) => Promise<boolean>;
|
|
122
|
+
getNegRiskMarketId: (args: readonly [bigint]) => Promise<`0x${string}`>;
|
|
123
|
+
isManuallyInvalidated: (args: readonly [bigint]) => Promise<boolean>;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
positionId: bigint;
|
|
127
|
+
}): Promise<ReadOraclePositionMeta>;
|
|
128
|
+
/**
|
|
129
|
+
* Multicall-chunked metadata hydration for many positions.
|
|
130
|
+
*
|
|
131
|
+
* Returns results aligned to the input `positionIds` order.
|
|
132
|
+
*/
|
|
133
|
+
export declare function readManyOraclePositionMeta(params: {
|
|
134
|
+
oracle: {
|
|
135
|
+
address: Address;
|
|
136
|
+
};
|
|
137
|
+
client: {
|
|
138
|
+
multicall: (args: any) => Promise<any>;
|
|
139
|
+
};
|
|
140
|
+
positionIds: readonly bigint[];
|
|
141
|
+
chunkSize?: number;
|
|
142
|
+
}): Promise<ReadOraclePositionMeta[]>;
|
|
143
|
+
/**
|
|
144
|
+
* Convenience wrapper for callers that already have an oracle registry list.
|
|
145
|
+
*/
|
|
146
|
+
export declare function hydrateOraclePositionIds(params: {
|
|
147
|
+
oracle: {
|
|
148
|
+
address: Address;
|
|
149
|
+
};
|
|
150
|
+
client: {
|
|
151
|
+
multicall: (args: any) => Promise<any>;
|
|
152
|
+
};
|
|
153
|
+
positionIds: readonly bigint[];
|
|
154
|
+
chunkSize?: number;
|
|
155
|
+
}): Promise<{
|
|
156
|
+
positionIds: bigint[];
|
|
157
|
+
snapshots: ReadPositionSnapshot[];
|
|
158
|
+
meta: ReadOraclePositionMeta[];
|
|
159
|
+
}>;
|
|
76
160
|
//# sourceMappingURL=oracle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oracle.d.ts","sourceRoot":"","sources":["../../src/views/oracle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE;QACN,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,EAAE;YACJ,2BAA2B,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;SACpD,CAAC;KACH,CAAC;IACF,MAAM,EAAE;QACN,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;KACxC,CAAC;IACF;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;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AAO,CAAC,CAAC;SACtE,CAAC;KACH,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA2BlC;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,CAAC,MAAM,EAAE;IACvD,MAAM,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAC7B,MAAM,EAAE;QAAE,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;IACnD,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAmGpC;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAAC,MAAM,EAAE;IACrD,MAAM,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAC7B,MAAM,EAAE;QAAE,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;IACnD,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,oBAAoB,EAAE,CAAC;IAClC,IAAI,EAAE,sBAAsB,EAAE,CAAC;CAChC,CAAC,CAiBD"}
|
package/dist/views/oracle.js
CHANGED
|
@@ -39,6 +39,54 @@ export async function readOracleRegistry(params) {
|
|
|
39
39
|
}
|
|
40
40
|
return ids;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Paged oracle registry read.
|
|
44
|
+
*
|
|
45
|
+
* Useful for:
|
|
46
|
+
* - frontends that want lazy loading
|
|
47
|
+
* - indexers that want checkpointing
|
|
48
|
+
*/
|
|
49
|
+
export async function readOracleRegistryPage(params) {
|
|
50
|
+
const chunkSize = params.chunkSize ?? 256;
|
|
51
|
+
if (!Number.isInteger(params.start) || params.start < 0) {
|
|
52
|
+
throw new Error(`Invalid start: ${params.start}`);
|
|
53
|
+
}
|
|
54
|
+
if (!Number.isInteger(params.limit) || params.limit <= 0) {
|
|
55
|
+
throw new Error(`Invalid limit: ${params.limit}`);
|
|
56
|
+
}
|
|
57
|
+
const count = await params.oracle.read.getConfiguredPositionsCount();
|
|
58
|
+
const total = Number(count);
|
|
59
|
+
if (!Number.isSafeInteger(total) || total < 0) {
|
|
60
|
+
throw new Error(`Invalid configured positions count: ${count}`);
|
|
61
|
+
}
|
|
62
|
+
const start = Math.min(params.start, total);
|
|
63
|
+
const end = Math.min(total, start + params.limit);
|
|
64
|
+
if (end <= start) {
|
|
65
|
+
return { total, start, end, positionIds: [] };
|
|
66
|
+
}
|
|
67
|
+
const calls = Array.from({ length: end - start }, (_, j) => {
|
|
68
|
+
const i = start + j;
|
|
69
|
+
return {
|
|
70
|
+
address: params.oracle.address,
|
|
71
|
+
abi: abis.VARLAORACLE_ABI,
|
|
72
|
+
functionName: "getConfiguredPositionAt",
|
|
73
|
+
args: [BigInt(i)],
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
const res = await multicallChunks({
|
|
77
|
+
client: params.client,
|
|
78
|
+
contracts: calls,
|
|
79
|
+
chunkSize,
|
|
80
|
+
});
|
|
81
|
+
const positionIds = [];
|
|
82
|
+
for (const r of res) {
|
|
83
|
+
if (r.status !== "success") {
|
|
84
|
+
throw new Error(`Oracle registry multicall failed: ${String(r.error ?? "unknown")}`);
|
|
85
|
+
}
|
|
86
|
+
positionIds.push(r.result);
|
|
87
|
+
}
|
|
88
|
+
return { total, start, end, positionIds };
|
|
89
|
+
}
|
|
42
90
|
/**
|
|
43
91
|
* Reads key global oracle config values used by UIs and monitoring.
|
|
44
92
|
*/
|
|
@@ -111,3 +159,142 @@ export async function readManyPositionSnapshots(params) {
|
|
|
111
159
|
}
|
|
112
160
|
return out;
|
|
113
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Reads frequently-needed oracle metadata for a position.
|
|
164
|
+
*
|
|
165
|
+
* This is intentionally split out from `getPositionSnapshot`, since snapshot focuses on
|
|
166
|
+
* pricing/tier/factor, while this focuses on market identity + registry wiring.
|
|
167
|
+
*/
|
|
168
|
+
export async function readOraclePositionMeta(params) {
|
|
169
|
+
const pid = params.positionId;
|
|
170
|
+
const [conditionId, resolutionTime, oppositePositionId, isNegRisk, negRiskMarketId, isManuallyInvalidated,] = await Promise.all([
|
|
171
|
+
params.oracle.read.getConditionId([pid]),
|
|
172
|
+
params.oracle.read.getResolutionTime([pid]),
|
|
173
|
+
params.oracle.read.getOppositePositionId([pid]),
|
|
174
|
+
params.oracle.read.isNegRisk([pid]),
|
|
175
|
+
params.oracle.read.getNegRiskMarketId([pid]),
|
|
176
|
+
params.oracle.read.isManuallyInvalidated([pid]),
|
|
177
|
+
]);
|
|
178
|
+
return {
|
|
179
|
+
positionId: pid,
|
|
180
|
+
conditionId,
|
|
181
|
+
resolutionTime,
|
|
182
|
+
oppositePositionId,
|
|
183
|
+
isNegRisk,
|
|
184
|
+
negRiskMarketId,
|
|
185
|
+
isManuallyInvalidated,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Multicall-chunked metadata hydration for many positions.
|
|
190
|
+
*
|
|
191
|
+
* Returns results aligned to the input `positionIds` order.
|
|
192
|
+
*/
|
|
193
|
+
export async function readManyOraclePositionMeta(params) {
|
|
194
|
+
const chunkSize = params.chunkSize ?? 256;
|
|
195
|
+
if (params.positionIds.length === 0)
|
|
196
|
+
return [];
|
|
197
|
+
const calls = params.positionIds.flatMap((pid) => [
|
|
198
|
+
{
|
|
199
|
+
address: params.oracle.address,
|
|
200
|
+
abi: abis.VARLAORACLE_ABI,
|
|
201
|
+
functionName: "getConditionId",
|
|
202
|
+
args: [pid],
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
address: params.oracle.address,
|
|
206
|
+
abi: abis.VARLAORACLE_ABI,
|
|
207
|
+
functionName: "getResolutionTime",
|
|
208
|
+
args: [pid],
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
address: params.oracle.address,
|
|
212
|
+
abi: abis.VARLAORACLE_ABI,
|
|
213
|
+
functionName: "getOppositePositionId",
|
|
214
|
+
args: [pid],
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
address: params.oracle.address,
|
|
218
|
+
abi: abis.VARLAORACLE_ABI,
|
|
219
|
+
functionName: "isNegRisk",
|
|
220
|
+
args: [pid],
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
address: params.oracle.address,
|
|
224
|
+
abi: abis.VARLAORACLE_ABI,
|
|
225
|
+
functionName: "getNegRiskMarketId",
|
|
226
|
+
args: [pid],
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
address: params.oracle.address,
|
|
230
|
+
abi: abis.VARLAORACLE_ABI,
|
|
231
|
+
functionName: "isManuallyInvalidated",
|
|
232
|
+
args: [pid],
|
|
233
|
+
},
|
|
234
|
+
]);
|
|
235
|
+
const res = await multicallChunks({
|
|
236
|
+
client: params.client,
|
|
237
|
+
contracts: calls,
|
|
238
|
+
chunkSize,
|
|
239
|
+
});
|
|
240
|
+
const out = [];
|
|
241
|
+
const stride = 6;
|
|
242
|
+
for (let i = 0; i < params.positionIds.length; i++) {
|
|
243
|
+
const base = i * stride;
|
|
244
|
+
const r0 = res[base + 0];
|
|
245
|
+
const r1 = res[base + 1];
|
|
246
|
+
const r2 = res[base + 2];
|
|
247
|
+
const r3 = res[base + 3];
|
|
248
|
+
const r4 = res[base + 4];
|
|
249
|
+
const r5 = res[base + 5];
|
|
250
|
+
if (r0.status !== "success") {
|
|
251
|
+
throw new Error(`Oracle getConditionId multicall failed: ${String(r0.error ?? "unknown")}`);
|
|
252
|
+
}
|
|
253
|
+
if (r1.status !== "success") {
|
|
254
|
+
throw new Error(`Oracle getResolutionTime multicall failed: ${String(r1.error ?? "unknown")}`);
|
|
255
|
+
}
|
|
256
|
+
if (r2.status !== "success") {
|
|
257
|
+
throw new Error(`Oracle getOppositePositionId multicall failed: ${String(r2.error ?? "unknown")}`);
|
|
258
|
+
}
|
|
259
|
+
if (r3.status !== "success") {
|
|
260
|
+
throw new Error(`Oracle isNegRisk multicall failed: ${String(r3.error ?? "unknown")}`);
|
|
261
|
+
}
|
|
262
|
+
if (r4.status !== "success") {
|
|
263
|
+
throw new Error(`Oracle getNegRiskMarketId multicall failed: ${String(r4.error ?? "unknown")}`);
|
|
264
|
+
}
|
|
265
|
+
if (r5.status !== "success") {
|
|
266
|
+
throw new Error(`Oracle isManuallyInvalidated multicall failed: ${String(r5.error ?? "unknown")}`);
|
|
267
|
+
}
|
|
268
|
+
out.push({
|
|
269
|
+
positionId: params.positionIds[i],
|
|
270
|
+
conditionId: r0.result,
|
|
271
|
+
resolutionTime: r1.result,
|
|
272
|
+
oppositePositionId: r2.result,
|
|
273
|
+
isNegRisk: r3.result,
|
|
274
|
+
negRiskMarketId: r4.result,
|
|
275
|
+
isManuallyInvalidated: r5.result,
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
return out;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Convenience wrapper for callers that already have an oracle registry list.
|
|
282
|
+
*/
|
|
283
|
+
export async function hydrateOraclePositionIds(params) {
|
|
284
|
+
const chunkSize = params.chunkSize ?? 256;
|
|
285
|
+
const [snapshots, meta] = await Promise.all([
|
|
286
|
+
readManyPositionSnapshots({
|
|
287
|
+
oracle: params.oracle,
|
|
288
|
+
client: params.client,
|
|
289
|
+
positionIds: params.positionIds,
|
|
290
|
+
chunkSize,
|
|
291
|
+
}),
|
|
292
|
+
readManyOraclePositionMeta({
|
|
293
|
+
oracle: params.oracle,
|
|
294
|
+
client: params.client,
|
|
295
|
+
positionIds: params.positionIds,
|
|
296
|
+
chunkSize,
|
|
297
|
+
}),
|
|
298
|
+
]);
|
|
299
|
+
return { positionIds: [...params.positionIds], snapshots, meta };
|
|
300
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReadDefaultLtvConfig, ReadLiquidationConfig } from "./core.js";
|
|
2
|
+
import type { ReadOracleConfig } from "./oracle.js";
|
|
3
|
+
import type { ReadPoolAccounting, ReadPoolCaps, ReadPoolSnapshot } from "./pool.js";
|
|
4
|
+
export type ReadSystemSnapshot = {
|
|
5
|
+
pool: ReadPoolSnapshot;
|
|
6
|
+
poolCaps: ReadPoolCaps;
|
|
7
|
+
poolAccounting: ReadPoolAccounting;
|
|
8
|
+
coreLtv: ReadDefaultLtvConfig;
|
|
9
|
+
coreLiquidation: ReadLiquidationConfig;
|
|
10
|
+
oracle: ReadOracleConfig;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A lightweight “global protocol state” read for dashboards.
|
|
14
|
+
*
|
|
15
|
+
* - no scanning
|
|
16
|
+
* - no registry enumeration
|
|
17
|
+
* - just the config + accounting primitives needed by frontends and monitoring
|
|
18
|
+
*/
|
|
19
|
+
export declare function readSystemSnapshot(params: {
|
|
20
|
+
pool: any;
|
|
21
|
+
core: any;
|
|
22
|
+
oracle: any;
|
|
23
|
+
}): Promise<ReadSystemSnapshot>;
|
|
24
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/views/system.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAMpF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,kBAAkB,CAAC;IACnC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,eAAe,EAAE,qBAAqB,CAAC;IACvC,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE;IAC/C,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,EAAE,GAAG,CAAC;CACb,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAW9B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Note: explicit .js extension is required for Node ESM resolution.
|
|
2
|
+
import { readDefaultLtvConfig, readLiquidationConfig } from "./core.js";
|
|
3
|
+
import { readOracleConfig } from "./oracle.js";
|
|
4
|
+
import { readPoolAccounting, readPoolCaps, readPoolSnapshot } from "./pool.js";
|
|
5
|
+
/**
|
|
6
|
+
* A lightweight “global protocol state” read for dashboards.
|
|
7
|
+
*
|
|
8
|
+
* - no scanning
|
|
9
|
+
* - no registry enumeration
|
|
10
|
+
* - just the config + accounting primitives needed by frontends and monitoring
|
|
11
|
+
*/
|
|
12
|
+
export async function readSystemSnapshot(params) {
|
|
13
|
+
const [pool, poolCaps, poolAccounting, coreLtv, coreLiquidation, oracle] = await Promise.all([
|
|
14
|
+
readPoolSnapshot({ pool: params.pool }),
|
|
15
|
+
readPoolCaps({ pool: params.pool }),
|
|
16
|
+
readPoolAccounting({ pool: params.pool }),
|
|
17
|
+
readDefaultLtvConfig({ core: params.core }),
|
|
18
|
+
readLiquidationConfig({ core: params.core }),
|
|
19
|
+
readOracleConfig({ oracle: params.oracle }),
|
|
20
|
+
]);
|
|
21
|
+
return { pool, poolCaps, poolAccounting, coreLtv, coreLiquidation, oracle };
|
|
22
|
+
}
|