@percolatorct/sdk 1.0.0-beta.24 → 1.0.0-beta.26
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 +13 -4
- package/dist/abi/index.d.ts +1 -0
- package/dist/abi/instructions.d.ts +149 -63
- package/dist/abi/nft.d.ts +134 -0
- package/dist/config/program-ids.d.ts +1 -1
- package/dist/index.js +725 -166
- package/dist/index.js.map +1 -1
- package/dist/solana/discovery.d.ts +2 -13
- package/dist/solana/slab.d.ts +58 -1
- package/dist/solana/stake.d.ts +25 -0
- package/package.json +1 -1
|
@@ -36,16 +36,11 @@ export interface DiscoveredMarket {
|
|
|
36
36
|
* in SLAB_TIERS_V0 for discovery of legacy on-chain accounts.
|
|
37
37
|
*/
|
|
38
38
|
/**
|
|
39
|
-
* Default slab tiers for the current mainnet program (v12.
|
|
39
|
+
* Default slab tiers for the current mainnet program (v12.17).
|
|
40
40
|
* These are used by useCreateMarket to allocate slab accounts of the correct size.
|
|
41
|
+
* V12_17: two-bucket warmup, per-side funding, ACCOUNT_SIZE=352 (SBF).
|
|
41
42
|
*/
|
|
42
43
|
export declare const SLAB_TIERS: {
|
|
43
|
-
readonly micro: {
|
|
44
|
-
maxAccounts: number;
|
|
45
|
-
dataSize: number;
|
|
46
|
-
label: string;
|
|
47
|
-
description: string;
|
|
48
|
-
};
|
|
49
44
|
readonly small: {
|
|
50
45
|
maxAccounts: number;
|
|
51
46
|
dataSize: number;
|
|
@@ -166,12 +161,6 @@ export declare const SLAB_TIERS_V1D_LEGACY: {
|
|
|
166
161
|
};
|
|
167
162
|
/** @deprecated Alias — use SLAB_TIERS (already V1) */
|
|
168
163
|
export declare const SLAB_TIERS_V1: {
|
|
169
|
-
readonly micro: {
|
|
170
|
-
maxAccounts: number;
|
|
171
|
-
dataSize: number;
|
|
172
|
-
label: string;
|
|
173
|
-
description: string;
|
|
174
|
-
};
|
|
175
164
|
readonly small: {
|
|
176
165
|
maxAccounts: number;
|
|
177
166
|
dataSize: number;
|
package/dist/solana/slab.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Connection, PublicKey } from "@solana/web3.js";
|
|
2
|
+
/** Slab magic number ("PERCOLAT" as little-endian u64). */
|
|
3
|
+
export declare const SLAB_MAGIC: bigint;
|
|
2
4
|
/**
|
|
3
5
|
* Full slab layout descriptor. Returned by detectSlabLayout().
|
|
4
6
|
* All engine field offsets are relative to engineOff.
|
|
@@ -142,6 +144,19 @@ export declare const SLAB_TIERS_V12_15: Record<string, {
|
|
|
142
144
|
label: string;
|
|
143
145
|
description: string;
|
|
144
146
|
}>;
|
|
147
|
+
/**
|
|
148
|
+
* V12_17 slab tier sizes — percolator v12.17 (two-bucket warmup, per-side funding).
|
|
149
|
+
* Uses SBF sizes (on-chain layout) for the dataSize values.
|
|
150
|
+
* ENGINE_OFF=504 (SBF), ACCOUNT_SIZE=352 (SBF), BITMAP_OFF=712 (SBF), postBitmap=4.
|
|
151
|
+
* RISK_BUF_LEN=160 appended after engine.
|
|
152
|
+
* Supported tiers: small(256), medium(1024), large(4096).
|
|
153
|
+
*/
|
|
154
|
+
export declare const SLAB_TIERS_V12_17: Record<string, {
|
|
155
|
+
maxAccounts: number;
|
|
156
|
+
dataSize: number;
|
|
157
|
+
label: string;
|
|
158
|
+
description: string;
|
|
159
|
+
}>;
|
|
145
160
|
/**
|
|
146
161
|
* Detect the slab layout version from the raw account data length.
|
|
147
162
|
* Returns the full SlabLayout descriptor, or null if the size is unrecognised.
|
|
@@ -320,8 +335,22 @@ export interface EngineState {
|
|
|
320
335
|
numUsedAccounts: number;
|
|
321
336
|
nextAccountId: bigint;
|
|
322
337
|
markPriceE6: bigint;
|
|
323
|
-
/** last_oracle_price (u64, e6). V12_15 only
|
|
338
|
+
/** last_oracle_price (u64, e6). V12_15+ only. 0n on pre-v12.15. */
|
|
324
339
|
oraclePriceE6: bigint;
|
|
340
|
+
/** Cumulative funding numerator for long side (i128). 0n on pre-v12.17. */
|
|
341
|
+
fLongNum: bigint;
|
|
342
|
+
/** Cumulative funding numerator for short side (i128). 0n on pre-v12.17. */
|
|
343
|
+
fShortNum: bigint;
|
|
344
|
+
/** Count of accounts with negative PnL. 0n on pre-v12.17. */
|
|
345
|
+
negPnlAccountCount: bigint;
|
|
346
|
+
/** Last funding-sample price (u64 e6). 0n on pre-v12.17. */
|
|
347
|
+
fundPxLast: bigint;
|
|
348
|
+
/** Matured positive PnL total (u128). v12.15+ only. 0n on pre-v12.15 slabs. */
|
|
349
|
+
resolvedKLongTerminalDelta: bigint;
|
|
350
|
+
/** Terminal K delta for short side (i128). 0n on pre-v12.17. */
|
|
351
|
+
resolvedKShortTerminalDelta: bigint;
|
|
352
|
+
/** Live oracle price used during resolution (u64 e6). 0n on pre-v12.17. */
|
|
353
|
+
resolvedLivePrice: bigint;
|
|
325
354
|
}
|
|
326
355
|
export declare enum AccountKind {
|
|
327
356
|
User = 0,
|
|
@@ -366,6 +395,34 @@ export interface Account {
|
|
|
366
395
|
overflowNewest: ReserveCohortBytes | null;
|
|
367
396
|
/** True if overflowNewest contains valid data. null on pre-v12.15 slabs. */
|
|
368
397
|
overflowNewestPresent: boolean | null;
|
|
398
|
+
/** Per-account cumulative funding snapshot (i128). 0n on pre-v12.17 slabs. */
|
|
399
|
+
fSnap: bigint;
|
|
400
|
+
/** ADL A-basis snapshot (u128). 0n on pre-v12.17 slabs. */
|
|
401
|
+
adlABasis: bigint;
|
|
402
|
+
/** ADL K-coefficient snapshot (i128). 0n on pre-v12.17 slabs. */
|
|
403
|
+
adlKSnap: bigint;
|
|
404
|
+
/** ADL epoch snapshot (u64). 0n on pre-v12.17 slabs. */
|
|
405
|
+
adlEpochSnap: bigint;
|
|
406
|
+
/** True if the scheduled warmup bucket is active. null on pre-v12.17. */
|
|
407
|
+
schedPresent: boolean | null;
|
|
408
|
+
/** Remaining unreleased quantity in scheduled bucket. null on pre-v12.17. */
|
|
409
|
+
schedRemainingQ: bigint | null;
|
|
410
|
+
/** Anchor quantity for scheduled bucket. null on pre-v12.17. */
|
|
411
|
+
schedAnchorQ: bigint | null;
|
|
412
|
+
/** Start slot for scheduled bucket. null on pre-v12.17. */
|
|
413
|
+
schedStartSlot: bigint | null;
|
|
414
|
+
/** Warmup horizon for scheduled bucket. null on pre-v12.17. */
|
|
415
|
+
schedHorizon: bigint | null;
|
|
416
|
+
/** Release quantity for scheduled bucket. null on pre-v12.17. */
|
|
417
|
+
schedReleaseQ: bigint | null;
|
|
418
|
+
/** True if the pending warmup bucket is active. null on pre-v12.17. */
|
|
419
|
+
pendingPresent: boolean | null;
|
|
420
|
+
/** Remaining unreleased quantity in pending bucket. null on pre-v12.17. */
|
|
421
|
+
pendingRemainingQ: bigint | null;
|
|
422
|
+
/** Warmup horizon for pending bucket. null on pre-v12.17. */
|
|
423
|
+
pendingHorizon: bigint | null;
|
|
424
|
+
/** Creation slot for pending bucket. null on pre-v12.17. */
|
|
425
|
+
pendingCreatedSlot: bigint | null;
|
|
369
426
|
}
|
|
370
427
|
export declare function fetchSlab(connection: Connection, slabPubkey: PublicKey): Promise<Uint8Array>;
|
|
371
428
|
export declare const RAMP_START_BPS = 1000n;
|
package/dist/solana/stake.d.ts
CHANGED
|
@@ -136,6 +136,31 @@ export declare const STAKE_POOL_SIZE = 352;
|
|
|
136
136
|
* Decode a StakePool account from raw data buffer. * Uses DataView for all u64/u16 reads — browser-safe.
|
|
137
137
|
*/
|
|
138
138
|
export declare function decodeStakePool(data: Uint8Array): StakePoolState;
|
|
139
|
+
/** Size of StakeDeposit on-chain (bytes). */
|
|
140
|
+
export declare const STAKE_DEPOSIT_SIZE = 152;
|
|
141
|
+
/** Decoded StakeDeposit PDA state. */
|
|
142
|
+
export interface StakeDepositState {
|
|
143
|
+
isInitialized: boolean;
|
|
144
|
+
bump: number;
|
|
145
|
+
pool: PublicKey;
|
|
146
|
+
user: PublicKey;
|
|
147
|
+
lastDepositSlot: bigint;
|
|
148
|
+
lpAmount: bigint;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Decode a StakeDeposit PDA account from raw data.
|
|
152
|
+
*
|
|
153
|
+
* On-chain layout (152 bytes, percolator-stake/src/state.rs):
|
|
154
|
+
* [0] is_initialized u8
|
|
155
|
+
* [1] bump u8
|
|
156
|
+
* [2..8] _padding
|
|
157
|
+
* [8..40] pool [u8; 32]
|
|
158
|
+
* [40..72] user [u8; 32]
|
|
159
|
+
* [72..80] last_deposit_slot u64
|
|
160
|
+
* [80..88] lp_amount u64
|
|
161
|
+
* [88..152] _reserved
|
|
162
|
+
*/
|
|
163
|
+
export declare function decodeDepositPda(data: Uint8Array): StakeDepositState;
|
|
139
164
|
export interface StakeAccounts {
|
|
140
165
|
/** InitPool accounts */
|
|
141
166
|
initPool: {
|