@thru/programs 0.4.1 → 0.4.2
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-manager/index.cjs +39 -2
- package/dist/abi-manager/index.cjs.map +1 -1
- package/dist/abi-manager/index.js +2 -2
- package/dist/amm/index.cjs +39 -2
- package/dist/amm/index.cjs.map +1 -1
- package/dist/amm/index.js +1 -1
- package/dist/bootstrap-addresses/index.cjs +41 -2
- package/dist/bootstrap-addresses/index.cjs.map +1 -1
- package/dist/bootstrap-addresses/index.d.cts +8 -1
- package/dist/bootstrap-addresses/index.d.ts +8 -1
- package/dist/bootstrap-addresses/index.js +1 -1
- package/dist/{chunk-TRPUGPZJ.js → chunk-2FFCNXCE.js} +58 -5
- package/dist/chunk-2FFCNXCE.js.map +1 -0
- package/dist/{chunk-QCJFKBAS.js → chunk-I3DLOUB4.js} +3 -3
- package/dist/{chunk-QCJFKBAS.js.map → chunk-I3DLOUB4.js.map} +1 -1
- package/dist/clob/index.cjs +41 -2
- package/dist/clob/index.cjs.map +1 -1
- package/dist/clob/index.d.cts +7 -1
- package/dist/clob/index.d.ts +7 -1
- package/dist/clob/index.js +3 -2
- package/dist/clob/index.js.map +1 -1
- package/dist/deploy/index.cjs +39 -2
- package/dist/deploy/index.cjs.map +1 -1
- package/dist/deploy/index.js +3 -3
- package/dist/oracle/index.cjs +39 -2
- package/dist/oracle/index.cjs.map +1 -1
- package/dist/oracle/index.js +1 -1
- package/dist/passkey-manager/index.cjs +42 -5
- package/dist/passkey-manager/index.cjs.map +1 -1
- package/dist/passkey-manager/index.js +1 -1
- package/dist/perp/index.cjs +1785 -162
- package/dist/perp/index.cjs.map +1 -1
- package/dist/perp/index.d.cts +558 -13
- package/dist/perp/index.d.ts +558 -13
- package/dist/perp/index.js +1749 -163
- package/dist/perp/index.js.map +1 -1
- package/dist/ratelimit/index.cjs +4757 -0
- package/dist/ratelimit/index.cjs.map +1 -0
- package/dist/ratelimit/index.d.cts +171 -0
- package/dist/ratelimit/index.d.ts +171 -0
- package/dist/ratelimit/index.js +4527 -0
- package/dist/ratelimit/index.js.map +1 -0
- package/package.json +7 -2
- package/src/bootstrap-addresses/index.test.ts +17 -0
- package/src/bootstrap-addresses/index.ts +12 -0
- package/src/clob/index.ts +7 -0
- package/src/perp/abi/thru/program/perp/types.ts +1949 -149
- package/src/perp/index.test.ts +189 -3
- package/src/perp/index.ts +316 -3
- package/src/ratelimit/abi/thru/program/ratelimit/types.ts +5448 -0
- package/src/ratelimit/accounts.ts +105 -0
- package/src/ratelimit/constants.ts +49 -0
- package/src/ratelimit/derivation.ts +93 -0
- package/src/ratelimit/index.test.ts +185 -0
- package/src/ratelimit/index.ts +30 -0
- package/src/ratelimit/instructions.ts +244 -0
- package/tsup.config.ts +1 -0
- package/dist/chunk-TRPUGPZJ.js.map +0 -1
package/dist/perp/index.d.cts
CHANGED
|
@@ -614,6 +614,54 @@ declare class ExchangeSetStatusInstructionBuilder {
|
|
|
614
614
|
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
615
615
|
finish(): ExchangeSetStatusInstruction;
|
|
616
616
|
}
|
|
617
|
+
declare class FundingUpdateInstruction {
|
|
618
|
+
private buffer;
|
|
619
|
+
private view;
|
|
620
|
+
private constructor();
|
|
621
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
622
|
+
fieldContext?: Record<string, number | bigint>;
|
|
623
|
+
}): FundingUpdateInstruction;
|
|
624
|
+
static builder(): FundingUpdateInstructionBuilder;
|
|
625
|
+
static fromBuilder(builder: FundingUpdateInstructionBuilder): FundingUpdateInstruction | null;
|
|
626
|
+
get_market_record_idx(): number;
|
|
627
|
+
set_market_record_idx(value: number): void;
|
|
628
|
+
get market_record_idx(): number;
|
|
629
|
+
set market_record_idx(value: number);
|
|
630
|
+
get_reserved0(): number;
|
|
631
|
+
set_reserved0(value: number): void;
|
|
632
|
+
get reserved0(): number;
|
|
633
|
+
set reserved0(value: number);
|
|
634
|
+
get_reserved1(): number;
|
|
635
|
+
set_reserved1(value: number): void;
|
|
636
|
+
get reserved1(): number;
|
|
637
|
+
set reserved1(value: number);
|
|
638
|
+
private static __tnFootprintInternal;
|
|
639
|
+
private static __tnValidateInternal;
|
|
640
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
641
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
642
|
+
static footprintIr(): bigint;
|
|
643
|
+
static footprint(): number;
|
|
644
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
645
|
+
params?: never;
|
|
646
|
+
}): {
|
|
647
|
+
ok: boolean;
|
|
648
|
+
code?: string;
|
|
649
|
+
consumed?: number;
|
|
650
|
+
};
|
|
651
|
+
static new(market_record_idx: number, reserved0: number, reserved1: number): FundingUpdateInstruction;
|
|
652
|
+
static from_array(buffer: Uint8Array): FundingUpdateInstruction | null;
|
|
653
|
+
}
|
|
654
|
+
declare class FundingUpdateInstructionBuilder {
|
|
655
|
+
private buffer;
|
|
656
|
+
private view;
|
|
657
|
+
constructor();
|
|
658
|
+
set_market_record_idx(value: number): this;
|
|
659
|
+
set_reserved0(value: number): this;
|
|
660
|
+
set_reserved1(value: number): this;
|
|
661
|
+
build(): Uint8Array;
|
|
662
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
663
|
+
finish(): FundingUpdateInstruction;
|
|
664
|
+
}
|
|
617
665
|
declare class LiquidateInstruction {
|
|
618
666
|
private buffer;
|
|
619
667
|
private view;
|
|
@@ -1154,6 +1202,79 @@ declare class MarketSetExchangeStatusInstructionBuilder {
|
|
|
1154
1202
|
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
1155
1203
|
finish(): MarketSetExchangeStatusInstruction;
|
|
1156
1204
|
}
|
|
1205
|
+
declare class MarketSetFundingInstruction {
|
|
1206
|
+
private buffer;
|
|
1207
|
+
private view;
|
|
1208
|
+
private constructor();
|
|
1209
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
1210
|
+
fieldContext?: Record<string, number | bigint>;
|
|
1211
|
+
}): MarketSetFundingInstruction;
|
|
1212
|
+
static builder(): MarketSetFundingInstructionBuilder;
|
|
1213
|
+
static fromBuilder(builder: MarketSetFundingInstructionBuilder): MarketSetFundingInstruction | null;
|
|
1214
|
+
get_market_record_idx(): number;
|
|
1215
|
+
set_market_record_idx(value: number): void;
|
|
1216
|
+
get market_record_idx(): number;
|
|
1217
|
+
set market_record_idx(value: number);
|
|
1218
|
+
get_reserved0(): number;
|
|
1219
|
+
set_reserved0(value: number): void;
|
|
1220
|
+
get reserved0(): number;
|
|
1221
|
+
set reserved0(value: number);
|
|
1222
|
+
get_interest_rate(): number;
|
|
1223
|
+
set_interest_rate(value: number): void;
|
|
1224
|
+
get interest_rate(): number;
|
|
1225
|
+
set interest_rate(value: number);
|
|
1226
|
+
get_clamp_small(): number;
|
|
1227
|
+
set_clamp_small(value: number): void;
|
|
1228
|
+
get clamp_small(): number;
|
|
1229
|
+
set clamp_small(value: number);
|
|
1230
|
+
get_clamp_big(): number;
|
|
1231
|
+
set_clamp_big(value: number): void;
|
|
1232
|
+
get clamp_big(): number;
|
|
1233
|
+
set clamp_big(value: number);
|
|
1234
|
+
get_premium_multiplier(): number;
|
|
1235
|
+
set_premium_multiplier(value: number): void;
|
|
1236
|
+
get premium_multiplier(): number;
|
|
1237
|
+
set premium_multiplier(value: number);
|
|
1238
|
+
get_reserved1(): number;
|
|
1239
|
+
set_reserved1(value: number): void;
|
|
1240
|
+
get reserved1(): number;
|
|
1241
|
+
set reserved1(value: number);
|
|
1242
|
+
get_impact_notional(): bigint;
|
|
1243
|
+
set_impact_notional(value: bigint): void;
|
|
1244
|
+
get impact_notional(): bigint;
|
|
1245
|
+
set impact_notional(value: bigint);
|
|
1246
|
+
private static __tnFootprintInternal;
|
|
1247
|
+
private static __tnValidateInternal;
|
|
1248
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
1249
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
1250
|
+
static footprintIr(): bigint;
|
|
1251
|
+
static footprint(): number;
|
|
1252
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
1253
|
+
params?: never;
|
|
1254
|
+
}): {
|
|
1255
|
+
ok: boolean;
|
|
1256
|
+
code?: string;
|
|
1257
|
+
consumed?: number;
|
|
1258
|
+
};
|
|
1259
|
+
static new(market_record_idx: number, reserved0: number, interest_rate: number, clamp_small: number, clamp_big: number, premium_multiplier: number, reserved1: number, impact_notional: bigint): MarketSetFundingInstruction;
|
|
1260
|
+
static from_array(buffer: Uint8Array): MarketSetFundingInstruction | null;
|
|
1261
|
+
}
|
|
1262
|
+
declare class MarketSetFundingInstructionBuilder {
|
|
1263
|
+
private buffer;
|
|
1264
|
+
private view;
|
|
1265
|
+
constructor();
|
|
1266
|
+
set_market_record_idx(value: number): this;
|
|
1267
|
+
set_reserved0(value: number): this;
|
|
1268
|
+
set_interest_rate(value: number): this;
|
|
1269
|
+
set_clamp_small(value: number): this;
|
|
1270
|
+
set_clamp_big(value: number): this;
|
|
1271
|
+
set_premium_multiplier(value: number): this;
|
|
1272
|
+
set_reserved1(value: number): this;
|
|
1273
|
+
set_impact_notional(value: bigint): this;
|
|
1274
|
+
build(): Uint8Array;
|
|
1275
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
1276
|
+
finish(): MarketSetFundingInstruction;
|
|
1277
|
+
}
|
|
1157
1278
|
declare class MarketSetOracleInstruction {
|
|
1158
1279
|
private buffer;
|
|
1159
1280
|
private view;
|
|
@@ -1718,10 +1839,10 @@ declare class SeatEntry {
|
|
|
1718
1839
|
set_head_order_entry_idx(value: number): void;
|
|
1719
1840
|
get head_order_entry_idx(): number;
|
|
1720
1841
|
set head_order_entry_idx(value: number);
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
get
|
|
1724
|
-
set
|
|
1842
|
+
get_funding_carry(): number;
|
|
1843
|
+
set_funding_carry(value: number): void;
|
|
1844
|
+
get funding_carry(): number;
|
|
1845
|
+
set funding_carry(value: number);
|
|
1725
1846
|
get_entry_notional(): bigint;
|
|
1726
1847
|
set_entry_notional(value: bigint): void;
|
|
1727
1848
|
get entry_notional(): bigint;
|
|
@@ -1734,10 +1855,14 @@ declare class SeatEntry {
|
|
|
1734
1855
|
set_open_ask_notional(value: bigint): void;
|
|
1735
1856
|
get open_ask_notional(): bigint;
|
|
1736
1857
|
set open_ask_notional(value: bigint);
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
get
|
|
1740
|
-
set
|
|
1858
|
+
get_funding_snapshot_lo(): bigint;
|
|
1859
|
+
set_funding_snapshot_lo(value: bigint): void;
|
|
1860
|
+
get funding_snapshot_lo(): bigint;
|
|
1861
|
+
set funding_snapshot_lo(value: bigint);
|
|
1862
|
+
get_funding_snapshot_hi(): bigint;
|
|
1863
|
+
set_funding_snapshot_hi(value: bigint): void;
|
|
1864
|
+
get funding_snapshot_hi(): bigint;
|
|
1865
|
+
set funding_snapshot_hi(value: bigint);
|
|
1741
1866
|
get_non_nullable_reserved(): bigint;
|
|
1742
1867
|
set_non_nullable_reserved(value: bigint): void;
|
|
1743
1868
|
get non_nullable_reserved(): bigint;
|
|
@@ -1768,16 +1893,65 @@ declare class SeatEntryBuilder {
|
|
|
1768
1893
|
set_open_bid_lots(value: bigint): this;
|
|
1769
1894
|
set_open_ask_lots(value: bigint): this;
|
|
1770
1895
|
set_head_order_entry_idx(value: number): this;
|
|
1771
|
-
|
|
1896
|
+
set_funding_carry(value: number): this;
|
|
1772
1897
|
set_entry_notional(value: bigint): this;
|
|
1773
1898
|
set_open_bid_notional(value: bigint): this;
|
|
1774
1899
|
set_open_ask_notional(value: bigint): this;
|
|
1775
|
-
|
|
1900
|
+
set_funding_snapshot_lo(value: bigint): this;
|
|
1901
|
+
set_funding_snapshot_hi(value: bigint): this;
|
|
1776
1902
|
set_non_nullable_reserved(value: bigint): this;
|
|
1777
1903
|
build(): Uint8Array;
|
|
1778
1904
|
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
1779
1905
|
finish(): SeatEntry;
|
|
1780
1906
|
}
|
|
1907
|
+
declare class SettleFundingInstruction {
|
|
1908
|
+
private buffer;
|
|
1909
|
+
private view;
|
|
1910
|
+
private constructor();
|
|
1911
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
1912
|
+
fieldContext?: Record<string, number | bigint>;
|
|
1913
|
+
}): SettleFundingInstruction;
|
|
1914
|
+
static builder(): SettleFundingInstructionBuilder;
|
|
1915
|
+
static fromBuilder(builder: SettleFundingInstructionBuilder): SettleFundingInstruction | null;
|
|
1916
|
+
get_market_record_idx(): number;
|
|
1917
|
+
set_market_record_idx(value: number): void;
|
|
1918
|
+
get market_record_idx(): number;
|
|
1919
|
+
set market_record_idx(value: number);
|
|
1920
|
+
get_reserved0(): number;
|
|
1921
|
+
set_reserved0(value: number): void;
|
|
1922
|
+
get reserved0(): number;
|
|
1923
|
+
set reserved0(value: number);
|
|
1924
|
+
get_target_seat_idx(): number;
|
|
1925
|
+
set_target_seat_idx(value: number): void;
|
|
1926
|
+
get target_seat_idx(): number;
|
|
1927
|
+
set target_seat_idx(value: number);
|
|
1928
|
+
private static __tnFootprintInternal;
|
|
1929
|
+
private static __tnValidateInternal;
|
|
1930
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
1931
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
1932
|
+
static footprintIr(): bigint;
|
|
1933
|
+
static footprint(): number;
|
|
1934
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
1935
|
+
params?: never;
|
|
1936
|
+
}): {
|
|
1937
|
+
ok: boolean;
|
|
1938
|
+
code?: string;
|
|
1939
|
+
consumed?: number;
|
|
1940
|
+
};
|
|
1941
|
+
static new(market_record_idx: number, reserved0: number, target_seat_idx: number): SettleFundingInstruction;
|
|
1942
|
+
static from_array(buffer: Uint8Array): SettleFundingInstruction | null;
|
|
1943
|
+
}
|
|
1944
|
+
declare class SettleFundingInstructionBuilder {
|
|
1945
|
+
private buffer;
|
|
1946
|
+
private view;
|
|
1947
|
+
constructor();
|
|
1948
|
+
set_market_record_idx(value: number): this;
|
|
1949
|
+
set_reserved0(value: number): this;
|
|
1950
|
+
set_target_seat_idx(value: number): this;
|
|
1951
|
+
build(): Uint8Array;
|
|
1952
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
1953
|
+
finish(): SettleFundingInstruction;
|
|
1954
|
+
}
|
|
1781
1955
|
declare class TokenBalanceEvent {
|
|
1782
1956
|
private buffer;
|
|
1783
1957
|
private view;
|
|
@@ -2273,6 +2447,83 @@ declare class ExchangeStatusEventBuilder {
|
|
|
2273
2447
|
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
2274
2448
|
finish(): ExchangeStatusEvent;
|
|
2275
2449
|
}
|
|
2450
|
+
declare class FundingRoundEvent {
|
|
2451
|
+
private buffer;
|
|
2452
|
+
private view;
|
|
2453
|
+
private constructor();
|
|
2454
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
2455
|
+
fieldContext?: Record<string, number | bigint>;
|
|
2456
|
+
}): FundingRoundEvent;
|
|
2457
|
+
static builder(): FundingRoundEventBuilder;
|
|
2458
|
+
static fromBuilder(builder: FundingRoundEventBuilder): FundingRoundEvent | null;
|
|
2459
|
+
get_market(): Pubkey;
|
|
2460
|
+
set_market(value: Pubkey): void;
|
|
2461
|
+
get market(): Pubkey;
|
|
2462
|
+
set market(value: Pubkey);
|
|
2463
|
+
get_rate(): bigint;
|
|
2464
|
+
set_rate(value: bigint): void;
|
|
2465
|
+
get rate(): bigint;
|
|
2466
|
+
set rate(value: bigint);
|
|
2467
|
+
get_premium_sum(): bigint;
|
|
2468
|
+
set_premium_sum(value: bigint): void;
|
|
2469
|
+
get premium_sum(): bigint;
|
|
2470
|
+
set premium_sum(value: bigint);
|
|
2471
|
+
get_sample_cnt(): number;
|
|
2472
|
+
set_sample_cnt(value: number): void;
|
|
2473
|
+
get sample_cnt(): number;
|
|
2474
|
+
set sample_cnt(value: number);
|
|
2475
|
+
get_reserved0(): number;
|
|
2476
|
+
set_reserved0(value: number): void;
|
|
2477
|
+
get reserved0(): number;
|
|
2478
|
+
set reserved0(value: number);
|
|
2479
|
+
get_index_price(): bigint;
|
|
2480
|
+
set_index_price(value: bigint): void;
|
|
2481
|
+
get index_price(): bigint;
|
|
2482
|
+
set index_price(value: bigint);
|
|
2483
|
+
get_funding_index_lo(): bigint;
|
|
2484
|
+
set_funding_index_lo(value: bigint): void;
|
|
2485
|
+
get funding_index_lo(): bigint;
|
|
2486
|
+
set funding_index_lo(value: bigint);
|
|
2487
|
+
get_funding_index_hi(): bigint;
|
|
2488
|
+
set_funding_index_hi(value: bigint): void;
|
|
2489
|
+
get funding_index_hi(): bigint;
|
|
2490
|
+
set funding_index_hi(value: bigint);
|
|
2491
|
+
get_round_ns(): bigint;
|
|
2492
|
+
set_round_ns(value: bigint): void;
|
|
2493
|
+
get round_ns(): bigint;
|
|
2494
|
+
set round_ns(value: bigint);
|
|
2495
|
+
private static __tnFootprintInternal;
|
|
2496
|
+
private static __tnValidateInternal;
|
|
2497
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
2498
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
2499
|
+
static footprintIr(): bigint;
|
|
2500
|
+
static footprint(): number;
|
|
2501
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
2502
|
+
params?: never;
|
|
2503
|
+
}): {
|
|
2504
|
+
ok: boolean;
|
|
2505
|
+
code?: string;
|
|
2506
|
+
consumed?: number;
|
|
2507
|
+
};
|
|
2508
|
+
static from_array(buffer: Uint8Array): FundingRoundEvent | null;
|
|
2509
|
+
}
|
|
2510
|
+
declare class FundingRoundEventBuilder {
|
|
2511
|
+
private buffer;
|
|
2512
|
+
private view;
|
|
2513
|
+
constructor();
|
|
2514
|
+
set_market(value: Uint8Array): this;
|
|
2515
|
+
set_rate(value: bigint): this;
|
|
2516
|
+
set_premium_sum(value: bigint): this;
|
|
2517
|
+
set_sample_cnt(value: number): this;
|
|
2518
|
+
set_reserved0(value: number): this;
|
|
2519
|
+
set_index_price(value: bigint): this;
|
|
2520
|
+
set_funding_index_lo(value: bigint): this;
|
|
2521
|
+
set_funding_index_hi(value: bigint): this;
|
|
2522
|
+
set_round_ns(value: bigint): this;
|
|
2523
|
+
build(): Uint8Array;
|
|
2524
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
2525
|
+
finish(): FundingRoundEvent;
|
|
2526
|
+
}
|
|
2276
2527
|
declare class LiquidationEvent {
|
|
2277
2528
|
private buffer;
|
|
2278
2529
|
private view;
|
|
@@ -2479,6 +2730,66 @@ declare class MarketAccount {
|
|
|
2479
2730
|
set_reserved2(value: number[]): void;
|
|
2480
2731
|
get reserved2(): number[];
|
|
2481
2732
|
set reserved2(value: number[]);
|
|
2733
|
+
get_funding_index_lo(): bigint;
|
|
2734
|
+
set_funding_index_lo(value: bigint): void;
|
|
2735
|
+
get funding_index_lo(): bigint;
|
|
2736
|
+
set funding_index_lo(value: bigint);
|
|
2737
|
+
get_funding_index_hi(): bigint;
|
|
2738
|
+
set_funding_index_hi(value: bigint): void;
|
|
2739
|
+
get funding_index_hi(): bigint;
|
|
2740
|
+
set funding_index_hi(value: bigint);
|
|
2741
|
+
get_funding_balance(): bigint;
|
|
2742
|
+
set_funding_balance(value: bigint): void;
|
|
2743
|
+
get funding_balance(): bigint;
|
|
2744
|
+
set funding_balance(value: bigint);
|
|
2745
|
+
get_funding_last_round_ns(): bigint;
|
|
2746
|
+
set_funding_last_round_ns(value: bigint): void;
|
|
2747
|
+
get funding_last_round_ns(): bigint;
|
|
2748
|
+
set funding_last_round_ns(value: bigint);
|
|
2749
|
+
get_funding_last_sample_ns(): bigint;
|
|
2750
|
+
set_funding_last_sample_ns(value: bigint): void;
|
|
2751
|
+
get funding_last_sample_ns(): bigint;
|
|
2752
|
+
set funding_last_sample_ns(value: bigint);
|
|
2753
|
+
get_funding_premium_sum(): bigint;
|
|
2754
|
+
set_funding_premium_sum(value: bigint): void;
|
|
2755
|
+
get funding_premium_sum(): bigint;
|
|
2756
|
+
set funding_premium_sum(value: bigint);
|
|
2757
|
+
get_funding_impact_notional(): bigint;
|
|
2758
|
+
set_funding_impact_notional(value: bigint): void;
|
|
2759
|
+
get funding_impact_notional(): bigint;
|
|
2760
|
+
set funding_impact_notional(value: bigint);
|
|
2761
|
+
get_funding_rate(): bigint;
|
|
2762
|
+
set_funding_rate(value: bigint): void;
|
|
2763
|
+
get funding_rate(): bigint;
|
|
2764
|
+
set funding_rate(value: bigint);
|
|
2765
|
+
get_funding_interest_rate(): number;
|
|
2766
|
+
set_funding_interest_rate(value: number): void;
|
|
2767
|
+
get funding_interest_rate(): number;
|
|
2768
|
+
set funding_interest_rate(value: number);
|
|
2769
|
+
get_funding_clamp_small(): number;
|
|
2770
|
+
set_funding_clamp_small(value: number): void;
|
|
2771
|
+
get funding_clamp_small(): number;
|
|
2772
|
+
set funding_clamp_small(value: number);
|
|
2773
|
+
get_funding_clamp_big(): number;
|
|
2774
|
+
set_funding_clamp_big(value: number): void;
|
|
2775
|
+
get funding_clamp_big(): number;
|
|
2776
|
+
set funding_clamp_big(value: number);
|
|
2777
|
+
get_funding_premium_multiplier(): number;
|
|
2778
|
+
set_funding_premium_multiplier(value: number): void;
|
|
2779
|
+
get funding_premium_multiplier(): number;
|
|
2780
|
+
set funding_premium_multiplier(value: number);
|
|
2781
|
+
get_funding_sample_cnt(): number;
|
|
2782
|
+
set_funding_sample_cnt(value: number): void;
|
|
2783
|
+
get funding_sample_cnt(): number;
|
|
2784
|
+
set funding_sample_cnt(value: number);
|
|
2785
|
+
get_reserved3(): number;
|
|
2786
|
+
set_reserved3(value: number): void;
|
|
2787
|
+
get reserved3(): number;
|
|
2788
|
+
set reserved3(value: number);
|
|
2789
|
+
get_reserved4(): number[];
|
|
2790
|
+
set_reserved4(value: number[]): void;
|
|
2791
|
+
get reserved4(): number[];
|
|
2792
|
+
set reserved4(value: number[]);
|
|
2482
2793
|
private static __tnFootprintInternal;
|
|
2483
2794
|
private static __tnValidateInternal;
|
|
2484
2795
|
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
@@ -2523,6 +2834,21 @@ declare class MarketAccountBuilder {
|
|
|
2523
2834
|
set_oracle_exponent(value: number): this;
|
|
2524
2835
|
set_max_mark_age_ns(value: bigint): this;
|
|
2525
2836
|
set_reserved2(values: number[]): this;
|
|
2837
|
+
set_funding_index_lo(value: bigint): this;
|
|
2838
|
+
set_funding_index_hi(value: bigint): this;
|
|
2839
|
+
set_funding_balance(value: bigint): this;
|
|
2840
|
+
set_funding_last_round_ns(value: bigint): this;
|
|
2841
|
+
set_funding_last_sample_ns(value: bigint): this;
|
|
2842
|
+
set_funding_premium_sum(value: bigint): this;
|
|
2843
|
+
set_funding_impact_notional(value: bigint): this;
|
|
2844
|
+
set_funding_rate(value: bigint): this;
|
|
2845
|
+
set_funding_interest_rate(value: number): this;
|
|
2846
|
+
set_funding_clamp_small(value: number): this;
|
|
2847
|
+
set_funding_clamp_big(value: number): this;
|
|
2848
|
+
set_funding_premium_multiplier(value: number): this;
|
|
2849
|
+
set_funding_sample_cnt(value: number): this;
|
|
2850
|
+
set_reserved3(value: number): this;
|
|
2851
|
+
set_reserved4(values: number[]): this;
|
|
2526
2852
|
build(): Uint8Array;
|
|
2527
2853
|
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
2528
2854
|
finish(): MarketAccount;
|
|
@@ -2632,6 +2958,66 @@ declare class MarketAccountPayload {
|
|
|
2632
2958
|
set_reserved2(value: number[]): void;
|
|
2633
2959
|
get reserved2(): number[];
|
|
2634
2960
|
set reserved2(value: number[]);
|
|
2961
|
+
get_funding_index_lo(): bigint;
|
|
2962
|
+
set_funding_index_lo(value: bigint): void;
|
|
2963
|
+
get funding_index_lo(): bigint;
|
|
2964
|
+
set funding_index_lo(value: bigint);
|
|
2965
|
+
get_funding_index_hi(): bigint;
|
|
2966
|
+
set_funding_index_hi(value: bigint): void;
|
|
2967
|
+
get funding_index_hi(): bigint;
|
|
2968
|
+
set funding_index_hi(value: bigint);
|
|
2969
|
+
get_funding_balance(): bigint;
|
|
2970
|
+
set_funding_balance(value: bigint): void;
|
|
2971
|
+
get funding_balance(): bigint;
|
|
2972
|
+
set funding_balance(value: bigint);
|
|
2973
|
+
get_funding_last_round_ns(): bigint;
|
|
2974
|
+
set_funding_last_round_ns(value: bigint): void;
|
|
2975
|
+
get funding_last_round_ns(): bigint;
|
|
2976
|
+
set funding_last_round_ns(value: bigint);
|
|
2977
|
+
get_funding_last_sample_ns(): bigint;
|
|
2978
|
+
set_funding_last_sample_ns(value: bigint): void;
|
|
2979
|
+
get funding_last_sample_ns(): bigint;
|
|
2980
|
+
set funding_last_sample_ns(value: bigint);
|
|
2981
|
+
get_funding_premium_sum(): bigint;
|
|
2982
|
+
set_funding_premium_sum(value: bigint): void;
|
|
2983
|
+
get funding_premium_sum(): bigint;
|
|
2984
|
+
set funding_premium_sum(value: bigint);
|
|
2985
|
+
get_funding_impact_notional(): bigint;
|
|
2986
|
+
set_funding_impact_notional(value: bigint): void;
|
|
2987
|
+
get funding_impact_notional(): bigint;
|
|
2988
|
+
set funding_impact_notional(value: bigint);
|
|
2989
|
+
get_funding_rate(): bigint;
|
|
2990
|
+
set_funding_rate(value: bigint): void;
|
|
2991
|
+
get funding_rate(): bigint;
|
|
2992
|
+
set funding_rate(value: bigint);
|
|
2993
|
+
get_funding_interest_rate(): number;
|
|
2994
|
+
set_funding_interest_rate(value: number): void;
|
|
2995
|
+
get funding_interest_rate(): number;
|
|
2996
|
+
set funding_interest_rate(value: number);
|
|
2997
|
+
get_funding_clamp_small(): number;
|
|
2998
|
+
set_funding_clamp_small(value: number): void;
|
|
2999
|
+
get funding_clamp_small(): number;
|
|
3000
|
+
set funding_clamp_small(value: number);
|
|
3001
|
+
get_funding_clamp_big(): number;
|
|
3002
|
+
set_funding_clamp_big(value: number): void;
|
|
3003
|
+
get funding_clamp_big(): number;
|
|
3004
|
+
set funding_clamp_big(value: number);
|
|
3005
|
+
get_funding_premium_multiplier(): number;
|
|
3006
|
+
set_funding_premium_multiplier(value: number): void;
|
|
3007
|
+
get funding_premium_multiplier(): number;
|
|
3008
|
+
set funding_premium_multiplier(value: number);
|
|
3009
|
+
get_funding_sample_cnt(): number;
|
|
3010
|
+
set_funding_sample_cnt(value: number): void;
|
|
3011
|
+
get funding_sample_cnt(): number;
|
|
3012
|
+
set funding_sample_cnt(value: number);
|
|
3013
|
+
get_reserved3(): number;
|
|
3014
|
+
set_reserved3(value: number): void;
|
|
3015
|
+
get reserved3(): number;
|
|
3016
|
+
set reserved3(value: number);
|
|
3017
|
+
get_reserved4(): number[];
|
|
3018
|
+
set_reserved4(value: number[]): void;
|
|
3019
|
+
get reserved4(): number[];
|
|
3020
|
+
set reserved4(value: number[]);
|
|
2635
3021
|
private static __tnFootprintInternal;
|
|
2636
3022
|
private static __tnValidateInternal;
|
|
2637
3023
|
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
@@ -2675,6 +3061,21 @@ declare class MarketAccountPayloadBuilder {
|
|
|
2675
3061
|
set_oracle_exponent(value: number): this;
|
|
2676
3062
|
set_max_mark_age_ns(value: bigint): this;
|
|
2677
3063
|
set_reserved2(values: number[]): this;
|
|
3064
|
+
set_funding_index_lo(value: bigint): this;
|
|
3065
|
+
set_funding_index_hi(value: bigint): this;
|
|
3066
|
+
set_funding_balance(value: bigint): this;
|
|
3067
|
+
set_funding_last_round_ns(value: bigint): this;
|
|
3068
|
+
set_funding_last_sample_ns(value: bigint): this;
|
|
3069
|
+
set_funding_premium_sum(value: bigint): this;
|
|
3070
|
+
set_funding_impact_notional(value: bigint): this;
|
|
3071
|
+
set_funding_rate(value: bigint): this;
|
|
3072
|
+
set_funding_interest_rate(value: number): this;
|
|
3073
|
+
set_funding_clamp_small(value: number): this;
|
|
3074
|
+
set_funding_clamp_big(value: number): this;
|
|
3075
|
+
set_funding_premium_multiplier(value: number): this;
|
|
3076
|
+
set_funding_sample_cnt(value: number): this;
|
|
3077
|
+
set_reserved3(value: number): this;
|
|
3078
|
+
set_reserved4(values: number[]): this;
|
|
2678
3079
|
build(): Uint8Array;
|
|
2679
3080
|
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
2680
3081
|
finish(): MarketAccountPayload;
|
|
@@ -3364,6 +3765,7 @@ declare class PerpEvent_payload_Inner {
|
|
|
3364
3765
|
asExchangeAdmin(): ExchangeAdminEvent | null;
|
|
3365
3766
|
asMarketExchangeStatus(): MarketExchangeStatusEvent | null;
|
|
3366
3767
|
asLiquidation(): LiquidationEvent | null;
|
|
3768
|
+
asFundingRound(): FundingRoundEvent | null;
|
|
3367
3769
|
}
|
|
3368
3770
|
declare class PerpEvent {
|
|
3369
3771
|
private buffer;
|
|
@@ -3468,6 +3870,12 @@ declare class PerpEvent {
|
|
|
3468
3870
|
readonly payloadSize: 160;
|
|
3469
3871
|
readonly payloadType: "PerpEvent::payload::liquidation";
|
|
3470
3872
|
readonly createPayloadBuilder: () => unknown;
|
|
3873
|
+
}, {
|
|
3874
|
+
readonly name: "funding_round";
|
|
3875
|
+
readonly tag: 16;
|
|
3876
|
+
readonly payloadSize: 88;
|
|
3877
|
+
readonly payloadType: "PerpEvent::payload::funding_round";
|
|
3878
|
+
readonly createPayloadBuilder: () => unknown;
|
|
3471
3879
|
}];
|
|
3472
3880
|
private static __tnExtractParams;
|
|
3473
3881
|
get_event_type(): bigint;
|
|
@@ -3569,6 +3977,9 @@ declare class PerpInstruction_payload_Inner {
|
|
|
3569
3977
|
asMarketSetExchangeStatus(): MarketSetExchangeStatusInstruction | null;
|
|
3570
3978
|
asLiquidate(): LiquidateInstruction | null;
|
|
3571
3979
|
asMarketSetOracle(): MarketSetOracleInstruction | null;
|
|
3980
|
+
asFundingUpdate(): FundingUpdateInstruction | null;
|
|
3981
|
+
asMarketSetFunding(): MarketSetFundingInstruction | null;
|
|
3982
|
+
asSettleFunding(): SettleFundingInstruction | null;
|
|
3572
3983
|
}
|
|
3573
3984
|
declare class PerpInstruction {
|
|
3574
3985
|
private buffer;
|
|
@@ -3673,6 +4084,24 @@ declare class PerpInstruction {
|
|
|
3673
4084
|
readonly payloadSize: 39;
|
|
3674
4085
|
readonly payloadType: "PerpInstruction::payload::market_set_oracle";
|
|
3675
4086
|
readonly createPayloadBuilder: () => unknown;
|
|
4087
|
+
}, {
|
|
4088
|
+
readonly name: "funding_update";
|
|
4089
|
+
readonly tag: 18;
|
|
4090
|
+
readonly payloadSize: 7;
|
|
4091
|
+
readonly payloadType: "PerpInstruction::payload::funding_update";
|
|
4092
|
+
readonly createPayloadBuilder: () => unknown;
|
|
4093
|
+
}, {
|
|
4094
|
+
readonly name: "market_set_funding";
|
|
4095
|
+
readonly tag: 19;
|
|
4096
|
+
readonly payloadSize: 31;
|
|
4097
|
+
readonly payloadType: "PerpInstruction::payload::market_set_funding";
|
|
4098
|
+
readonly createPayloadBuilder: () => unknown;
|
|
4099
|
+
}, {
|
|
4100
|
+
readonly name: "settle_funding";
|
|
4101
|
+
readonly tag: 20;
|
|
4102
|
+
readonly payloadSize: 7;
|
|
4103
|
+
readonly payloadType: "PerpInstruction::payload::settle_funding";
|
|
4104
|
+
readonly createPayloadBuilder: () => unknown;
|
|
3676
4105
|
}];
|
|
3677
4106
|
static __tnComputeSequentialLayout(view: DataView, buffer: Uint8Array): {
|
|
3678
4107
|
params: Record<string, bigint> | null;
|
|
@@ -3789,7 +4218,7 @@ declare class PerpProgramAccount {
|
|
|
3789
4218
|
static readonly payloadVariantDescriptors: readonly [{
|
|
3790
4219
|
readonly name: "market";
|
|
3791
4220
|
readonly tag: 121;
|
|
3792
|
-
readonly payloadSize:
|
|
4221
|
+
readonly payloadSize: 447;
|
|
3793
4222
|
readonly payloadType: "PerpProgramAccount::payload::market";
|
|
3794
4223
|
readonly createPayloadBuilder: () => unknown;
|
|
3795
4224
|
}, {
|
|
@@ -3939,6 +4368,9 @@ declare const PERP_INSTRUCTION_EXCHANGE_RECOVER_ADMIN = 14;
|
|
|
3939
4368
|
declare const PERP_INSTRUCTION_MARKET_SET_EXCHANGE_STATUS = 15;
|
|
3940
4369
|
declare const PERP_INSTRUCTION_LIQUIDATE = 16;
|
|
3941
4370
|
declare const PERP_INSTRUCTION_MARKET_SET_ORACLE = 17;
|
|
4371
|
+
declare const PERP_INSTRUCTION_FUNDING_UPDATE = 18;
|
|
4372
|
+
declare const PERP_INSTRUCTION_MARKET_SET_FUNDING = 19;
|
|
4373
|
+
declare const PERP_INSTRUCTION_SETTLE_FUNDING = 20;
|
|
3942
4374
|
/** Market record slot the demo tooling uses for its single market per transaction. */
|
|
3943
4375
|
declare const PERP_DEFAULT_MARKET_RECORD_INDEX = 1;
|
|
3944
4376
|
declare const PERP_ERR_PRICE_ABOVE_CAP = -205n;
|
|
@@ -3953,6 +4385,10 @@ declare const PERP_ERR_ORACLE_STALE = -213n;
|
|
|
3953
4385
|
declare const PERP_ERR_INVALID_MARGIN_PARAMS = -214n;
|
|
3954
4386
|
declare const PERP_ERR_NOT_LIQUIDATABLE = -215n;
|
|
3955
4387
|
declare const PERP_ERR_SELF_LIQUIDATION = -216n;
|
|
4388
|
+
declare const PERP_ERR_FUNDING_DISABLED = -217n;
|
|
4389
|
+
declare const PERP_ERR_INVALID_FUNDING_PARAMS = -218n;
|
|
4390
|
+
/** funding_update shared its transaction with an instruction that could move the book. */
|
|
4391
|
+
declare const PERP_ERR_FUNDING_UPDATE_NOT_ALONE = -219n;
|
|
3956
4392
|
declare const PERP_ERR_INSUFFICIENT_COLLATERAL = -403n;
|
|
3957
4393
|
declare const PERP_ERR_INSUFFICIENT_FUNDS_QUOTE = -401n;
|
|
3958
4394
|
declare const PERP_EVENT_SEAT_ASSIGNED = 1;
|
|
@@ -3970,6 +4406,7 @@ declare const PERP_EVENT_EXCHANGE_STATUS = 12;
|
|
|
3970
4406
|
declare const PERP_EVENT_EXCHANGE_ADMIN = 13;
|
|
3971
4407
|
declare const PERP_EVENT_MARKET_EXCHANGE_STATUS = 14;
|
|
3972
4408
|
declare const PERP_EVENT_LIQUIDATION = 15;
|
|
4409
|
+
declare const PERP_EVENT_FUNDING_ROUND = 16;
|
|
3973
4410
|
declare const PERP_BPS_DENOMINATOR = 10000n;
|
|
3974
4411
|
declare const PERP_EVENT_SIDE_BUY = 0;
|
|
3975
4412
|
declare const PERP_EVENT_SIDE_SELL = 1;
|
|
@@ -3993,7 +4430,15 @@ declare const PERP_MODIFY_FLAG_FAIL_IF_OUT_OF_RANGE: number;
|
|
|
3993
4430
|
declare const PERP_MODIFY_FLAG_HAS_CLIENT_ID: number;
|
|
3994
4431
|
declare const PERP_MODIFY_FLAG_HAS_ORDER_ID: number;
|
|
3995
4432
|
declare const PERP_MARKET_MAGIC = 121;
|
|
3996
|
-
declare const PERP_MARKET_ACCOUNT_SIZE =
|
|
4433
|
+
declare const PERP_MARKET_ACCOUNT_SIZE = 448;
|
|
4434
|
+
declare const PERP_FUNDING_RATE_TICK = 1000000n;
|
|
4435
|
+
declare const PERP_FUNDING_SAMPLE_NS = 60000000000n;
|
|
4436
|
+
declare const PERP_FUNDING_ROUND_NS = 3600000000000n;
|
|
4437
|
+
declare const PERP_FUNDING_PREMIUM_DIVISOR = 60n;
|
|
4438
|
+
declare const PERP_FUNDING_HOURS_PER_RATE = 8n;
|
|
4439
|
+
declare const PERP_FUNDING_PARAM_MAX = 1000000;
|
|
4440
|
+
declare const PERP_FUNDING_MULTIPLIER_ONE = 100;
|
|
4441
|
+
declare const PERP_FUNDING_PREMIUM_MAX = 1000000n;
|
|
3997
4442
|
/** The seat arena's header entry starts here; seat index 1 follows it. */
|
|
3998
4443
|
declare const PERP_SEAT_MANAGER_RESERVED_SIZE = 512;
|
|
3999
4444
|
declare const PERP_EXCHANGE_META_ACCOUNT_SIZE = 96;
|
|
@@ -4138,6 +4583,41 @@ interface PerpMarketSetOracleArgs extends PerpOracleParams {
|
|
|
4138
4583
|
/** The new feed account; also has to be the record's oracle feed account. */
|
|
4139
4584
|
oracleFeedAccountBytes: Uint8Array;
|
|
4140
4585
|
}
|
|
4586
|
+
interface PerpFundingUpdateArgs {
|
|
4587
|
+
marketRecordIndex: number;
|
|
4588
|
+
}
|
|
4589
|
+
interface PerpSettleFundingArgs {
|
|
4590
|
+
marketRecordIndex: number;
|
|
4591
|
+
/** The seat to settle (any seat: settle_funding is permissionless). */
|
|
4592
|
+
targetSeatIndex: number;
|
|
4593
|
+
}
|
|
4594
|
+
/** Rates in ticks of 1e-6 per 8 hours (Lighter's units: 100 = 0.01%). */
|
|
4595
|
+
interface PerpFundingParams {
|
|
4596
|
+
interestRate: number;
|
|
4597
|
+
clampSmall: number;
|
|
4598
|
+
clampBig: number;
|
|
4599
|
+
/** 0 disables funding; 1..100 scales the premium (100 = 1x). */
|
|
4600
|
+
premiumMultiplier: number;
|
|
4601
|
+
/** Quote atoms walked into each side of the book for the impact prices. */
|
|
4602
|
+
impactNotional: bigint;
|
|
4603
|
+
}
|
|
4604
|
+
interface PerpMarketSetFundingArgs extends PerpFundingParams {
|
|
4605
|
+
marketRecordIndex: number;
|
|
4606
|
+
}
|
|
4607
|
+
/** A market's funding state. */
|
|
4608
|
+
interface PerpFunding extends PerpFundingParams {
|
|
4609
|
+
/** Cumulative funding per lot, quote atoms * PERP_FUNDING_RATE_TICK (signed). */
|
|
4610
|
+
index: bigint;
|
|
4611
|
+
/** Net quote atoms the market collected from settlements. */
|
|
4612
|
+
balance: bigint;
|
|
4613
|
+
lastRoundNs: bigint;
|
|
4614
|
+
lastSampleNs: bigint;
|
|
4615
|
+
/** Premium samples of the current hour, ticks. */
|
|
4616
|
+
premiumSum: bigint;
|
|
4617
|
+
sampleCount: number;
|
|
4618
|
+
/** Hourly rate of the last round, ticks; positive: longs pay. */
|
|
4619
|
+
rate: bigint;
|
|
4620
|
+
}
|
|
4141
4621
|
interface PerpMarket {
|
|
4142
4622
|
magic: number;
|
|
4143
4623
|
statusFlags: number;
|
|
@@ -4163,6 +4643,8 @@ interface PerpMarket {
|
|
|
4163
4643
|
liquidationFeeBps: number;
|
|
4164
4644
|
oracleExponent: number;
|
|
4165
4645
|
maxMarkAgeNs: bigint;
|
|
4646
|
+
/** Optional so callers can build markets without funding (funding off). */
|
|
4647
|
+
funding?: PerpFunding;
|
|
4166
4648
|
}
|
|
4167
4649
|
interface PerpExchangeMeta {
|
|
4168
4650
|
magic: bigint;
|
|
@@ -4201,6 +4683,10 @@ interface PerpSeatEntry {
|
|
|
4201
4683
|
/** Sum of lots * lotSize * price over resting bids / asks. */
|
|
4202
4684
|
openBidNotional: bigint;
|
|
4203
4685
|
openAskNotional: bigint;
|
|
4686
|
+
/** The market's funding index at the seat's last settlement. */
|
|
4687
|
+
fundingSnapshot?: bigint;
|
|
4688
|
+
/** Sub-atom funding credit carried to the next settlement, [0, 1e6). */
|
|
4689
|
+
fundingCarry?: number;
|
|
4204
4690
|
}
|
|
4205
4691
|
interface PerpOrderEntry {
|
|
4206
4692
|
orderEntryIndex: number;
|
|
@@ -4379,6 +4865,17 @@ type ParsedPerpEvent = (ParsedPerpEventBase & {
|
|
|
4379
4865
|
liquidatorQuoteAfter: bigint;
|
|
4380
4866
|
/** Side of the target's position before the transfer. */
|
|
4381
4867
|
targetSide: 'long' | 'short';
|
|
4868
|
+
}) | (ParsedPerpEventBase & {
|
|
4869
|
+
variant: 'funding_round';
|
|
4870
|
+
market: string;
|
|
4871
|
+
/** Hourly rate, ticks of 1e-6; positive: longs pay. */
|
|
4872
|
+
rate: bigint;
|
|
4873
|
+
premiumSum: bigint;
|
|
4874
|
+
sampleCount: number;
|
|
4875
|
+
/** Oracle index the round priced at, quote atoms per base atom. */
|
|
4876
|
+
indexPrice: bigint;
|
|
4877
|
+
fundingIndex: bigint;
|
|
4878
|
+
roundNs: bigint;
|
|
4382
4879
|
}) | (ParsedPerpEventBase & {
|
|
4383
4880
|
variant: 'market_status' | 'exchange_initialized' | 'exchange_status' | 'exchange_admin' | 'market_exchange_status';
|
|
4384
4881
|
});
|
|
@@ -4474,6 +4971,36 @@ declare function perpLotInitialMargin(market: Pick<PerpMarket, 'lotSize' | 'init
|
|
|
4474
4971
|
max(free, 0) / ceil(lotSize * price * initialMarginBps / 10000). */
|
|
4475
4972
|
declare function perpMaxBuyLots(market: PerpMarginMarket, seat: PerpMarginSeat, price: bigint, mark: bigint): bigint;
|
|
4476
4973
|
declare function perpMaxSellLots(market: PerpMarginMarket, seat: PerpMarginSeat, price: bigint, mark: bigint): bigint;
|
|
4974
|
+
type PerpFundingSeat = PerpMarginSeat & Pick<PerpSeatEntry, 'fundingSnapshot' | 'fundingCarry'>;
|
|
4975
|
+
declare function perpFundingEnabled(market: Pick<PerpMarket, 'funding'>): boolean;
|
|
4976
|
+
/** The hourly rate (ticks) a round turns premiumSum into. */
|
|
4977
|
+
declare function perpFundingHourlyRate(premiumSum: bigint, params: Pick<PerpFundingParams, 'interestRate' | 'clampSmall' | 'clampBig' | 'premiumMultiplier'>): bigint;
|
|
4978
|
+
/** One premium sample (ticks); a zero impact price counts as the index.
|
|
4979
|
+
Mirrors thru-perps/tn_perp_program/utils/funding.h. */
|
|
4980
|
+
declare function perpFundingPremiumSample(index: bigint, impactBid: bigint, impactAsk: bigint): bigint;
|
|
4981
|
+
/** Why market_set_funding would reject params, or null. */
|
|
4982
|
+
declare function perpFundingParamsProblem(market: Pick<PerpMarket, 'initialMarginBps' | 'maintenanceMarginBps'>, params: PerpFundingParams): string | null;
|
|
4983
|
+
/** The largest clampBig the market's margins allow: one hour at the cap
|
|
4984
|
+
moves a seat by at most the initial - maintenance margin gap. */
|
|
4985
|
+
declare function perpFundingMaxClampBig(market: Pick<PerpMarket, 'initialMarginBps' | 'maintenanceMarginBps'>): number;
|
|
4986
|
+
/** Block time (ns) of the next hour boundary: the earliest the next round runs. */
|
|
4987
|
+
declare function perpNextFundingRoundNs(funding: Pick<PerpFunding, 'lastRoundNs'>): bigint;
|
|
4988
|
+
declare function perpFundingRoundDue(funding: Pick<PerpFunding, 'lastRoundNs'>, nowNs: bigint): boolean;
|
|
4989
|
+
declare function perpFundingSampleDue(funding: Pick<PerpFunding, 'lastSampleNs'>, nowNs: bigint): boolean;
|
|
4990
|
+
/** Unsettled funding credit plus carry, quote atoms * 1e6 (positive: receives). */
|
|
4991
|
+
declare function perpSeatFundingCredit(market: Pick<PerpMarket, 'funding'>, seat: PerpFundingSeat): bigint;
|
|
4992
|
+
interface PerpFundingSettlement<T> {
|
|
4993
|
+
/** The seat as the program sees it after settling. */
|
|
4994
|
+
seat: T;
|
|
4995
|
+
/** Atoms paid to the seat (negative: charged). */
|
|
4996
|
+
paid: bigint;
|
|
4997
|
+
/** Part of a charge that neither the collateral nor the position (a
|
|
4998
|
+
short's entry proceeds) could cover, written off as bad debt. */
|
|
4999
|
+
badDebt: bigint;
|
|
5000
|
+
}
|
|
5001
|
+
/** Settles the seat's funding exactly as the program does before it reads a
|
|
5002
|
+
seat's equity. Pure: returns a settled copy. */
|
|
5003
|
+
declare function perpSettleFunding<T extends PerpFundingSeat>(market: Pick<PerpMarket, 'funding'>, seat: T): PerpFundingSettlement<T & Required<Pick<PerpSeatEntry, 'fundingSnapshot' | 'fundingCarry'>>>;
|
|
4477
5004
|
/** Whether a post of `lots` at `price` on `side` passes the margin check:
|
|
4478
5005
|
free recomputed with the order's lots and notional added to the side's
|
|
4479
5006
|
open lots and notional (so the netting against the position applies to
|
|
@@ -4521,6 +5048,12 @@ declare function createPerpExchangeInitializeInstruction(args: PerpExchangeIniti
|
|
|
4521
5048
|
declare function createPerpExchangeSetStatusInstruction(args: PerpExchangeSetStatusArgs): InstructionData;
|
|
4522
5049
|
declare function createPerpExchangeSetAdminInstruction(args: PerpExchangeSetAdminArgs): InstructionData;
|
|
4523
5050
|
declare function createPerpMarketRecordInstruction(args: PerpMarketRecordArgs): InstructionData;
|
|
5051
|
+
/** State units a market_create transaction must request. The runtime charges
|
|
5052
|
+
ceil((64 + data_sz) / 4096) per new account, and market_create creates five:
|
|
5053
|
+
the seat arena (128640 bytes: 32), the order arena (64072 bytes: 16), the
|
|
5054
|
+
bids and asks cbooks (96 bytes: 1 each) and the quote vault token account
|
|
5055
|
+
(73 bytes: 1). Requesting fewer fails with SU_EXHAUSTED. */
|
|
5056
|
+
declare const PERP_MARKET_CREATE_STATE_UNITS = 51;
|
|
4524
5057
|
/** The named market authority must authorize the transaction. */
|
|
4525
5058
|
declare function createPerpMarketCreateInstruction(args: PerpMarketCreateArgs): InstructionData;
|
|
4526
5059
|
declare function createPerpSeatCreateInstruction(args: PerpSeatCreateArgs): InstructionData;
|
|
@@ -4543,6 +5076,18 @@ declare function createPerpLiquidateInstruction(args: PerpLiquidateArgs): Instru
|
|
|
4543
5076
|
exponent and max mark age. The record must carry the market authority
|
|
4544
5077
|
and the new feed account. */
|
|
4545
5078
|
declare function createPerpMarketSetOracleInstruction(args: PerpMarketSetOracleArgs): InstructionData;
|
|
5079
|
+
/** Permissionless funding crank: runs a due hourly round and a due premium
|
|
5080
|
+
sample of the record's market (the record needs the oracle feed, not a
|
|
5081
|
+
seat). A call with nothing due changes nothing. */
|
|
5082
|
+
declare function createPerpFundingUpdateInstruction(args: PerpFundingUpdateArgs): InstructionData;
|
|
5083
|
+
/** Permissionless: settles one seat's funding, so a seat that never trades
|
|
5084
|
+
still pays what it owes. Several may follow one market record, and they
|
|
5085
|
+
may share a transaction with funding_update (no book instruction may). */
|
|
5086
|
+
declare function createPerpSettleFundingInstruction(args: PerpSettleFundingArgs): InstructionData;
|
|
5087
|
+
/** Market authority only: sets the funding parameters (premiumMultiplier 0
|
|
5088
|
+
disables funding). Validated as the program does: see
|
|
5089
|
+
perpFundingParamsProblem. */
|
|
5090
|
+
declare function createPerpMarketSetFundingInstruction(args: PerpMarketSetFundingArgs): InstructionData;
|
|
4546
5091
|
/** The perp entrypoint accepts several instructions concatenated in one
|
|
4547
5092
|
payload; every trading instruction is preceded by a market_record. */
|
|
4548
5093
|
declare function concatPerpInstructions(...instructions: InstructionData[]): InstructionData;
|
|
@@ -4574,4 +5119,4 @@ declare function perpSeatOrders(seat: PerpSeatEntry, arena: {
|
|
|
4574
5119
|
declare function parsePerpEvent(data: Uint8Array): ParsedPerpEvent;
|
|
4575
5120
|
declare function assertPerpSeatIndex(value: number, label?: string): number;
|
|
4576
5121
|
|
|
4577
|
-
export { CbookAccount, CbookHeader, CbookHeaderBuilder, CbookLevel, CbookLevelBuilder, ClientId, CreateOrderEntryInstruction, CreateOrderEntryInstructionBuilder, ExchangeAdminEvent, ExchangeAdminEventBuilder, ExchangeInitializeInstruction, ExchangeInitializeInstructionBuilder, ExchangeInitializedEvent, ExchangeInitializedEventBuilder, ExchangeMetaAccount, ExchangeMetaAccountBuilder, ExchangeMetaAccountPayload, ExchangeMetaAccountPayloadBuilder, ExchangeRecoverAdminInstruction, ExchangeRecoverAdminInstructionBuilder, ExchangeSetAdminInstruction, ExchangeSetAdminInstructionBuilder, ExchangeSetStatusInstruction, ExchangeSetStatusInstructionBuilder, ExchangeStatusEvent, ExchangeStatusEventBuilder, LiquidateInstruction, LiquidateInstructionBuilder, LiquidationEvent, LiquidationEventBuilder, MarketAccount, MarketAccountBuilder, MarketAccountPayload, MarketAccountPayloadBuilder, MarketCreateInstruction, MarketCreateInstructionBuilder, MarketCreatedEvent, MarketCreatedEventBuilder, MarketExchangeStatusEvent, MarketExchangeStatusEventBuilder, MarketRecordInstruction, MarketRecordInstructionBuilder, MarketSetExchangeStatusInstruction, MarketSetExchangeStatusInstructionBuilder, MarketSetOracleInstruction, MarketSetOracleInstructionBuilder, MarketSetStatusInstruction, MarketSetStatusInstructionBuilder, MarketStatusEvent, MarketStatusEventBuilder, ModifyOrderEntryInstruction, ModifyOrderEntryInstructionBuilder, OrderArenaAccount, OrderArenaHeader, OrderArenaHeaderBuilder, OrderCancelledEvent, OrderCancelledEventBuilder, OrderEntry, OrderEntryBuilder, OrderEntryRemovedEvent, OrderEntryRemovedEventBuilder, OrderFilledEvent, OrderFilledEventBuilder, OrderModifiedEvent, OrderModifiedEventBuilder, OrderPostedEvent, OrderPostedEventBuilder, PERP_BPS_DENOMINATOR, PERP_CBOOK_EMPTY_PRICE_IN_TICKS, PERP_CBOOK_HEADER_SIZE, PERP_CBOOK_LEVEL_SIZE, PERP_CBOOK_MAX_PRICE_IN_TICKS, PERP_CBOOK_MAX_SIZE, PERP_CLIENT_ID_SIZE, PERP_DEFAULT_MARKET_RECORD_INDEX, PERP_ERR_ARITH_OVERFLOW, PERP_ERR_INSUFFICIENT_COLLATERAL, PERP_ERR_INSUFFICIENT_FUNDS_QUOTE, PERP_ERR_INVALID_MARGIN_PARAMS, PERP_ERR_INVALID_POSITION_LIMIT, PERP_ERR_INVALID_PRICE_CAP, PERP_ERR_NOT_LIQUIDATABLE, PERP_ERR_ORACLE_INVALID, PERP_ERR_ORACLE_MISMATCH, PERP_ERR_ORACLE_MISSING, PERP_ERR_ORACLE_STALE, PERP_ERR_POSITION_LIMIT, PERP_ERR_PRICE_ABOVE_CAP, PERP_ERR_SELF_LIQUIDATION, PERP_EVENT_EXCHANGE_ADMIN, PERP_EVENT_EXCHANGE_INITIALIZED, PERP_EVENT_EXCHANGE_STATUS, PERP_EVENT_LIQUIDATION, PERP_EVENT_MARKET_CREATED, PERP_EVENT_MARKET_EXCHANGE_STATUS, PERP_EVENT_MARKET_STATUS, PERP_EVENT_ORDER_CANCELLED, PERP_EVENT_ORDER_ENTRY_REMOVED, PERP_EVENT_ORDER_FILLED, PERP_EVENT_ORDER_MODIFIED, PERP_EVENT_ORDER_POSTED, PERP_EVENT_REMOVE_REASON_EVICTED, PERP_EVENT_REMOVE_REASON_EXPIRED, PERP_EVENT_REMOVE_REASON_FILLED, PERP_EVENT_REMOVE_REASON_USER, PERP_EVENT_SEAT_ASSIGNED, PERP_EVENT_SIDE_BUY, PERP_EVENT_SIDE_SELL, PERP_EVENT_TOKEN_DEPOSIT, PERP_EVENT_TOKEN_WITHDRAW, PERP_EXCHANGE_META_ACCOUNT_SIZE, PERP_EXCHANGE_META_MAGIC, PERP_EXCHANGE_META_SEED, PERP_EXCHANGE_META_VERSION, PERP_INSTRUCTION_CREATE_ORDER_ENTRY, PERP_INSTRUCTION_EXCHANGE_INITIALIZE, PERP_INSTRUCTION_EXCHANGE_RECOVER_ADMIN, PERP_INSTRUCTION_EXCHANGE_SET_ADMIN, PERP_INSTRUCTION_EXCHANGE_SET_STATUS, PERP_INSTRUCTION_LIQUIDATE, PERP_INSTRUCTION_MARKET_CREATE, PERP_INSTRUCTION_MARKET_RECORD, PERP_INSTRUCTION_MARKET_SET_EXCHANGE_STATUS, PERP_INSTRUCTION_MARKET_SET_ORACLE, PERP_INSTRUCTION_MARKET_SET_STATUS, PERP_INSTRUCTION_MODIFY_ORDER_ENTRY, PERP_INSTRUCTION_SEAT_CREATE, PERP_INSTRUCTION_TOKEN_DEPOSIT, PERP_INSTRUCTION_TOKEN_WITHDRAW, PERP_MARKET_ACCOUNT_SIZE, PERP_MARKET_MAGIC, PERP_MAX_ORDER_EXPIRATION_TIME, PERP_MODIFY_FLAG_FAIL_IF_OUT_OF_RANGE, PERP_MODIFY_FLAG_HAS_CLIENT_ID, PERP_MODIFY_FLAG_HAS_ORDER_ID, PERP_NULL_ACCOUNT_INDEX, PERP_NULL_INDEX, PERP_ORDER_ARENA_ENTRIES_OFFSET, PERP_ORDER_ARENA_HEADER_SIZE, PERP_ORDER_ENTRY_SIZE, PERP_ORDER_FLAG_BUY, PERP_ORDER_FLAG_HAS_CLIENT_ID, PERP_ORDER_TYPE_ALO, PERP_ORDER_TYPE_FOK, PERP_ORDER_TYPE_GTC, PERP_ORDER_TYPE_IOC, PERP_ORDER_TYPE_MTL, PERP_PROGRAM_ADDRESS, PERP_PROGRAM_ADDRESSES, PERP_PROGRAM_META_ADDRESS, PERP_PROGRAM_SEED, PERP_SEAT_ARENA_ENTRIES_OFFSET, PERP_SEAT_ARENA_HEADER_SIZE, PERP_SEAT_ENTRY_SIZE, PERP_SEAT_MANAGER_RESERVED_SIZE, PERP_STATUS_FLAG_DEPOSITS_FROZEN, PERP_STATUS_FLAG_MASK, PERP_STATUS_FLAG_PAUSED, PERP_STATUS_FLAG_POST_ONLY, PERP_STATUS_FLAG_WITHDRAWALS_FROZEN, type ParsedPerpEvent, type ParsedPerpEventBase, type PerpArenaHeader, type PerpArenaSlot, type PerpArenaSlots, type PerpCbook, type PerpCbookLevel, type PerpCreateOrderArgs, PerpError, PerpErrorBuilder, PerpEvent, PerpEventBuilder, PerpEvent_payload_Inner, type PerpExchangeInitializeArgs, type PerpExchangeMeta, type PerpExchangeSetAdminArgs, type PerpExchangeSetStatusArgs, PerpInstruction, PerpInstructionBuilder, PerpInstruction_payload_Inner, type PerpLiquidateArgs, type PerpMarginMarket, type PerpMarginParams, type PerpMarginSeat, type PerpMarkMarket, type PerpMarket, type PerpMarketAccounts, type PerpMarketCreateArgs, type PerpMarketRecordArgs, type PerpMarketSetOracleArgs, type PerpMarketSetStatusArgs, type PerpModifyOrderArgs, type PerpOracleParams, type PerpOrderBookLevel, type PerpOrderBookOrder, type PerpOrderBookSnapshot, type PerpOrderEntry, type PerpOrderRemovalReason, type PerpOrderSide, type PerpOrderType, PerpProgramAccount, PerpProgramAccountBuilder, PerpProgramAccount_payload_Inner, type PerpSeatCreateArgs, type PerpSeatEntry, type PerpTokenTransferArgs, SeatArenaAccount, SeatArenaHeader, SeatArenaHeaderBuilder, SeatAssignedEvent, SeatAssignedEventBuilder, SeatCreateInstruction, SeatCreateInstructionBuilder, SeatEntry, SeatEntryBuilder, TokenBalanceEvent, TokenBalanceEventBuilder, TokenTransferInstruction, TokenTransferInstructionBuilder, assertPerpSeatIndex, buildPerpOrderBookSnapshot, concatPerpInstructions, createPerpCancelOrderInstruction, createPerpExchangeInitializeInstruction, createPerpExchangeSetAdminInstruction, createPerpExchangeSetStatusInstruction, createPerpLiquidateInstruction, createPerpMarketCreateInstruction, createPerpMarketRecordInstruction, createPerpMarketSetOracleInstruction, createPerpMarketSetStatusInstruction, createPerpModifyOrderEntryInstruction, createPerpOrderEntryInstruction, createPerpSeatCreateInstruction, createPerpTokenDepositInstruction, createPerpTokenWithdrawInstruction, derivePerpExchangeMetaAddress, derivePerpMarketAccounts, parsePerpCbookAccount, parsePerpEvent, parsePerpExchangeMetaAccount, parsePerpMarketAccount, parsePerpOrderArenaAccount, parsePerpSeatArenaAccount, perpAverageEntryPrice, perpBankruptcyPrice, perpCanPostOrder, perpCeilBps, perpEquity, perpFreeCollateral, perpInitialMargin, perpIsLiquidatable, perpLeverageBps, perpLiquidationPreview, perpLiquidationPrice, perpLotInitialMargin, perpMaintenanceMargin, perpMarkFraction, perpMarkFromFeed, perpMarkPrice, perpMarketAccountAddresses, perpMarketReadOnlyAddresses, perpMaxBuyLots, perpMaxLeverage, perpMaxSellLots, perpNotional, perpOrderInitialMargin, perpPositionInitialMargin, perpSeatOrders, perpSideMarginNotional, perpUnrealizedPnl };
|
|
5122
|
+
export { CbookAccount, CbookHeader, CbookHeaderBuilder, CbookLevel, CbookLevelBuilder, ClientId, CreateOrderEntryInstruction, CreateOrderEntryInstructionBuilder, ExchangeAdminEvent, ExchangeAdminEventBuilder, ExchangeInitializeInstruction, ExchangeInitializeInstructionBuilder, ExchangeInitializedEvent, ExchangeInitializedEventBuilder, ExchangeMetaAccount, ExchangeMetaAccountBuilder, ExchangeMetaAccountPayload, ExchangeMetaAccountPayloadBuilder, ExchangeRecoverAdminInstruction, ExchangeRecoverAdminInstructionBuilder, ExchangeSetAdminInstruction, ExchangeSetAdminInstructionBuilder, ExchangeSetStatusInstruction, ExchangeSetStatusInstructionBuilder, ExchangeStatusEvent, ExchangeStatusEventBuilder, FundingRoundEvent, FundingRoundEventBuilder, FundingUpdateInstruction, FundingUpdateInstructionBuilder, LiquidateInstruction, LiquidateInstructionBuilder, LiquidationEvent, LiquidationEventBuilder, MarketAccount, MarketAccountBuilder, MarketAccountPayload, MarketAccountPayloadBuilder, MarketCreateInstruction, MarketCreateInstructionBuilder, MarketCreatedEvent, MarketCreatedEventBuilder, MarketExchangeStatusEvent, MarketExchangeStatusEventBuilder, MarketRecordInstruction, MarketRecordInstructionBuilder, MarketSetExchangeStatusInstruction, MarketSetExchangeStatusInstructionBuilder, MarketSetFundingInstruction, MarketSetFundingInstructionBuilder, MarketSetOracleInstruction, MarketSetOracleInstructionBuilder, MarketSetStatusInstruction, MarketSetStatusInstructionBuilder, MarketStatusEvent, MarketStatusEventBuilder, ModifyOrderEntryInstruction, ModifyOrderEntryInstructionBuilder, OrderArenaAccount, OrderArenaHeader, OrderArenaHeaderBuilder, OrderCancelledEvent, OrderCancelledEventBuilder, OrderEntry, OrderEntryBuilder, OrderEntryRemovedEvent, OrderEntryRemovedEventBuilder, OrderFilledEvent, OrderFilledEventBuilder, OrderModifiedEvent, OrderModifiedEventBuilder, OrderPostedEvent, OrderPostedEventBuilder, PERP_BPS_DENOMINATOR, PERP_CBOOK_EMPTY_PRICE_IN_TICKS, PERP_CBOOK_HEADER_SIZE, PERP_CBOOK_LEVEL_SIZE, PERP_CBOOK_MAX_PRICE_IN_TICKS, PERP_CBOOK_MAX_SIZE, PERP_CLIENT_ID_SIZE, PERP_DEFAULT_MARKET_RECORD_INDEX, PERP_ERR_ARITH_OVERFLOW, PERP_ERR_FUNDING_DISABLED, PERP_ERR_FUNDING_UPDATE_NOT_ALONE, PERP_ERR_INSUFFICIENT_COLLATERAL, PERP_ERR_INSUFFICIENT_FUNDS_QUOTE, PERP_ERR_INVALID_FUNDING_PARAMS, PERP_ERR_INVALID_MARGIN_PARAMS, PERP_ERR_INVALID_POSITION_LIMIT, PERP_ERR_INVALID_PRICE_CAP, PERP_ERR_NOT_LIQUIDATABLE, PERP_ERR_ORACLE_INVALID, PERP_ERR_ORACLE_MISMATCH, PERP_ERR_ORACLE_MISSING, PERP_ERR_ORACLE_STALE, PERP_ERR_POSITION_LIMIT, PERP_ERR_PRICE_ABOVE_CAP, PERP_ERR_SELF_LIQUIDATION, PERP_EVENT_EXCHANGE_ADMIN, PERP_EVENT_EXCHANGE_INITIALIZED, PERP_EVENT_EXCHANGE_STATUS, PERP_EVENT_FUNDING_ROUND, PERP_EVENT_LIQUIDATION, PERP_EVENT_MARKET_CREATED, PERP_EVENT_MARKET_EXCHANGE_STATUS, PERP_EVENT_MARKET_STATUS, PERP_EVENT_ORDER_CANCELLED, PERP_EVENT_ORDER_ENTRY_REMOVED, PERP_EVENT_ORDER_FILLED, PERP_EVENT_ORDER_MODIFIED, PERP_EVENT_ORDER_POSTED, PERP_EVENT_REMOVE_REASON_EVICTED, PERP_EVENT_REMOVE_REASON_EXPIRED, PERP_EVENT_REMOVE_REASON_FILLED, PERP_EVENT_REMOVE_REASON_USER, PERP_EVENT_SEAT_ASSIGNED, PERP_EVENT_SIDE_BUY, PERP_EVENT_SIDE_SELL, PERP_EVENT_TOKEN_DEPOSIT, PERP_EVENT_TOKEN_WITHDRAW, PERP_EXCHANGE_META_ACCOUNT_SIZE, PERP_EXCHANGE_META_MAGIC, PERP_EXCHANGE_META_SEED, PERP_EXCHANGE_META_VERSION, PERP_FUNDING_HOURS_PER_RATE, PERP_FUNDING_MULTIPLIER_ONE, PERP_FUNDING_PARAM_MAX, PERP_FUNDING_PREMIUM_DIVISOR, PERP_FUNDING_PREMIUM_MAX, PERP_FUNDING_RATE_TICK, PERP_FUNDING_ROUND_NS, PERP_FUNDING_SAMPLE_NS, PERP_INSTRUCTION_CREATE_ORDER_ENTRY, PERP_INSTRUCTION_EXCHANGE_INITIALIZE, PERP_INSTRUCTION_EXCHANGE_RECOVER_ADMIN, PERP_INSTRUCTION_EXCHANGE_SET_ADMIN, PERP_INSTRUCTION_EXCHANGE_SET_STATUS, PERP_INSTRUCTION_FUNDING_UPDATE, PERP_INSTRUCTION_LIQUIDATE, PERP_INSTRUCTION_MARKET_CREATE, PERP_INSTRUCTION_MARKET_RECORD, PERP_INSTRUCTION_MARKET_SET_EXCHANGE_STATUS, PERP_INSTRUCTION_MARKET_SET_FUNDING, PERP_INSTRUCTION_MARKET_SET_ORACLE, PERP_INSTRUCTION_MARKET_SET_STATUS, PERP_INSTRUCTION_MODIFY_ORDER_ENTRY, PERP_INSTRUCTION_SEAT_CREATE, PERP_INSTRUCTION_SETTLE_FUNDING, PERP_INSTRUCTION_TOKEN_DEPOSIT, PERP_INSTRUCTION_TOKEN_WITHDRAW, PERP_MARKET_ACCOUNT_SIZE, PERP_MARKET_CREATE_STATE_UNITS, PERP_MARKET_MAGIC, PERP_MAX_ORDER_EXPIRATION_TIME, PERP_MODIFY_FLAG_FAIL_IF_OUT_OF_RANGE, PERP_MODIFY_FLAG_HAS_CLIENT_ID, PERP_MODIFY_FLAG_HAS_ORDER_ID, PERP_NULL_ACCOUNT_INDEX, PERP_NULL_INDEX, PERP_ORDER_ARENA_ENTRIES_OFFSET, PERP_ORDER_ARENA_HEADER_SIZE, PERP_ORDER_ENTRY_SIZE, PERP_ORDER_FLAG_BUY, PERP_ORDER_FLAG_HAS_CLIENT_ID, PERP_ORDER_TYPE_ALO, PERP_ORDER_TYPE_FOK, PERP_ORDER_TYPE_GTC, PERP_ORDER_TYPE_IOC, PERP_ORDER_TYPE_MTL, PERP_PROGRAM_ADDRESS, PERP_PROGRAM_ADDRESSES, PERP_PROGRAM_META_ADDRESS, PERP_PROGRAM_SEED, PERP_SEAT_ARENA_ENTRIES_OFFSET, PERP_SEAT_ARENA_HEADER_SIZE, PERP_SEAT_ENTRY_SIZE, PERP_SEAT_MANAGER_RESERVED_SIZE, PERP_STATUS_FLAG_DEPOSITS_FROZEN, PERP_STATUS_FLAG_MASK, PERP_STATUS_FLAG_PAUSED, PERP_STATUS_FLAG_POST_ONLY, PERP_STATUS_FLAG_WITHDRAWALS_FROZEN, type ParsedPerpEvent, type ParsedPerpEventBase, type PerpArenaHeader, type PerpArenaSlot, type PerpArenaSlots, type PerpCbook, type PerpCbookLevel, type PerpCreateOrderArgs, PerpError, PerpErrorBuilder, PerpEvent, PerpEventBuilder, PerpEvent_payload_Inner, type PerpExchangeInitializeArgs, type PerpExchangeMeta, type PerpExchangeSetAdminArgs, type PerpExchangeSetStatusArgs, type PerpFunding, type PerpFundingParams, type PerpFundingSeat, type PerpFundingSettlement, type PerpFundingUpdateArgs, PerpInstruction, PerpInstructionBuilder, PerpInstruction_payload_Inner, type PerpLiquidateArgs, type PerpMarginMarket, type PerpMarginParams, type PerpMarginSeat, type PerpMarkMarket, type PerpMarket, type PerpMarketAccounts, type PerpMarketCreateArgs, type PerpMarketRecordArgs, type PerpMarketSetFundingArgs, type PerpMarketSetOracleArgs, type PerpMarketSetStatusArgs, type PerpModifyOrderArgs, type PerpOracleParams, type PerpOrderBookLevel, type PerpOrderBookOrder, type PerpOrderBookSnapshot, type PerpOrderEntry, type PerpOrderRemovalReason, type PerpOrderSide, type PerpOrderType, PerpProgramAccount, PerpProgramAccountBuilder, PerpProgramAccount_payload_Inner, type PerpSeatCreateArgs, type PerpSeatEntry, type PerpSettleFundingArgs, type PerpTokenTransferArgs, SeatArenaAccount, SeatArenaHeader, SeatArenaHeaderBuilder, SeatAssignedEvent, SeatAssignedEventBuilder, SeatCreateInstruction, SeatCreateInstructionBuilder, SeatEntry, SeatEntryBuilder, SettleFundingInstruction, SettleFundingInstructionBuilder, TokenBalanceEvent, TokenBalanceEventBuilder, TokenTransferInstruction, TokenTransferInstructionBuilder, assertPerpSeatIndex, buildPerpOrderBookSnapshot, concatPerpInstructions, createPerpCancelOrderInstruction, createPerpExchangeInitializeInstruction, createPerpExchangeSetAdminInstruction, createPerpExchangeSetStatusInstruction, createPerpFundingUpdateInstruction, createPerpLiquidateInstruction, createPerpMarketCreateInstruction, createPerpMarketRecordInstruction, createPerpMarketSetFundingInstruction, createPerpMarketSetOracleInstruction, createPerpMarketSetStatusInstruction, createPerpModifyOrderEntryInstruction, createPerpOrderEntryInstruction, createPerpSeatCreateInstruction, createPerpSettleFundingInstruction, createPerpTokenDepositInstruction, createPerpTokenWithdrawInstruction, derivePerpExchangeMetaAddress, derivePerpMarketAccounts, parsePerpCbookAccount, parsePerpEvent, parsePerpExchangeMetaAccount, parsePerpMarketAccount, parsePerpOrderArenaAccount, parsePerpSeatArenaAccount, perpAverageEntryPrice, perpBankruptcyPrice, perpCanPostOrder, perpCeilBps, perpEquity, perpFreeCollateral, perpFundingEnabled, perpFundingHourlyRate, perpFundingMaxClampBig, perpFundingParamsProblem, perpFundingPremiumSample, perpFundingRoundDue, perpFundingSampleDue, perpInitialMargin, perpIsLiquidatable, perpLeverageBps, perpLiquidationPreview, perpLiquidationPrice, perpLotInitialMargin, perpMaintenanceMargin, perpMarkFraction, perpMarkFromFeed, perpMarkPrice, perpMarketAccountAddresses, perpMarketReadOnlyAddresses, perpMaxBuyLots, perpMaxLeverage, perpMaxSellLots, perpNextFundingRoundNs, perpNotional, perpOrderInitialMargin, perpPositionInitialMargin, perpSeatFundingCredit, perpSeatOrders, perpSettleFunding, perpSideMarginNotional, perpUnrealizedPnl };
|