@percolatorct/sdk 1.0.0-beta.2 → 1.0.0-beta.20
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/abi/accounts.d.ts +0 -20
- package/dist/abi/instructions.d.ts +93 -49
- package/dist/config/program-ids.d.ts +1 -1
- package/dist/index.js +461 -168
- package/dist/index.js.map +1 -1
- package/dist/solana/pda.d.ts +0 -10
- package/dist/solana/slab.d.ts +68 -5
- package/dist/solana/stake.d.ts +2 -2
- package/package.json +2 -1
package/dist/abi/accounts.d.ts
CHANGED
|
@@ -117,21 +117,6 @@ export declare const ACCOUNTS_UNPAUSE_MARKET: readonly AccountSpec[];
|
|
|
117
117
|
* remember the positional order, and errors clearly on missing names.
|
|
118
118
|
*/
|
|
119
119
|
export declare function buildAccountMetas(spec: readonly AccountSpec[], keys: PublicKey[] | Record<string, PublicKey>): AccountMeta[];
|
|
120
|
-
/**
|
|
121
|
-
* CreateInsuranceMint: 9 accounts
|
|
122
|
-
* Creates SPL mint PDA for insurance LP tokens. Admin only, once per market.
|
|
123
|
-
*/
|
|
124
|
-
export declare const ACCOUNTS_CREATE_INSURANCE_MINT: readonly AccountSpec[];
|
|
125
|
-
/**
|
|
126
|
-
* DepositInsuranceLP: 8 accounts
|
|
127
|
-
* Deposit collateral into insurance fund, receive LP tokens.
|
|
128
|
-
*/
|
|
129
|
-
export declare const ACCOUNTS_DEPOSIT_INSURANCE_LP: readonly AccountSpec[];
|
|
130
|
-
/**
|
|
131
|
-
* WithdrawInsuranceLP: 8 accounts
|
|
132
|
-
* Burn LP tokens and withdraw proportional share of insurance fund.
|
|
133
|
-
*/
|
|
134
|
-
export declare const ACCOUNTS_WITHDRAW_INSURANCE_LP: readonly AccountSpec[];
|
|
135
120
|
/**
|
|
136
121
|
* LpVaultWithdraw: 10 accounts (tag 39, PERC-627 / GH#1926 / PERC-8287)
|
|
137
122
|
*
|
|
@@ -207,11 +192,6 @@ export declare const ACCOUNTS_AUDIT_CRANK: readonly AccountSpec[];
|
|
|
207
192
|
* Permissionless — no signer required beyond fee payer.
|
|
208
193
|
*/
|
|
209
194
|
export declare const ACCOUNTS_ADVANCE_ORACLE_PHASE: readonly AccountSpec[];
|
|
210
|
-
/**
|
|
211
|
-
* TopUpKeeperFund: 3 accounts
|
|
212
|
-
* Permissionless — anyone can fund. Transfers lamports directly (no system program).
|
|
213
|
-
*/
|
|
214
|
-
export declare const ACCOUNTS_TOPUP_KEEPER_FUND: readonly AccountSpec[];
|
|
215
195
|
/**
|
|
216
196
|
* SetOiImbalanceHardBlock: 2 accounts
|
|
217
197
|
* Sets the OI imbalance hard-block threshold (admin only)
|
|
@@ -30,16 +30,20 @@ export declare const IX_TAG: {
|
|
|
30
30
|
readonly ResolveMarket: 19;
|
|
31
31
|
readonly WithdrawInsurance: 20;
|
|
32
32
|
readonly AdminForceClose: 21;
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
readonly
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
33
|
+
readonly SetInsuranceWithdrawPolicy: 22;
|
|
34
|
+
/** @deprecated Use SetInsuranceWithdrawPolicy */ readonly UpdateRiskParams: 22;
|
|
35
|
+
readonly WithdrawInsuranceLimited: 23;
|
|
36
|
+
/** @deprecated Use WithdrawInsuranceLimited */ readonly RenounceAdmin: 23;
|
|
37
|
+
readonly QueryLpFees: 24;
|
|
38
|
+
readonly ReclaimEmptyAccount: 25;
|
|
39
|
+
readonly SettleAccount: 26;
|
|
40
|
+
readonly DepositFeeCredits: 27;
|
|
41
|
+
/** @deprecated No on-chain PauseMarket instruction */ readonly PauseMarket: 27;
|
|
42
|
+
readonly ConvertReleasedPnl: 28;
|
|
43
|
+
/** @deprecated No on-chain UnpauseMarket instruction */ readonly UnpauseMarket: 28;
|
|
44
|
+
readonly ResolvePermissionless: 29;
|
|
45
|
+
/** @deprecated Use ResolvePermissionless */ readonly AcceptAdmin: 29;
|
|
46
|
+
readonly ForceCloseResolved: 30;
|
|
43
47
|
readonly SetPythOracle: 32;
|
|
44
48
|
readonly UpdateMarkPrice: 33;
|
|
45
49
|
readonly UpdateHyperpMark: 34;
|
|
@@ -81,8 +85,6 @@ export declare const IX_TAG: {
|
|
|
81
85
|
readonly AttestCrossMargin: 55;
|
|
82
86
|
/** PERC-622: Advance oracle phase (permissionless crank) */
|
|
83
87
|
readonly AdvanceOraclePhase: 56;
|
|
84
|
-
/** PERC-623: Top up a market's keeper fund (permissionless) */
|
|
85
|
-
readonly TopUpKeeperFund: 57;
|
|
86
88
|
/** PERC-629: Slash a market creator's deposit (permissionless) */
|
|
87
89
|
readonly SlashCreationDeposit: 58;
|
|
88
90
|
/** PERC-628: Initialize the global shared vault (admin) */
|
|
@@ -138,7 +140,18 @@ export interface InitMarketArgs {
|
|
|
138
140
|
invert: number;
|
|
139
141
|
unitScale: number;
|
|
140
142
|
initialMarkPriceE6: bigint | string;
|
|
141
|
-
|
|
143
|
+
maxMaintenanceFeePerSlot?: bigint | string;
|
|
144
|
+
maxInsuranceFloor?: bigint | string;
|
|
145
|
+
minOraclePriceCap?: bigint | string;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated Use hMin/hMax instead (v12.15+). If provided without hMin/hMax, both h_min
|
|
148
|
+
* and h_max are set to this value for backwards compatibility.
|
|
149
|
+
*/
|
|
150
|
+
warmupPeriodSlots?: bigint | string;
|
|
151
|
+
/** Minimum horizon slots (v12.15+). Replaces warmupPeriodSlots. */
|
|
152
|
+
hMin?: bigint | string;
|
|
153
|
+
/** Maximum horizon slots (v12.15+). Replaces warmupPeriodSlots. */
|
|
154
|
+
hMax?: bigint | string;
|
|
142
155
|
maintenanceMarginBps: bigint | string;
|
|
143
156
|
initialMarginBps: bigint | string;
|
|
144
157
|
tradingFeeBps: bigint | string;
|
|
@@ -151,6 +164,9 @@ export interface InitMarketArgs {
|
|
|
151
164
|
liquidationFeeCap: bigint | string;
|
|
152
165
|
liquidationBufferBps: bigint | string;
|
|
153
166
|
minLiquidationAbs: bigint | string;
|
|
167
|
+
minInitialDeposit: bigint | string;
|
|
168
|
+
minNonzeroMmReq: bigint | string;
|
|
169
|
+
minNonzeroImReq: bigint | string;
|
|
154
170
|
}
|
|
155
171
|
export declare function encodeInitMarket(args: InitMarketArgs): Uint8Array;
|
|
156
172
|
/**
|
|
@@ -390,27 +406,6 @@ export declare const UNRESOLVE_CONFIRMATION = 16045690984503054900n;
|
|
|
390
406
|
* to prevent accidental invocation.
|
|
391
407
|
*/
|
|
392
408
|
export declare function encodeRenounceAdmin(): Uint8Array;
|
|
393
|
-
/**
|
|
394
|
-
* CreateInsuranceMint instruction data (1 byte)
|
|
395
|
-
* Creates the SPL mint PDA for insurance LP tokens. Admin only, once per market.
|
|
396
|
-
*/
|
|
397
|
-
export declare function encodeCreateInsuranceMint(): Uint8Array;
|
|
398
|
-
/**
|
|
399
|
-
* DepositInsuranceLP instruction data (9 bytes)
|
|
400
|
-
* Deposit collateral into insurance fund, receive LP tokens proportional to share.
|
|
401
|
-
*/
|
|
402
|
-
export interface DepositInsuranceLPArgs {
|
|
403
|
-
amount: bigint | string;
|
|
404
|
-
}
|
|
405
|
-
export declare function encodeDepositInsuranceLP(args: DepositInsuranceLPArgs): Uint8Array;
|
|
406
|
-
/**
|
|
407
|
-
* WithdrawInsuranceLP instruction data (9 bytes)
|
|
408
|
-
* Burn LP tokens and withdraw proportional share of insurance fund.
|
|
409
|
-
*/
|
|
410
|
-
export interface WithdrawInsuranceLPArgs {
|
|
411
|
-
lpAmount: bigint | string;
|
|
412
|
-
}
|
|
413
|
-
export declare function encodeWithdrawInsuranceLP(args: WithdrawInsuranceLPArgs): Uint8Array;
|
|
414
409
|
/**
|
|
415
410
|
* LpVaultWithdraw (Tag 39, PERC-627 / GH#1926 / PERC-8287) — burn LP vault tokens and
|
|
416
411
|
* withdraw proportional collateral.
|
|
@@ -701,21 +696,6 @@ export declare const PHASE2_MATURITY_SLOTS = 3024000n;
|
|
|
701
696
|
* @returns [newPhase, shouldTransition]
|
|
702
697
|
*/
|
|
703
698
|
export declare function checkPhaseTransition(currentSlot: bigint, marketCreatedSlot: bigint, oraclePhase: number, cumulativeVolumeE6: bigint, phase2DeltaSlots: number, hasMatureOracle: boolean): [number, boolean];
|
|
704
|
-
/**
|
|
705
|
-
* TopUpKeeperFund (Tag 57) — permissionless keeper fund top-up.
|
|
706
|
-
*
|
|
707
|
-
* Instruction data: tag(1) + amount(8) = 9 bytes
|
|
708
|
-
*
|
|
709
|
-
* Accounts:
|
|
710
|
-
* 0. [signer, writable] Funder
|
|
711
|
-
* 1. [writable] Slab
|
|
712
|
-
* 2. [writable] Keeper fund PDA
|
|
713
|
-
* 3. [] System program
|
|
714
|
-
*/
|
|
715
|
-
export interface TopUpKeeperFundArgs {
|
|
716
|
-
amount: bigint | string;
|
|
717
|
-
}
|
|
718
|
-
export declare function encodeTopUpKeeperFund(args: TopUpKeeperFundArgs): Uint8Array;
|
|
719
699
|
/**
|
|
720
700
|
* SlashCreationDeposit (Tag 58) — permissionless: slash a market creator's deposit
|
|
721
701
|
* after the spam grace period has elapsed (PERC-629).
|
|
@@ -1056,3 +1036,67 @@ export interface InitMatcherCtxArgs {
|
|
|
1056
1036
|
skewSpreadMultBps: number;
|
|
1057
1037
|
}
|
|
1058
1038
|
export declare function encodeInitMatcherCtx(args: InitMatcherCtxArgs): Uint8Array;
|
|
1039
|
+
/** SetInsuranceWithdrawPolicy (tag 22): authority + min_withdraw_base + max_withdraw_bps + cooldown_slots */
|
|
1040
|
+
export interface SetInsuranceWithdrawPolicyArgs {
|
|
1041
|
+
authority: PublicKey | string;
|
|
1042
|
+
minWithdrawBase: bigint | string;
|
|
1043
|
+
maxWithdrawBps: number;
|
|
1044
|
+
cooldownSlots: bigint | string;
|
|
1045
|
+
}
|
|
1046
|
+
export declare function encodeSetInsuranceWithdrawPolicy(args: SetInsuranceWithdrawPolicyArgs): Uint8Array;
|
|
1047
|
+
/** WithdrawInsuranceLimited (tag 23): amount */
|
|
1048
|
+
export declare function encodeWithdrawInsuranceLimited(args: {
|
|
1049
|
+
amount: bigint | string;
|
|
1050
|
+
}): Uint8Array;
|
|
1051
|
+
/** ResolvePermissionless (tag 29): no args */
|
|
1052
|
+
export declare function encodeResolvePermissionless(): Uint8Array;
|
|
1053
|
+
/** ForceCloseResolved (tag 30): user_idx */
|
|
1054
|
+
export declare function encodeForceCloseResolved(args: {
|
|
1055
|
+
userIdx: number;
|
|
1056
|
+
}): Uint8Array;
|
|
1057
|
+
/** CreateLpVault (tag 37): fee_share_bps + util_curve_enabled */
|
|
1058
|
+
export declare function encodeCreateLpVault(args: {
|
|
1059
|
+
feeShareBps: bigint | string;
|
|
1060
|
+
utilCurveEnabled?: boolean;
|
|
1061
|
+
}): Uint8Array;
|
|
1062
|
+
/** LpVaultDeposit (tag 38): amount */
|
|
1063
|
+
export declare function encodeLpVaultDeposit(args: {
|
|
1064
|
+
amount: bigint | string;
|
|
1065
|
+
}): Uint8Array;
|
|
1066
|
+
/** LpVaultCrankFees (tag 40): no args */
|
|
1067
|
+
export declare function encodeLpVaultCrankFees(): Uint8Array;
|
|
1068
|
+
/** ChallengeSettlement (tag 43): proposed_price_e6 */
|
|
1069
|
+
export declare function encodeChallengeSettlement(args: {
|
|
1070
|
+
proposedPriceE6: bigint | string;
|
|
1071
|
+
}): Uint8Array;
|
|
1072
|
+
/** ResolveDispute (tag 44): accept (0 = reject, 1 = accept) */
|
|
1073
|
+
export declare function encodeResolveDispute(args: {
|
|
1074
|
+
accept: number;
|
|
1075
|
+
}): Uint8Array;
|
|
1076
|
+
/** DepositLpCollateral (tag 45): user_idx + lp_amount */
|
|
1077
|
+
export declare function encodeDepositLpCollateral(args: {
|
|
1078
|
+
userIdx: number;
|
|
1079
|
+
lpAmount: bigint | string;
|
|
1080
|
+
}): Uint8Array;
|
|
1081
|
+
/** WithdrawLpCollateral (tag 46): user_idx + lp_amount */
|
|
1082
|
+
export declare function encodeWithdrawLpCollateral(args: {
|
|
1083
|
+
userIdx: number;
|
|
1084
|
+
lpAmount: bigint | string;
|
|
1085
|
+
}): Uint8Array;
|
|
1086
|
+
/** SetOffsetPair (tag 54): offset_bps */
|
|
1087
|
+
export declare function encodeSetOffsetPair(args: {
|
|
1088
|
+
offsetBps: number;
|
|
1089
|
+
}): Uint8Array;
|
|
1090
|
+
/** AttestCrossMargin (tag 55): user_idx_a + user_idx_b */
|
|
1091
|
+
export declare function encodeAttestCrossMargin(args: {
|
|
1092
|
+
userIdxA: number;
|
|
1093
|
+
userIdxB: number;
|
|
1094
|
+
}): Uint8Array;
|
|
1095
|
+
/** RescueOrphanVault (tag 72): no args */
|
|
1096
|
+
export declare function encodeRescueOrphanVault(): Uint8Array;
|
|
1097
|
+
/** CloseOrphanSlab (tag 73): no args */
|
|
1098
|
+
export declare function encodeCloseOrphanSlab(): Uint8Array;
|
|
1099
|
+
/** SetDexPool (tag 74): pool pubkey */
|
|
1100
|
+
export declare function encodeSetDexPool(args: {
|
|
1101
|
+
pool: PublicKey | string;
|
|
1102
|
+
}): Uint8Array;
|
|
@@ -17,7 +17,7 @@ export declare const PROGRAM_IDS: {
|
|
|
17
17
|
readonly matcher: "GTRgyTDfrMvBubALAqtHuQwT8tbGyXid7svXZKtWfC9k";
|
|
18
18
|
};
|
|
19
19
|
readonly mainnet: {
|
|
20
|
-
readonly percolator: "
|
|
20
|
+
readonly percolator: "ESa89R5Es3rJ5mnwGybVRG1GrNt9etP11Z5V2QWD4edv";
|
|
21
21
|
readonly matcher: "DHP6DtwXP1yJsz8YzfoeigRFPB979gzmumkmCxDLSkUX";
|
|
22
22
|
};
|
|
23
23
|
};
|