@xoxno/types 1.0.429 → 1.0.431
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/stellar-lending/documents/index.d.ts +0 -1
- package/dist/stellar-lending/documents/index.js +0 -1
- package/dist/stellar-lending/enums/data-type.enum.d.ts +0 -1
- package/dist/stellar-lending/enums/data-type.enum.js +0 -1
- package/dist/stellar-lending/kusto/activity-data.d.ts +31 -0
- package/dist/stellar-lending/kusto/index.d.ts +1 -1
- package/dist/stellar-lending/kusto/index.js +1 -1
- package/dist/stellar-lending/kusto/market-state-data.d.ts +35 -0
- package/dist/stellar-lending/kusto/market-state-data.js +10 -0
- package/package.json +1 -1
- package/dist/stellar-lending/documents/top-holders.doc.d.ts +0 -22
- package/dist/stellar-lending/documents/top-holders.doc.js +0 -16
- package/dist/stellar-lending/kusto/market-snapshot-row.d.ts +0 -25
- package/dist/stellar-lending/kusto/market-snapshot-row.js +0 -2
|
@@ -20,6 +20,5 @@ __exportStar(require("./hub-asset.doc"), exports);
|
|
|
20
20
|
__exportStar(require("./spoke.doc"), exports);
|
|
21
21
|
__exportStar(require("./spoke-asset.doc"), exports);
|
|
22
22
|
__exportStar(require("./account-position.doc"), exports);
|
|
23
|
-
__exportStar(require("./top-holders.doc"), exports);
|
|
24
23
|
__exportStar(require("./governance-proposal.doc"), exports);
|
|
25
24
|
__exportStar(require("./cursor.doc"), exports);
|
|
@@ -9,7 +9,6 @@ var StellarLendingDataType;
|
|
|
9
9
|
StellarLendingDataType["SPOKE"] = "spoke";
|
|
10
10
|
StellarLendingDataType["SPOKE_ASSET"] = "spokeAsset";
|
|
11
11
|
StellarLendingDataType["ACCOUNT_POSITION"] = "accountPosition";
|
|
12
|
-
StellarLendingDataType["TOP_HOLDERS"] = "topHolders";
|
|
13
12
|
StellarLendingDataType["GOVERNANCE_PROPOSAL"] = "governanceProposal";
|
|
14
13
|
StellarLendingDataType["CURSOR"] = "cursor";
|
|
15
14
|
})(StellarLendingDataType || (exports.StellarLendingDataType = StellarLendingDataType = {}));
|
|
@@ -12,9 +12,40 @@ export interface StellarLendingActivityData {
|
|
|
12
12
|
accountId: string | null;
|
|
13
13
|
owner: string | null;
|
|
14
14
|
token: string;
|
|
15
|
+
/** Action delta amount (this tx), big-int string. */
|
|
15
16
|
amount: string;
|
|
16
17
|
amountShort: number;
|
|
17
18
|
oraclePrice: number | null;
|
|
18
19
|
usd: number | null;
|
|
19
20
|
feeShort?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Which side of the position this row mutated (`null` for non-position
|
|
23
|
+
* events: flash loan, strategy fee, bad-debt header).
|
|
24
|
+
*/
|
|
25
|
+
side: 'supply' | 'borrow' | null;
|
|
26
|
+
/**
|
|
27
|
+
* Position's RESULTING scaled balance (27-dec RAY) on `side` AFTER the
|
|
28
|
+
* action — `'0'` when the position is closed. `null` for non-position events.
|
|
29
|
+
* Source of truth for current/historical holders via `arg_max(seq)`.
|
|
30
|
+
*/
|
|
31
|
+
balanceScaledRay: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Denominated resulting balance (display units) — numeric so Kusto can rank
|
|
34
|
+
* holders directly (within a reserve, amount order == scaled order). `null`
|
|
35
|
+
* for non-position events.
|
|
36
|
+
*/
|
|
37
|
+
balanceShort: number | null;
|
|
38
|
+
/**
|
|
39
|
+
* Monotonic event ordinal `ledger * 1e6 + indexInLedger`, derived from the
|
|
40
|
+
* Soroban `getEvents` id `"<ledger>-<index>"`. Use as the `arg_max` key to
|
|
41
|
+
* pick each holder's latest balance deterministically.
|
|
42
|
+
*/
|
|
43
|
+
seq: number;
|
|
44
|
+
/**
|
|
45
|
+
* Pool index (27-dec RAY) on `side` at event time — supply index for supply
|
|
46
|
+
* legs, borrow index for borrow legs. With `balanceShort` (scaled, denominated)
|
|
47
|
+
* the actual balance is `balanceShort * index / 1e27`; interval growth across
|
|
48
|
+
* events yields realized PnL. `null` for non-position events.
|
|
49
|
+
*/
|
|
50
|
+
index: string | null;
|
|
20
51
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './activity-data';
|
|
2
|
-
export * from './market-
|
|
2
|
+
export * from './market-state-data';
|
|
@@ -15,4 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./activity-data"), exports);
|
|
18
|
-
__exportStar(require("./market-
|
|
18
|
+
__exportStar(require("./market-state-data"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActivityType for Stellar-lending market-state activity rows. Deliberately
|
|
3
|
+
* DISTINCT from the MVX `lendingUpdateMarketState` so the existing MVX Kusto
|
|
4
|
+
* update policies (which filter only on `Source=='xoxnoLending'`) never ingest
|
|
5
|
+
* Stellar rows. The new Stellar Kusto functions filter on this + `Chain=='STELLAR'`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const STELLAR_LENDING_MARKET_STATE_ACTIVITY = "stellarLendingUpdateMarketState";
|
|
8
|
+
/**
|
|
9
|
+
* Dynamic JSON written into `NftActivityData.ActivityData` for a Stellar
|
|
10
|
+
* market-state update (emitted on every `market:batch_state_update`). One row
|
|
11
|
+
* per `(hub, asset)`; carries the point-in-time market metrics + price so all
|
|
12
|
+
* market time-series (TVL, APY, utilization, protocol revenue) are derived
|
|
13
|
+
* on-the-fly via Kusto — no snapshot table.
|
|
14
|
+
*
|
|
15
|
+
* Amounts are ACTUAL token units, denominated (display numbers); `*Ray` are
|
|
16
|
+
* 27-dec RAY big-int strings.
|
|
17
|
+
*/
|
|
18
|
+
export interface StellarLendingMarketStateData {
|
|
19
|
+
hubId: number;
|
|
20
|
+
spokeId: number | null;
|
|
21
|
+
token: string;
|
|
22
|
+
symbol: string;
|
|
23
|
+
decimals: number;
|
|
24
|
+
supplyAmount: number;
|
|
25
|
+
borrowAmount: number;
|
|
26
|
+
availableLiquidity: number;
|
|
27
|
+
revenue: number;
|
|
28
|
+
supplyApy: number;
|
|
29
|
+
borrowApy: number;
|
|
30
|
+
utilizationRate: number;
|
|
31
|
+
supplyIndexRay: string;
|
|
32
|
+
borrowIndexRay: string;
|
|
33
|
+
oraclePrice: number | null;
|
|
34
|
+
seq: number;
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STELLAR_LENDING_MARKET_STATE_ACTIVITY = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* ActivityType for Stellar-lending market-state activity rows. Deliberately
|
|
6
|
+
* DISTINCT from the MVX `lendingUpdateMarketState` so the existing MVX Kusto
|
|
7
|
+
* update policies (which filter only on `Source=='xoxnoLending'`) never ingest
|
|
8
|
+
* Stellar rows. The new Stellar Kusto functions filter on this + `Chain=='STELLAR'`.
|
|
9
|
+
*/
|
|
10
|
+
exports.STELLAR_LENDING_MARKET_STATE_ACTIVITY = 'stellarLendingUpdateMarketState';
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { StellarLendingDataType } from '../enums';
|
|
2
|
-
export interface StellarTopHolder {
|
|
3
|
-
owner: string;
|
|
4
|
-
accountId: string;
|
|
5
|
-
scaledRay: string;
|
|
6
|
-
amountShort: number;
|
|
7
|
-
sharePct: number;
|
|
8
|
-
}
|
|
9
|
-
export declare class StellarTopHoldersDoc {
|
|
10
|
-
dataType: StellarLendingDataType;
|
|
11
|
-
spokeId: number;
|
|
12
|
-
hubId: number;
|
|
13
|
-
asset: string;
|
|
14
|
-
side: 'deposits' | 'borrows';
|
|
15
|
-
totalScaledRay: string;
|
|
16
|
-
holders: StellarTopHolder[];
|
|
17
|
-
updatedAt: number;
|
|
18
|
-
id: string;
|
|
19
|
-
pk: string;
|
|
20
|
-
_ts?: number;
|
|
21
|
-
constructor(props?: Partial<StellarTopHoldersDoc>);
|
|
22
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StellarTopHoldersDoc = void 0;
|
|
4
|
-
const enums_1 = require("../enums");
|
|
5
|
-
class StellarTopHoldersDoc {
|
|
6
|
-
constructor(props) {
|
|
7
|
-
this.dataType = enums_1.StellarLendingDataType.TOP_HOLDERS;
|
|
8
|
-
this.totalScaledRay = '0';
|
|
9
|
-
this.holders = [];
|
|
10
|
-
this.updatedAt = 0;
|
|
11
|
-
Object.assign(this, props);
|
|
12
|
-
this.pk = this.dataType;
|
|
13
|
-
this.id = `topHolders:${this.spokeId}:${this.hubId}:${this.asset}:${this.side}`;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.StellarTopHoldersDoc = StellarTopHoldersDoc;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One row of the Kusto `StellarLendingMarketSnapshot` table, written by the
|
|
3
|
-
* hub-aware snapshot cron. `SpokeId` is null for hub/asset-scoped rows and set
|
|
4
|
-
* for spoke/reserve-scoped rows.
|
|
5
|
-
*/
|
|
6
|
-
export interface StellarLendingMarketSnapshotRow {
|
|
7
|
-
SnapshotAt: string;
|
|
8
|
-
Chain: 'STELLAR';
|
|
9
|
-
HubId: number;
|
|
10
|
-
SpokeId: number | null;
|
|
11
|
-
Token: string;
|
|
12
|
-
Symbol: string;
|
|
13
|
-
Decimals: number;
|
|
14
|
-
UsdPrice: number;
|
|
15
|
-
SupplyApy: number;
|
|
16
|
-
BorrowApy: number;
|
|
17
|
-
Utilization: number;
|
|
18
|
-
TotalDepositsRaw: string;
|
|
19
|
-
TotalDepositsUsd: number;
|
|
20
|
-
TotalBorrowsRaw: string;
|
|
21
|
-
TotalBorrowsUsd: number;
|
|
22
|
-
AvailableLiquidityUsd: number;
|
|
23
|
-
SupplyIndexRay: string;
|
|
24
|
-
BorrowIndexRay: string;
|
|
25
|
-
}
|