@exponent-labs/exponent-types 0.1.8 → 0.9.0

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/src/generic.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { BN, web3 } from "@coral-xyz/anchor"
2
-
1
+ import { PublicKey } from "@solana/web3.js"
3
2
  import { AnchorizedPNum, SyEmissionJson, SyEmissionRaw } from "./common"
4
3
  import { StakePoolAccount } from "@solana/spl-stake-pool"
5
-
4
+ import BN from 'bn.js'
6
5
  export type InterfaceTypeGeneric =
7
6
  | {
8
7
  pyth: {
@@ -67,6 +66,11 @@ export type InterfaceTypeGeneric =
67
66
  | {
68
67
  ore: Record<string, never>
69
68
  }
69
+ | {
70
+ chainlink: {
71
+ padding: number[]
72
+ }
73
+ }
70
74
  export type InterfaceTypeGenericJson =
71
75
  | {
72
76
  pyth: {
@@ -124,45 +128,50 @@ export type InterfaceTypeGenericJson =
124
128
  }
125
129
  }
126
130
  | {
127
- reflect: {
128
- padding: number[]
131
+ reflect: {
132
+ padding: number[]
133
+ }
134
+ }
135
+ | {
136
+ ore: Record<string, never>
129
137
  }
130
- }
131
138
  | {
132
- ore: Record<string, never>
133
- }
139
+ chainlink: {
140
+ padding: number[]
141
+ }
142
+ }
134
143
  /** Additional data that different interface types may need */
135
144
  export interface AdditionalDataGeneric {
136
145
  fragmetricData?: {
137
- receiptTokenMint: web3.PublicKey
138
- wrappedTokenMint: web3.PublicKey
146
+ receiptTokenMint: PublicKey
147
+ wrappedTokenMint: PublicKey
139
148
  }
140
149
  jupiterLendData?: {
141
- baseTokenMint: web3.PublicKey
142
- tokenReservesLiquidity: web3.PublicKey
143
- lendingSupplyPosition: web3.PublicKey
144
- rewardsRateModel: web3.PublicKey
145
- rateModel: web3.PublicKey
150
+ baseTokenMint: PublicKey
151
+ tokenReservesLiquidity: PublicKey
152
+ lendingSupplyPosition: PublicKey
153
+ rewardsRateModel: PublicKey
154
+ rateModel: PublicKey
146
155
  }
147
156
  kaminoVaultData?: {
148
- vault: web3.PublicKey
157
+ vault: PublicKey
149
158
  reserves: {
150
- reserveAddress: web3.PublicKey
151
- marketAddress: web3.PublicKey
159
+ reserveAddress: PublicKey
160
+ marketAddress: PublicKey
152
161
  }[]
153
- tokenVault: web3.PublicKey
154
- tokenMint: web3.PublicKey
155
- baseVaultAuthority: web3.PublicKey
156
- sharesMint: web3.PublicKey
162
+ tokenVault: PublicKey
163
+ tokenMint: PublicKey
164
+ baseVaultAuthority: PublicKey
165
+ sharesMint: PublicKey
157
166
  }
158
167
  splStakePoolData?: {
159
168
  stakePoolAccount?: StakePoolAccount // Optional because it is expensive to serialize / not always needed on clients
160
- stakePoolAddress: web3.PublicKey
161
- stakePoolProgramId: web3.PublicKey // Dynamic program ID from account owner
162
- validatorList: web3.PublicKey
163
- reserveStake: web3.PublicKey
164
- managerFeeAccount: web3.PublicKey
165
- poolMint: web3.PublicKey
169
+ stakePoolAddress: PublicKey
170
+ stakePoolProgramId: PublicKey // Dynamic program ID from account owner
171
+ validatorList: PublicKey
172
+ reserveStake: PublicKey
173
+ managerFeeAccount: PublicKey
174
+ poolMint: PublicKey
166
175
  }
167
176
  // Add other interface-specific data here as needed
168
177
  // meteoraData?: { ... }
@@ -211,7 +220,7 @@ export interface AdditionalDataGenericJson {
211
220
  export interface Hook {
212
221
  enabled: boolean
213
222
  interfaceEmissionsAccountsUntil: number
214
- programId: web3.PublicKey
223
+ programId: PublicKey
215
224
  preMintHookDiscriminator: number[]
216
225
  postRedeemHookDiscriminator: number[]
217
226
  }
@@ -229,13 +238,13 @@ export interface HookRaw {
229
238
  interfaceEmissionsAccountsUntil: number
230
239
  preMintHookDiscriminator: Buffer
231
240
  postRedeemHookDiscriminator: Buffer
232
- programId: web3.PublicKey
241
+ programId: PublicKey
233
242
  }
234
243
 
235
244
  export interface GenericSyState {
236
- selfAddress: web3.PublicKey
245
+ selfAddress: PublicKey
237
246
  account: GenericSyMetaAccount
238
- tokenProgramBase: web3.PublicKey
247
+ tokenProgramBase: PublicKey
239
248
  syRate: number
240
249
  additionalData?: AdditionalDataGeneric
241
250
  }
@@ -268,10 +277,10 @@ export interface GenericSyMetaAccountJson {
268
277
  }
269
278
 
270
279
  export interface GenericSyMetaAccount {
271
- mintSy: web3.PublicKey
272
- yieldBearingMint: web3.PublicKey
273
- tokenSyEscrow: web3.PublicKey
274
- interfaceAccounts: web3.PublicKey[]
280
+ mintSy: PublicKey
281
+ yieldBearingMint: PublicKey
282
+ tokenSyEscrow: PublicKey
283
+ interfaceAccounts: PublicKey[]
275
284
  interfaceType: InterfaceTypeGeneric
276
285
  maxSySupply: BN
277
286
  minMintSize: BN
@@ -282,15 +291,15 @@ export interface GenericSyMetaAccount {
282
291
  }
283
292
 
284
293
  export interface GenericSyMetaAccountRaw {
285
- mintSy: web3.PublicKey
286
- yieldBearingMint: web3.PublicKey
287
- tokenSyEscrow: web3.PublicKey
294
+ mintSy: PublicKey
295
+ yieldBearingMint: PublicKey
296
+ tokenSyEscrow: PublicKey
288
297
  maxSySupply: BN
289
298
  minMintSize: BN
290
299
  minRedeemSize: BN
291
300
  selfAddressBump: number[]
292
301
  emissions: SyEmissionRaw[]
293
- interfaceAccounts: web3.PublicKey[]
302
+ interfaceAccounts: PublicKey[]
294
303
  interfaceType: InterfaceTypeGeneric
295
304
  index: AnchorizedPNum
296
305
  hook: HookRaw
@@ -423,7 +432,7 @@ export function fromHookJson(json: HookJson): Hook {
423
432
  return {
424
433
  enabled: json.enabled,
425
434
  interfaceEmissionsAccountsUntil: json.interfaceEmissionsAccountsUntil,
426
- programId: new web3.PublicKey(json.programId),
435
+ programId: new PublicKey(json.programId),
427
436
  preMintHookDiscriminator: json.preMintHookDiscriminator,
428
437
  postRedeemHookDiscriminator: json.postRedeemHookDiscriminator,
429
438
  }
@@ -484,43 +493,43 @@ export function fromAdditionalDataGenericJson(json: AdditionalDataGenericJson):
484
493
 
485
494
  if (json.fragmetricData) {
486
495
  result.fragmetricData = {
487
- receiptTokenMint: new web3.PublicKey(json.fragmetricData.receiptTokenMint),
488
- wrappedTokenMint: new web3.PublicKey(json.fragmetricData.wrappedTokenMint),
496
+ receiptTokenMint: new PublicKey(json.fragmetricData.receiptTokenMint),
497
+ wrappedTokenMint: new PublicKey(json.fragmetricData.wrappedTokenMint),
489
498
  }
490
499
  }
491
500
 
492
501
  if (json.jupiterLendData) {
493
502
  result.jupiterLendData = {
494
- baseTokenMint: new web3.PublicKey(json.jupiterLendData.baseTokenMint),
495
- tokenReservesLiquidity: new web3.PublicKey(json.jupiterLendData.tokenReservesLiquidity),
496
- lendingSupplyPosition: new web3.PublicKey(json.jupiterLendData.lendingSupplyPosition),
497
- rewardsRateModel: new web3.PublicKey(json.jupiterLendData.rewardsRateModel),
498
- rateModel: new web3.PublicKey(json.jupiterLendData.rateModel),
503
+ baseTokenMint: new PublicKey(json.jupiterLendData.baseTokenMint),
504
+ tokenReservesLiquidity: new PublicKey(json.jupiterLendData.tokenReservesLiquidity),
505
+ lendingSupplyPosition: new PublicKey(json.jupiterLendData.lendingSupplyPosition),
506
+ rewardsRateModel: new PublicKey(json.jupiterLendData.rewardsRateModel),
507
+ rateModel: new PublicKey(json.jupiterLendData.rateModel),
499
508
  }
500
509
  }
501
510
 
502
511
  if (json.kaminoVaultData) {
503
512
  result.kaminoVaultData = {
504
- vault: new web3.PublicKey(json.kaminoVaultData.vault),
513
+ vault: new PublicKey(json.kaminoVaultData.vault),
505
514
  reserves: json.kaminoVaultData.reserves.map((r) => ({
506
- reserveAddress: new web3.PublicKey(r.reserveAddress),
507
- marketAddress: new web3.PublicKey(r.marketAddress),
515
+ reserveAddress: new PublicKey(r.reserveAddress),
516
+ marketAddress: new PublicKey(r.marketAddress),
508
517
  })),
509
- tokenVault: new web3.PublicKey(json.kaminoVaultData.tokenVault),
510
- tokenMint: new web3.PublicKey(json.kaminoVaultData.tokenMint),
511
- baseVaultAuthority: new web3.PublicKey(json.kaminoVaultData.baseVaultAuthority),
512
- sharesMint: new web3.PublicKey(json.kaminoVaultData.sharesMint),
518
+ tokenVault: new PublicKey(json.kaminoVaultData.tokenVault),
519
+ tokenMint: new PublicKey(json.kaminoVaultData.tokenMint),
520
+ baseVaultAuthority: new PublicKey(json.kaminoVaultData.baseVaultAuthority),
521
+ sharesMint: new PublicKey(json.kaminoVaultData.sharesMint),
513
522
  }
514
523
  }
515
524
 
516
525
  if (json.splStakePoolData) {
517
526
  result.splStakePoolData = {
518
- stakePoolAddress: new web3.PublicKey(json.splStakePoolData.stakePoolAddress),
519
- stakePoolProgramId: new web3.PublicKey(json.splStakePoolData.stakePoolProgramId),
520
- validatorList: new web3.PublicKey(json.splStakePoolData.validatorList),
521
- reserveStake: new web3.PublicKey(json.splStakePoolData.reserveStake),
522
- managerFeeAccount: new web3.PublicKey(json.splStakePoolData.managerFeeAccount),
523
- poolMint: new web3.PublicKey(json.splStakePoolData.poolMint),
527
+ stakePoolAddress: new PublicKey(json.splStakePoolData.stakePoolAddress),
528
+ stakePoolProgramId: new PublicKey(json.splStakePoolData.stakePoolProgramId),
529
+ validatorList: new PublicKey(json.splStakePoolData.validatorList),
530
+ reserveStake: new PublicKey(json.splStakePoolData.reserveStake),
531
+ managerFeeAccount: new PublicKey(json.splStakePoolData.managerFeeAccount),
532
+ poolMint: new PublicKey(json.splStakePoolData.poolMint),
524
533
  }
525
534
  }
526
535
 
@@ -530,11 +539,11 @@ export function fromAdditionalDataGenericJson(json: AdditionalDataGenericJson):
530
539
  /** Helper function to extract fragmetric data from additional data */
531
540
  export function getFragmetricDataFromAdditionalData(additionalData?: AdditionalDataGeneric):
532
541
  | {
533
- receiptTokenMint: web3.PublicKey
534
- wrappedTokenMint: web3.PublicKey
542
+ receiptTokenMint: PublicKey
543
+ wrappedTokenMint: PublicKey
535
544
  }
536
545
  | undefined {
537
546
  if (!additionalData) return undefined
538
547
 
539
548
  return additionalData.fragmetricData
540
- }
549
+ }
package/src/index.ts CHANGED
@@ -9,4 +9,4 @@ export * from "./orderbook"
9
9
  export * from "./cpi"
10
10
  export * from "./trade"
11
11
  export * from "./liquidity"
12
- export * from "./generic"
12
+ export * from "./generic"
@@ -1,38 +1,38 @@
1
- import { BN, web3 } from "@coral-xyz/anchor"
2
1
  import { AnchorizedPNum, AnchorizedPNumJson, SyEmissionRaw, SyEmissionJson } from "./common"
3
-
2
+ import { PublicKey } from "@solana/web3.js"
3
+ import BN from 'bn.js'
4
4
  export interface InterfaceType {
5
5
  splStakePool: {}
6
6
  }
7
7
 
8
8
  export interface JitoRestakingSyState {
9
- selfAddress: web3.PublicKey
9
+ selfAddress: PublicKey
10
10
  account: JitoRestakingSyMetaAccount
11
11
  /** The value of SY tokens in terms of the base asset */
12
12
  syRate: string
13
13
  underlyingExchangeRate: number
14
- mintBase: web3.PublicKey
15
- tokenProgramBase: web3.PublicKey
14
+ mintBase: PublicKey
15
+ tokenProgramBase: PublicKey
16
16
  }
17
17
 
18
18
  export interface JitoRestakingSyMetaAccountRaw {
19
- jitoVault: web3.PublicKey
20
- mintSy: web3.PublicKey
21
- tokenSyEscrow: web3.PublicKey
19
+ jitoVault: PublicKey
20
+ mintSy: PublicKey
21
+ tokenSyEscrow: PublicKey
22
22
  maxSySupply: BN
23
23
  minMintSize: BN
24
24
  minRedeemSize: BN
25
25
  selfAddressBump: number[]
26
26
  emissions: SyEmissionRaw[]
27
- interfaceAccounts: web3.PublicKey[]
27
+ interfaceAccounts: PublicKey[]
28
28
  interfaceType: InterfaceType
29
29
  }
30
30
 
31
31
  export interface JitoRestakingSyMetaAccount {
32
- jitoVault: web3.PublicKey
33
- mintSy: web3.PublicKey
34
- tokenSyEscrow: web3.PublicKey
35
- interfaceAccounts: web3.PublicKey[]
32
+ jitoVault: PublicKey
33
+ mintSy: PublicKey
34
+ tokenSyEscrow: PublicKey
35
+ interfaceAccounts: PublicKey[]
36
36
  interfaceType: InterfaceType
37
37
  maxSySupply: BN
38
38
  minMintSize: BN
@@ -75,4 +75,4 @@ export interface JitoRestakingSyStateJson {
75
75
  underlyingExchangeRate: number
76
76
  mintBase: string
77
77
  tokenProgramBase: string
78
- }
78
+ }
package/src/kamino.ts CHANGED
@@ -1,19 +1,19 @@
1
- import { BN } from "@coral-xyz/anchor"
2
- import { web3 } from "@coral-xyz/anchor"
1
+ import BN from "bn.js"
3
2
 
4
3
  import { SyEmissionJson, SyEmissionRaw, SyEmissionRaw2 } from "./common"
4
+ import { PublicKey } from "@solana/web3.js"
5
5
 
6
6
  export interface KaminoSyState {
7
- selfAddress: web3.PublicKey
7
+ selfAddress: PublicKey
8
8
  account: KaminoSyMetaAccount
9
- klendSyProgramId: web3.PublicKey
9
+ klendSyProgramId: PublicKey
10
10
  /** The value of SY tokens in terms of the base asset */
11
11
  syRate: string
12
- mintBase: web3.PublicKey
13
- tokenProgramBase: web3.PublicKey
14
- klendProgramId: web3.PublicKey
15
- klendMarketId: web3.PublicKey
16
- scopePriceFeed?: web3.PublicKey
12
+ mintBase: PublicKey
13
+ tokenProgramBase: PublicKey
14
+ klendProgramId: PublicKey
15
+ klendMarketId: PublicKey
16
+ scopePriceFeed?: PublicKey
17
17
  }
18
18
 
19
19
  export interface KaminoSyStateJson {
@@ -29,14 +29,14 @@ export interface KaminoSyStateJson {
29
29
  }
30
30
 
31
31
  export interface KaminoSyMetaAccount {
32
- kaminoReserve: web3.PublicKey
33
- kaminoObligation: web3.PublicKey
34
- kaminoFarm: web3.PublicKey
35
- kaminoUserMetadata: web3.PublicKey
36
- mintSy: web3.PublicKey
32
+ kaminoReserve: PublicKey
33
+ kaminoObligation: PublicKey
34
+ kaminoFarm: PublicKey
35
+ kaminoUserMetadata: PublicKey
36
+ mintSy: PublicKey
37
37
  /** Where deposited SY tokens reside */
38
- tokenSyEscrow: web3.PublicKey
39
- userState: web3.PublicKey
38
+ tokenSyEscrow: PublicKey
39
+ userState: PublicKey
40
40
  maxSySupply: string
41
41
  minMintSize: string
42
42
  minRedeemSize: string
@@ -58,22 +58,22 @@ interface KaminoSyMetaAccountJson {
58
58
  }
59
59
 
60
60
  export interface KaminoSyMetaAccountRaw {
61
- kamino_reserve: web3.PublicKey
62
- kamino_obligation: web3.PublicKey
63
- kamino_farm: web3.PublicKey
64
- kamino_user_metadata: web3.PublicKey
65
- mint_sy: web3.PublicKey
61
+ kamino_reserve: PublicKey
62
+ kamino_obligation: PublicKey
63
+ kamino_farm: PublicKey
64
+ kamino_user_metadata: PublicKey
65
+ mint_sy: PublicKey
66
66
  /** Where deposited SY tokens reside */
67
- token_sy_escrow: web3.PublicKey
67
+ token_sy_escrow: PublicKey
68
68
  /** Robot authority over the Mfi Account */
69
- authority_klend_account: web3.PublicKey
69
+ authority_klend_account: PublicKey
70
70
  /** Authority over the SY token escrow account */
71
- authority_escrow: web3.PublicKey
71
+ authority_escrow: PublicKey
72
72
  /** Authority over the sy mint */
73
- mint_authority: web3.PublicKey
74
- user_state: web3.PublicKey
73
+ mint_authority: PublicKey
74
+ user_state: PublicKey
75
75
  max_sy_supply: BN
76
76
  min_mint_size: BN
77
77
  min_redeem_size: BN
78
78
  emissions: SyEmissionRaw2[]
79
- }
79
+ }
package/src/marginfi.ts CHANGED
@@ -1,19 +1,19 @@
1
- import { BN, web3 } from "@coral-xyz/anchor"
1
+ import { PublicKey } from "@solana/web3.js"
2
2
  import { SyEmissionRaw, SyEmissionJson } from "./common"
3
-
3
+ import BN from 'bn.js'
4
4
  export interface MfiSyState {
5
- selfAddress: web3.PublicKey
5
+ selfAddress: PublicKey
6
6
  account: MarginfiSyMeta
7
- marginfiSyProgramId: web3.PublicKey
7
+ marginfiSyProgramId: PublicKey
8
8
 
9
9
  /** The value of SY tokens in terms of the base asset taken directly from the bank */
10
10
  syRate: string
11
- mintBase: web3.PublicKey
12
- tokenProgramBase: web3.PublicKey
13
- marginfiProgramId: web3.PublicKey
14
- marginfiGroupId: web3.PublicKey
15
- emissionsMint: web3.PublicKey | null
16
- emissionsTokenProgram: web3.PublicKey | null
11
+ mintBase: PublicKey
12
+ tokenProgramBase: PublicKey
13
+ marginfiProgramId: PublicKey
14
+ marginfiGroupId: PublicKey
15
+ emissionsMint: PublicKey | null
16
+ emissionsTokenProgram: PublicKey | null
17
17
  }
18
18
 
19
19
  export interface MfiSyStateJson {
@@ -43,11 +43,11 @@ export interface SyMetaJson {
43
43
  }
44
44
 
45
45
  export interface MarginfiSyMeta {
46
- marginfiBank: web3.PublicKey
47
- marginfiAccount: web3.PublicKey
48
- mintSy: web3.PublicKey
46
+ marginfiBank: PublicKey
47
+ marginfiAccount: PublicKey
48
+ mintSy: PublicKey
49
49
  /** Where the SY tokens get deposited */
50
- tokenSyEscrow: web3.PublicKey
50
+ tokenSyEscrow: PublicKey
51
51
  maxSySupply: bigint
52
52
  minMintSize: bigint
53
53
  minRedeemSize: bigint
@@ -66,16 +66,16 @@ export interface MarginfiSyMetaJson {
66
66
  }
67
67
 
68
68
  export interface MarginfiSyMetaRaw {
69
- marginfiBank: web3.PublicKey
70
- marginfiAccount: web3.PublicKey
71
- mintSy: web3.PublicKey
69
+ marginfiBank: PublicKey
70
+ marginfiAccount: PublicKey
71
+ mintSy: PublicKey
72
72
  maxSySupply: BN
73
73
  minMintSize: BN
74
74
  minRedeemSize: BN
75
75
  /** Where the SY tokens get deposited */
76
- tokenSyEscrow: web3.PublicKey
76
+ tokenSyEscrow: PublicKey
77
77
  emissions: SyEmissionRaw[]
78
78
  }
79
79
 
80
80
  export type AnchorizedPNum = { 0: BN[] }
81
- export type AnchorizedPNumJson = { 0: string[] }
81
+ export type AnchorizedPNumJson = { 0: string[] }
package/src/orderbook.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { web3 } from "@coral-xyz/anchor"
2
1
 
2
+ import { PublicKey } from "@solana/web3.js"
3
3
  import { CpiAccountsRaw, ExponentCoreCpiAccountsRaw } from "./cpi"
4
4
  import { Flavor } from "./flavor"
5
5
 
6
- export const MAX_PRICE_NODES = 100
7
- export const MAX_OFFERS = 500
8
- export const MAX_USER_ESCROWS = 250
6
+ export const MAX_PRICE_NODES = 1000
7
+ export const MAX_OFFERS = 2500
8
+ export const MAX_USER_ESCROWS = 1500
9
9
  // RedBlackTree uses 3 registers per node: parent, left, right
10
10
  export const PRICE_NODE_REGISTERS = 3
11
11
  // Offer allocator uses 1 register per node (free‐list pointer)
@@ -65,6 +65,9 @@ export interface PriceTreeNode {
65
65
  }
66
66
 
67
67
  export interface OfferNode {
68
+ /** Actual NodeAllocator slot for this offer (0 is sentinel, live offers are 1-based) */
69
+ offerIndex: number
70
+
68
71
  /** Internal register 1 (the free‐list link when unused) */
69
72
  nextOfferPointer: number
70
73
 
@@ -72,7 +75,7 @@ export interface OfferNode {
72
75
  pricePointer: number
73
76
 
74
77
  /** SY/PT/YT amount deposited */
75
- amount: BigInt
78
+ amount: bigint
76
79
  /** Index of the user escrow that owns this offer */
77
80
  userVaultPointer: number
78
81
  /** Expiry timestamp (unix seconds) */
@@ -89,8 +92,8 @@ export interface OfferNode {
89
92
 
90
93
  export interface UserEscrowNode {
91
94
  /** The user’s Pubkey */
92
- user: web3.PublicKey
93
- /** Yield‐index for this user (protocol’s Number type) */
95
+ user: PublicKey
96
+ /** Last seen SY exchange rate for this user escrow */
94
97
  yieldIndex: number
95
98
  /** Token amounts held */
96
99
  ptAmount: bigint
@@ -104,27 +107,27 @@ export interface UserEscrowNode {
104
107
  /** ─── Full On-chain Orderbook ───────────────────────────────────────────────── */
105
108
  export interface Orderbook {
106
109
  /** PDA link to vault */
107
- vault: web3.PublicKey
110
+ vault: PublicKey
108
111
  /** PDA link to a vault-owned YT position */
109
- yieldPosition: web3.PublicKey
112
+ yieldPosition: PublicKey
110
113
  /** Address Lookup Table key for the orderbook */
111
- addressLookupTable: web3.PublicKey
114
+ addressLookupTable: PublicKey
112
115
  /** Address of the Exponent Core program */
113
- exponentCoreProgram: web3.PublicKey
116
+ exponentCoreProgram: PublicKey
114
117
  /** Address of the Sy program */
115
- syProgram: web3.PublicKey
118
+ syProgram: PublicKey
116
119
  /** Orderbook-owned escrow for SY tokens */
117
- tokenEscrowSy: web3.PublicKey
120
+ tokenEscrowSy: PublicKey
118
121
  /** Orderbook-owned escrow for YT tokens */
119
- tokenEscrowYt: web3.PublicKey
122
+ tokenEscrowYt: PublicKey
120
123
  /** Orderbook-owned escrow for PT tokens */
121
- tokenEscrowPt: web3.PublicKey
124
+ tokenEscrowPt: PublicKey
122
125
 
123
126
  /// Admin key
124
- admin: web3.PublicKey
127
+ admin: PublicKey
125
128
 
126
129
  /** CPI accounts storage key */
127
- cpiAccountOrderbook: web3.PublicKey
130
+ cpiAccountOrderbook: PublicKey
128
131
 
129
132
  /** How many price nodes are currently in use */
130
133
  nodeCount: number
@@ -146,25 +149,25 @@ export interface Orderbook {
146
149
 
147
150
  export interface OrderbookState {
148
151
  /** PDA link to vault */
149
- vault: web3.PublicKey
152
+ vault: PublicKey
150
153
  /** PDA link to a vault-owned YT position */
151
- yieldPosition: web3.PublicKey
154
+ yieldPosition: PublicKey
152
155
  /** Address Lookup Table key for the orderbook */
153
- addressLookupTable: web3.PublicKey
156
+ addressLookupTable: PublicKey
154
157
  /** Address of the Exponent Core program */
155
- exponentCoreProgram: web3.PublicKey
158
+ exponentCoreProgram: PublicKey
156
159
  /** Address of the Exponent Core program */
157
- syProgram: web3.PublicKey
160
+ syProgram: PublicKey
158
161
  /** Orderbook-owned escrow for SY tokens */
159
- tokenEscrowSy: web3.PublicKey
162
+ tokenEscrowSy: PublicKey
160
163
  /** Orderbook-owned escrow for YT tokens */
161
- tokenEscrowYt: web3.PublicKey
164
+ tokenEscrowYt: PublicKey
162
165
  /** Orderbook-owned escrow for PT tokens */
163
- tokenEscrowPt: web3.PublicKey
166
+ tokenEscrowPt: PublicKey
164
167
  /** CPI accounts storage key */
165
- cpiAccountOrderbook: web3.PublicKey
168
+ cpiAccountOrderbook: PublicKey
166
169
  /** Admin key */
167
- admin: web3.PublicKey
170
+ admin: PublicKey
168
171
 
169
172
  configurationOptions: ConfigurationOptions
170
173
 
@@ -184,4 +187,9 @@ export interface OrderbookState {
184
187
  exponentCoreCpiAccounts: ExponentCoreCpiAccountsRaw
185
188
 
186
189
  flavor: Flavor
190
+
191
+ /** Next offer index that will be allocated (from NodeAllocator free list) */
192
+ offersFreeListHead: number
193
+ /** Bump index boundary for offers allocator */
194
+ offersBumpIndex: number
187
195
  }
package/src/perena.ts CHANGED
@@ -1,32 +1,32 @@
1
- import { BN, web3 } from "@coral-xyz/anchor"
1
+ import { PublicKey } from "@solana/web3.js"
2
2
  import { AnchorizedPNum, AnchorizedPNumJson, SyEmissionRaw, SyEmissionJson } from "./common"
3
-
3
+ import BN from 'bn.js'
4
4
  export interface PerenaSyState {
5
- selfAddress: web3.PublicKey
5
+ selfAddress: PublicKey
6
6
  account: PerenaSyMetaAccount
7
7
  /** The value of SY tokens in terms of the base asset */
8
8
  syRate: string
9
- tokenProgramBase: web3.PublicKey
10
- lpMint: web3.PublicKey
9
+ tokenProgramBase: PublicKey
10
+ lpMint: PublicKey
11
11
  }
12
12
 
13
13
  export interface PerenaSyMetaAccountRaw {
14
- perenaStablePool: web3.PublicKey
15
- mintSy: web3.PublicKey
16
- tokenSyEscrow: web3.PublicKey
14
+ perenaStablePool: PublicKey
15
+ mintSy: PublicKey
16
+ tokenSyEscrow: PublicKey
17
17
  maxSySupply: BN
18
18
  minMintSize: BN
19
19
  minRedeemSize: BN
20
20
  selfAddressBump: number[]
21
21
  emissions: SyEmissionRaw[]
22
- interfaceAccounts: web3.PublicKey[]
22
+ interfaceAccounts: PublicKey[]
23
23
  }
24
24
 
25
25
  export interface PerenaSyMetaAccount {
26
- perenaStablePool: web3.PublicKey
27
- mintSy: web3.PublicKey
28
- tokenSyEscrow: web3.PublicKey
29
- interfaceAccounts: web3.PublicKey[]
26
+ perenaStablePool: PublicKey
27
+ mintSy: PublicKey
28
+ tokenSyEscrow: PublicKey
29
+ interfaceAccounts: PublicKey[]
30
30
  maxSySupply: BN
31
31
  minMintSize: BN
32
32
  minRedeemSize: BN
@@ -64,4 +64,4 @@ export interface PerenaSyStateJson {
64
64
  underlyingExchangeRate: number
65
65
  mintBase: string
66
66
  tokenProgramBase: string
67
- }
67
+ }