@exponent-labs/exponent-fetcher 0.9.23 → 0.9.25
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/build/constants.js +3 -3
- package/build/constants.js.map +1 -1
- package/build/exponentFetcher.d.ts +11 -2
- package/build/exponentFetcher.js +74 -41
- package/build/exponentFetcher.js.map +1 -1
- package/build/utils/adrena.d.ts +2 -0
- package/build/utils/adrena.js +2 -1
- package/build/utils/adrena.js.map +1 -1
- package/build/utils/fragmetric.d.ts +2 -0
- package/build/utils/fragmetric.js +2 -2
- package/build/utils/fragmetric.js.map +1 -1
- package/build/utils/jito.d.ts +2 -0
- package/build/utils/jito.js +2 -1
- package/build/utils/jito.js.map +1 -1
- package/build/utils/jupiter.d.ts +2 -0
- package/build/utils/jupiter.js +3 -2
- package/build/utils/jupiter.js.map +1 -1
- package/build/utils/kamino.d.ts +2 -0
- package/build/utils/kamino.js +2 -1
- package/build/utils/kamino.js.map +1 -1
- package/build/utils/meteora.d.ts +3 -0
- package/build/utils/meteora.js +5 -5
- package/build/utils/meteora.js.map +1 -1
- package/build/utils/ore.d.ts +3 -0
- package/build/utils/ore.js +2 -1
- package/build/utils/ore.js.map +1 -1
- package/build/utils/perena.d.ts +2 -0
- package/build/utils/perena.js +3 -2
- package/build/utils/perena.js.map +1 -1
- package/build/utils/sanctum.d.ts +2 -0
- package/build/utils/sanctum.js +2 -1
- package/build/utils/sanctum.js.map +1 -1
- package/build/utils/solstice.d.ts +2 -0
- package/build/utils/solstice.js +3 -2
- package/build/utils/solstice.js.map +1 -1
- package/package.json +21 -21
- package/src/exponentFetcher.ts +54 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanctum.js","sourceRoot":"","sources":["../../src/utils/sanctum.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sanctum.js","sourceRoot":"","sources":["../../src/utils/sanctum.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4D;AAC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sticeRedemptionRate =
|
|
4
|
-
exports.calculateSolsticeGlamVaultExchangeRate = calculateSolsticeGlamVaultExchangeRate;
|
|
3
|
+
exports.calculateSolsticeGlamVaultExchangeRate = exports.calculateSolsticeRedemptionRate = void 0;
|
|
5
4
|
const solstice_idl_1 = require("@exponent-labs/solstice-idl");
|
|
6
5
|
const spl_token_1 = require("@solana/spl-token");
|
|
7
6
|
function calculateSolsticeRedemptionRate(accounts) {
|
|
@@ -43,6 +42,7 @@ function calculateSolsticeRedemptionRate(accounts) {
|
|
|
43
42
|
totalVestedAssets: totalVestedAssets.toString(),
|
|
44
43
|
};
|
|
45
44
|
}
|
|
45
|
+
exports.calculateSolsticeRedemptionRate = calculateSolsticeRedemptionRate;
|
|
46
46
|
/**
|
|
47
47
|
* Calculates the Solstice GLAM vault stSLX exchange rate using the same account
|
|
48
48
|
* layout and ratio as the Generic Standard on-chain interface.
|
|
@@ -60,4 +60,5 @@ function calculateSolsticeGlamVaultExchangeRate(accounts) {
|
|
|
60
60
|
const denominator = stslxSupply * 10n ** BigInt(slxMint.decimals);
|
|
61
61
|
return Number(numerator) / Number(denominator);
|
|
62
62
|
}
|
|
63
|
+
exports.calculateSolsticeGlamVaultExchangeRate = calculateSolsticeGlamVaultExchangeRate;
|
|
63
64
|
//# sourceMappingURL=solstice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solstice.js","sourceRoot":"","sources":["../../src/utils/solstice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"solstice.js","sourceRoot":"","sources":["../../src/utils/solstice.ts"],"names":[],"mappings":";;;AAAA,8DAAuF;AACvF,iDAA6D;AAE7D,SAAgB,+BAA+B,CAAC,QAAwD;IAOtG,sDAAsD;IACtD,MAAM,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,GAAG,IAAA,wDAAyC,EAAC;QAC7F,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,eAAe,EAAE,QAAQ,CAAC,eAAe;KA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AA;AAChD,CAAC;AApBD,wFAoBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exponent-labs/exponent-fetcher",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.25",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"types": "build/index.d.ts",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -9,26 +9,26 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@coral-xyz/anchor": "0.30.0",
|
|
12
|
-
"@exponent-labs/adrena-idl": "0.9.
|
|
13
|
-
"@exponent-labs/chainlink-idl": "0.9.
|
|
14
|
-
"@exponent-labs/exponent-idl": "0.9.
|
|
15
|
-
"@exponent-labs/exponent-types": "0.9.
|
|
16
|
-
"@exponent-labs/fragmetric-idl": "0.9.
|
|
17
|
-
"@exponent-labs/generic-sy-idl": "0.9.
|
|
18
|
-
"@exponent-labs/jito-restaking-sy-idl": "0.9.
|
|
19
|
-
"@exponent-labs/jupiter-lend-idl": "0.9.
|
|
20
|
-
"@exponent-labs/jupiter-perps-idl": "0.9.
|
|
21
|
-
"@exponent-labs/kamino-reserve-deserializer": "0.9.
|
|
22
|
-
"@exponent-labs/kamino-sy-idl": "0.9.
|
|
23
|
-
"@exponent-labs/kamino-vault-idl": "0.9.
|
|
24
|
-
"@exponent-labs/marginfi-sy-idl": "0.9.
|
|
25
|
-
"@exponent-labs/meteora-idl": "0.9.
|
|
26
|
-
"@exponent-labs/perena-sy-idl": "0.9.
|
|
27
|
-
"@exponent-labs/precise-number": "0.9.
|
|
28
|
-
"@exponent-labs/sanctum-idl": "0.9.
|
|
29
|
-
"@exponent-labs/solstice-idl": "0.9.
|
|
30
|
-
"@exponent-labs/exponent-clmm-idl": "0.9.
|
|
31
|
-
"@exponent-labs/exponent-orderbook-idl": "0.9.
|
|
12
|
+
"@exponent-labs/adrena-idl": "0.9.25",
|
|
13
|
+
"@exponent-labs/chainlink-idl": "0.9.25",
|
|
14
|
+
"@exponent-labs/exponent-idl": "0.9.25",
|
|
15
|
+
"@exponent-labs/exponent-types": "0.9.25",
|
|
16
|
+
"@exponent-labs/fragmetric-idl": "0.9.25",
|
|
17
|
+
"@exponent-labs/generic-sy-idl": "0.9.25",
|
|
18
|
+
"@exponent-labs/jito-restaking-sy-idl": "0.9.25",
|
|
19
|
+
"@exponent-labs/jupiter-lend-idl": "0.9.25",
|
|
20
|
+
"@exponent-labs/jupiter-perps-idl": "0.9.25",
|
|
21
|
+
"@exponent-labs/kamino-reserve-deserializer": "0.9.25",
|
|
22
|
+
"@exponent-labs/kamino-sy-idl": "0.9.25",
|
|
23
|
+
"@exponent-labs/kamino-vault-idl": "0.9.25",
|
|
24
|
+
"@exponent-labs/marginfi-sy-idl": "0.9.25",
|
|
25
|
+
"@exponent-labs/meteora-idl": "0.9.25",
|
|
26
|
+
"@exponent-labs/perena-sy-idl": "0.9.25",
|
|
27
|
+
"@exponent-labs/precise-number": "0.9.25",
|
|
28
|
+
"@exponent-labs/sanctum-idl": "0.9.25",
|
|
29
|
+
"@exponent-labs/solstice-idl": "0.9.25",
|
|
30
|
+
"@exponent-labs/exponent-clmm-idl": "0.9.25",
|
|
31
|
+
"@exponent-labs/exponent-orderbook-idl": "0.9.25",
|
|
32
32
|
"@solana/spl-stake-pool": "1.1.8",
|
|
33
33
|
"@solana/spl-token": "0.4.6",
|
|
34
34
|
"bn-sqrt": "^1.0.0",
|
package/src/exponentFetcher.ts
CHANGED
|
@@ -700,6 +700,7 @@ export function deserializeMarketThree(m: MarketThreeRaw): MarketThree {
|
|
|
700
700
|
selfAddress: m.selfAddress,
|
|
701
701
|
syProgram: m.syProgram,
|
|
702
702
|
statusFlags: m.statusFlags,
|
|
703
|
+
selfCpiStatus: m.selfCpiStatus,
|
|
703
704
|
cpiSyAccounts: m.cpiSyAccounts,
|
|
704
705
|
isCurrentFlashSwap: m.isCurrentFlashSwap,
|
|
705
706
|
lpFarm: m.lpFarm,
|
|
@@ -868,9 +869,12 @@ function deserializeOrderbook(data: Buffer): Orderbook {
|
|
|
868
869
|
offset += 8
|
|
869
870
|
const priceDecimals = data.readUint8(offset)
|
|
870
871
|
offset += 1
|
|
872
|
+
// _placeholder_one[15]
|
|
873
|
+
offset += 15
|
|
874
|
+
const finalPyIndex = readPreciseNumberAsFloat()
|
|
871
875
|
// Skip ConfigurationOptions padding/reserve:
|
|
872
|
-
//
|
|
873
|
-
offset +=
|
|
876
|
+
// _placeholder_three[32] + _placeholder_four[32] + _reserved[1024]
|
|
877
|
+
offset += 1088
|
|
874
878
|
|
|
875
879
|
// Pubkeys
|
|
876
880
|
const vault = readPubkey()
|
|
@@ -884,12 +888,10 @@ function deserializeOrderbook(data: Buffer): Orderbook {
|
|
|
884
888
|
const cpiAccountOrderbook = readPubkey()
|
|
885
889
|
const admin = readPubkey()
|
|
886
890
|
|
|
887
|
-
|
|
888
|
-
offset += 32
|
|
891
|
+
const lastSyExchangeRate = readPreciseNumberAsFloat()
|
|
889
892
|
|
|
890
893
|
// OrderbookFinancials struct
|
|
891
|
-
|
|
892
|
-
offset += 32
|
|
894
|
+
const lastSeenSyIndex = readPreciseNumberAsFloat()
|
|
893
895
|
const ytBalance = data.readBigUInt64LE(offset)
|
|
894
896
|
offset += 8
|
|
895
897
|
const syBalance = data.readBigUInt64LE(offset)
|
|
@@ -914,9 +916,11 @@ function deserializeOrderbook(data: Buffer): Orderbook {
|
|
|
914
916
|
thresholdAmount,
|
|
915
917
|
lnMakerFeeRate,
|
|
916
918
|
lnTakerFeeRate,
|
|
919
|
+
finalPyIndex,
|
|
917
920
|
}
|
|
918
921
|
const financials: OrderbookFinancials = {
|
|
919
922
|
expirationTs,
|
|
923
|
+
lastSeenSyIndex,
|
|
920
924
|
syBalance: syBalance,
|
|
921
925
|
ytBalance: ytBalance,
|
|
922
926
|
ptBalance: ptBalance,
|
|
@@ -948,7 +952,7 @@ function deserializeOrderbook(data: Buffer): Orderbook {
|
|
|
948
952
|
offset += 4
|
|
949
953
|
|
|
950
954
|
// each RBNode entry = registers[3] + key:u32 + first_offer:u32
|
|
951
|
-
const
|
|
955
|
+
const priceSlots: PriceTreeNode[] = []
|
|
952
956
|
for (let i = 0; i < MAX_PRICE_NODES; i++) {
|
|
953
957
|
const left = data.readUInt32LE(offset)
|
|
954
958
|
offset += 4
|
|
@@ -968,10 +972,35 @@ function deserializeOrderbook(data: Buffer): Orderbook {
|
|
|
968
972
|
offset += 4
|
|
969
973
|
const lastOfferBuyYt = data.readUInt32LE(offset)
|
|
970
974
|
offset += 4
|
|
971
|
-
|
|
972
|
-
|
|
975
|
+
priceSlots.push({
|
|
976
|
+
priceIndex: i + 1,
|
|
977
|
+
key,
|
|
978
|
+
firstOfferSellYt,
|
|
979
|
+
firstOfferBuyYt,
|
|
980
|
+
lastOfferSellYt,
|
|
981
|
+
lastOfferBuyYt,
|
|
982
|
+
parent,
|
|
983
|
+
left,
|
|
984
|
+
right,
|
|
985
|
+
})
|
|
973
986
|
}
|
|
974
987
|
|
|
988
|
+
const pricePointers = [root]
|
|
989
|
+
const visitedPricePointers = new Set<number>()
|
|
990
|
+
while (pricePointers.length > 0) {
|
|
991
|
+
const pricePointer = pricePointers.pop()!
|
|
992
|
+
if (pricePointer === 0 || visitedPricePointers.has(pricePointer)) continue
|
|
993
|
+
const price = priceSlots[pricePointer - 1]
|
|
994
|
+
if (!price) throw new Error(`Invalid orderbook price pointer ${pricePointer}`)
|
|
995
|
+
|
|
996
|
+
visitedPricePointers.add(pricePointer)
|
|
997
|
+
pricePointers.push(price.left, price.right)
|
|
998
|
+
}
|
|
999
|
+
if (visitedPricePointers.size !== priceTreeSize) {
|
|
1000
|
+
throw new Error(`Orderbook price tree size mismatch: decoded ${visitedPricePointers.size}, expected ${priceTreeSize}`)
|
|
1001
|
+
}
|
|
1002
|
+
const prices = priceSlots.filter((price) => visitedPricePointers.has(price.priceIndex))
|
|
1003
|
+
|
|
975
1004
|
// ─── Parse Offers slab ────────────────────────────────────────────────────
|
|
976
1005
|
// NodeAllocator<Offer, MAX_OFFERS, 4>
|
|
977
1006
|
// header: size:u64, bump_index:u32, free_list_head:u32
|
|
@@ -1024,6 +1053,7 @@ function deserializeOrderbook(data: Buffer): Orderbook {
|
|
|
1024
1053
|
// ─── Parse UserEscrow slab ────────────────────────────────────────────────
|
|
1025
1054
|
// NodeAllocator<UserEscrow, MAX_USER_ESCROWS, 2>
|
|
1026
1055
|
// header: size:u64, bump_index:u32, free_list_head:u32
|
|
1056
|
+
const escrowStartOffset = offset
|
|
1027
1057
|
const escSize = Number(data.readBigUInt64LE(offset))
|
|
1028
1058
|
offset += 8
|
|
1029
1059
|
const _escBump = data.readUInt32LE(offset)
|
|
@@ -1031,7 +1061,8 @@ function deserializeOrderbook(data: Buffer): Orderbook {
|
|
|
1031
1061
|
const _escFreeIdx = data.readUInt32LE(offset)
|
|
1032
1062
|
offset += 4
|
|
1033
1063
|
|
|
1034
|
-
// each Node = [
|
|
1064
|
+
// each Node = registers[2] + UserEscrow.value
|
|
1065
|
+
// NodeAllocator<UserEscrow, MAX_USER_ESCROWS, 2> means 2 registers per node
|
|
1035
1066
|
const userEscrows: UserEscrowNode[] = []
|
|
1036
1067
|
for (let i = 0; i < MAX_USER_ESCROWS; i++) {
|
|
1037
1068
|
const register = data.readUInt32LE(offset)
|
|
@@ -1082,6 +1113,7 @@ function deserializeOrderbook(data: Buffer): Orderbook {
|
|
|
1082
1113
|
tokenEscrowYt,
|
|
1083
1114
|
tokenEscrowPt,
|
|
1084
1115
|
cpiAccountOrderbook,
|
|
1116
|
+
lastSyExchangeRate,
|
|
1085
1117
|
financials,
|
|
1086
1118
|
prices,
|
|
1087
1119
|
configurationOptions,
|
|
@@ -1268,6 +1300,7 @@ export interface MarketThree {
|
|
|
1268
1300
|
ticks: web3.PublicKey
|
|
1269
1301
|
statusFlags: number
|
|
1270
1302
|
configurationOptions: MarketConfigurationOptions
|
|
1303
|
+
selfCpiStatus: number
|
|
1271
1304
|
financials: MarketThreeFinancials
|
|
1272
1305
|
cpiSyAccounts: CpiAccountIndexes
|
|
1273
1306
|
cpiCoreAccounts: MarketCpiCoreIndexes
|
|
@@ -1367,6 +1400,7 @@ export interface MarketThreeRaw {
|
|
|
1367
1400
|
ticks: web3.PublicKey
|
|
1368
1401
|
statusFlags: number
|
|
1369
1402
|
configurationOptions: MarketConfigurationOptionsRaw
|
|
1403
|
+
selfCpiStatus: number
|
|
1370
1404
|
financials: MarketThreeFinancialsRaw
|
|
1371
1405
|
cpiSyAccounts: CpiAccountIndexes
|
|
1372
1406
|
cpiCoreAccounts: MarketCpiCoreIndexes
|
|
@@ -1494,6 +1528,7 @@ export interface Vault {
|
|
|
1494
1528
|
|
|
1495
1529
|
interface OrderbookFinancials {
|
|
1496
1530
|
expirationTs: number
|
|
1531
|
+
lastSeenSyIndex: number
|
|
1497
1532
|
ytBalance: bigint
|
|
1498
1533
|
syBalance: bigint
|
|
1499
1534
|
ptBalance: bigint
|
|
@@ -1508,6 +1543,7 @@ export interface ConfigurationOptions {
|
|
|
1508
1543
|
thresholdAmount: bigint
|
|
1509
1544
|
lnMakerFeeRate: number
|
|
1510
1545
|
lnTakerFeeRate: number
|
|
1546
|
+
finalPyIndex: number
|
|
1511
1547
|
}
|
|
1512
1548
|
|
|
1513
1549
|
export interface Orderbook {
|
|
@@ -1521,6 +1557,7 @@ export interface Orderbook {
|
|
|
1521
1557
|
tokenEscrowPt: web3.PublicKey
|
|
1522
1558
|
cpiAccountOrderbook: web3.PublicKey
|
|
1523
1559
|
admin: web3.PublicKey
|
|
1560
|
+
lastSyExchangeRate: number
|
|
1524
1561
|
configurationOptions: ConfigurationOptions
|
|
1525
1562
|
financials: OrderbookFinancials
|
|
1526
1563
|
prices: PriceTreeNode[]
|
|
@@ -1783,6 +1820,7 @@ interface OrderbookRaw {
|
|
|
1783
1820
|
|
|
1784
1821
|
interface OrderbookFinancialsRaw {
|
|
1785
1822
|
expirationTs: number
|
|
1823
|
+
lastSeenSyIndex: number
|
|
1786
1824
|
ytBalance: BN
|
|
1787
1825
|
syBalance: BN
|
|
1788
1826
|
ptBalance: BN
|
|
@@ -1809,11 +1847,12 @@ export interface OfferNodeRaw {
|
|
|
1809
1847
|
|
|
1810
1848
|
export interface UserEscrowNodeRaw {
|
|
1811
1849
|
user: web3.PublicKey
|
|
1812
|
-
yieldIndex:
|
|
1850
|
+
yieldIndex: number
|
|
1813
1851
|
ptAmount: BN
|
|
1814
1852
|
syAmount: BN
|
|
1815
1853
|
ytAmount: BN
|
|
1816
|
-
|
|
1854
|
+
stakedYtAmount: BN
|
|
1855
|
+
staged: BN
|
|
1817
1856
|
}
|
|
1818
1857
|
|
|
1819
1858
|
export function deserializeAnchorizedPNum(x: AnchorizedPNum): number {
|
|
@@ -2338,6 +2377,9 @@ export async function fetchReflectRedemptionRate({
|
|
|
2338
2377
|
if (slot > currentSlot) {
|
|
2339
2378
|
throw new Error("Reflect oracle slot is ahead of the current slot")
|
|
2340
2379
|
}
|
|
2380
|
+
|
|
2381
|
+
console.log("currentSlot", currentSlot)
|
|
2382
|
+
console.log("slot", slot)
|
|
2341
2383
|
const slotDelta = currentSlot - slot
|
|
2342
2384
|
|
|
2343
2385
|
if (slotDelta > REFLECT_MAX_STALENESS_SLOTS) {
|