@wireio/stake 0.3.1 → 0.4.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/lib/stake.browser.js +3601 -1920
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +3269 -1361
- package/lib/stake.js +4374 -2733
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +3601 -1920
- package/lib/stake.m.js.map +1 -1
- package/package.json +3 -1
- package/src/assets/solana/idl/liqsol_core.json +2327 -887
- package/src/assets/solana/idl/liqsol_token.json +1 -1
- package/src/assets/solana/idl/transfer_hook.json +192 -0
- package/src/assets/solana/idl/validator_leaderboard.json +147 -4
- package/src/assets/solana/types/liqsol_core.ts +2327 -887
- package/src/assets/solana/types/liqsol_token.ts +1 -1
- package/src/assets/solana/types/transfer_hook.ts +198 -0
- package/src/assets/solana/types/validator_leaderboard.ts +147 -4
- package/src/networks/ethereum/ethereum.ts +0 -5
- package/src/networks/ethereum/utils.ts +1 -1
- package/src/networks/solana/clients/deposit.client.ts +154 -8
- package/src/networks/solana/clients/distribution.client.ts +72 -291
- package/src/networks/solana/clients/leaderboard.client.ts +59 -14
- package/src/networks/solana/clients/outpost.client.ts +188 -359
- package/src/networks/solana/clients/token.client.ts +85 -100
- package/src/networks/solana/constants.ts +155 -64
- package/src/networks/solana/solana.ts +273 -154
- package/src/networks/solana/types.ts +532 -71
- package/src/networks/solana/utils.ts +68 -51
- package/src/types.ts +108 -17
|
@@ -38,14 +38,12 @@ import {
|
|
|
38
38
|
DEFAULT_PAY_RATE_LOOKBACK,
|
|
39
39
|
deriveOutpostGlobalStatePda,
|
|
40
40
|
deriveOutpostPoolAuthorityPda,
|
|
41
|
-
|
|
41
|
+
deriveOutpostAccountPda,
|
|
42
42
|
deriveTrancheStatePda,
|
|
43
|
-
|
|
44
|
-
derivePoolUserRecordPda,
|
|
45
|
-
deriveUserUserRecordPda,
|
|
46
|
-
deriveUserWarrantRecordPda,
|
|
43
|
+
deriveUserPretokenRecordPda,
|
|
47
44
|
CHAINLINK_FEED,
|
|
48
45
|
CHAINLINK_PROGRAM,
|
|
46
|
+
deriveExtraAccountMetaListPda,
|
|
49
47
|
} from './constants';
|
|
50
48
|
|
|
51
49
|
import liqsolCoreIDL from '../../assets/solana/idl/liqsol_core.json';
|
|
@@ -54,12 +52,10 @@ import { GlobalState, TrancheState } from './types';
|
|
|
54
52
|
import { TrancheLadderItem, TrancheSnapshot } from '../../types';
|
|
55
53
|
import { ChainID } from '@wireio/core';
|
|
56
54
|
|
|
57
|
-
|
|
58
55
|
// -----------------------------------------------------------------------------
|
|
59
56
|
// Tranche Support
|
|
60
57
|
// -----------------------------------------------------------------------------
|
|
61
58
|
|
|
62
|
-
|
|
63
59
|
const INDEX_SCALE = BigInt(1_000_000_000_000); // 1e12
|
|
64
60
|
const USD_SCALE = BigInt(100_000_000); // 1e8
|
|
65
61
|
const BPS = BigInt(10_000);
|
|
@@ -116,7 +112,6 @@ export function buildSolanaTrancheLadder(options: {
|
|
|
116
112
|
currentTranche: number;
|
|
117
113
|
initialTrancheSupply: bigint;
|
|
118
114
|
currentTrancheSupply: bigint;
|
|
119
|
-
totalWarrantsSold: bigint; // informational only
|
|
120
115
|
currentPriceUsd: bigint;
|
|
121
116
|
supplyGrowthBps: number;
|
|
122
117
|
priceGrowthBps: number;
|
|
@@ -209,35 +204,25 @@ export function buildSolanaTrancheSnapshot(options: {
|
|
|
209
204
|
|
|
210
205
|
const currentIndex = toBigint(globalState.currentIndex);
|
|
211
206
|
const totalShares = toBigint(globalState.totalShares);
|
|
212
|
-
|
|
213
207
|
const currentTranche = trancheState.currentTrancheNumber.toNumber();
|
|
214
208
|
const currentTrancheSupply = toBigint(trancheState.currentTrancheSupply);
|
|
215
209
|
const initialTrancheSupply = toBigint(trancheState.initialTrancheSupply);
|
|
216
|
-
const
|
|
210
|
+
const totalPretokensSold = toBigint(trancheState.totalPretokensSold);
|
|
217
211
|
const currentPriceUsd = toBigint(trancheState.currentTranchePriceUsd);
|
|
218
|
-
|
|
219
212
|
const supplyGrowthBps = trancheState.supplyGrowthBps;
|
|
220
213
|
const priceGrowthBps = trancheState.priceGrowthBps;
|
|
221
214
|
|
|
222
|
-
const minPriceUsd = trancheState.minPriceUsd
|
|
223
|
-
? toBigint(trancheState.minPriceUsd)
|
|
224
|
-
: undefined;
|
|
225
|
-
const maxPriceUsd = trancheState.maxPriceUsd
|
|
226
|
-
? toBigint(trancheState.maxPriceUsd)
|
|
227
|
-
: undefined;
|
|
228
|
-
|
|
229
215
|
const ladder = buildSolanaTrancheLadder({
|
|
230
216
|
currentTranche,
|
|
231
217
|
initialTrancheSupply,
|
|
232
218
|
currentTrancheSupply,
|
|
233
|
-
totalWarrantsSold,
|
|
234
219
|
currentPriceUsd,
|
|
235
220
|
supplyGrowthBps,
|
|
236
221
|
priceGrowthBps,
|
|
237
222
|
windowBefore: ladderWindowBefore,
|
|
238
223
|
windowAfter: ladderWindowAfter,
|
|
239
224
|
});
|
|
240
|
-
|
|
225
|
+
|
|
241
226
|
return {
|
|
242
227
|
chainID,
|
|
243
228
|
currentIndex,
|
|
@@ -246,9 +231,9 @@ export function buildSolanaTrancheSnapshot(options: {
|
|
|
246
231
|
currentPriceUsd,
|
|
247
232
|
supplyGrowthBps,
|
|
248
233
|
priceGrowthBps,
|
|
234
|
+
totalPretokensSold,
|
|
249
235
|
currentTrancheSupply,
|
|
250
236
|
initialTrancheSupply,
|
|
251
|
-
totalWarrantsSold,
|
|
252
237
|
nativePriceUsd: solPriceUsd,
|
|
253
238
|
nativePriceTimestamp,
|
|
254
239
|
ladder,
|
|
@@ -271,7 +256,11 @@ export function getLiqsolCoreProgram(
|
|
|
271
256
|
|
|
272
257
|
// Dummy wallet – we're only doing read-only account fetches here.
|
|
273
258
|
const tmpKeypair = Keypair.generate();
|
|
274
|
-
const wallet: any = {
|
|
259
|
+
const wallet: any = {
|
|
260
|
+
publicKey: tmpKeypair.publicKey,
|
|
261
|
+
signAllTransactions: async () => [],
|
|
262
|
+
signTransaction: async () => tmpKeypair,
|
|
263
|
+
};
|
|
275
264
|
|
|
276
265
|
const provider = new AnchorProvider(connection, wallet, {
|
|
277
266
|
commitment: 'confirmed',
|
|
@@ -368,16 +357,27 @@ export async function getPayoutStateRaw(
|
|
|
368
357
|
|
|
369
358
|
/**
|
|
370
359
|
* Raw account info for a user's distribution user_record.
|
|
360
|
+
*
|
|
361
|
+
* NOTE: user_record is keyed by the TOKEN ACCOUNT (ATA), not the wallet.
|
|
362
|
+
* Here we derive the user's liqSOL ATA and then its user_record PDA.
|
|
371
363
|
*/
|
|
372
364
|
export async function getUserRecordRaw(
|
|
373
365
|
connection: Connection,
|
|
374
366
|
user: PublicKey,
|
|
375
367
|
): Promise<Uint8Array | null> {
|
|
376
|
-
const
|
|
368
|
+
const liqsolMint = deriveLiqsolMintPda();
|
|
369
|
+
const userAta = await getAssociatedTokenAddress(
|
|
370
|
+
liqsolMint,
|
|
371
|
+
user,
|
|
372
|
+
false,
|
|
373
|
+
TOKEN_2022_PROGRAM_ID,
|
|
374
|
+
);
|
|
375
|
+
const pda = deriveUserRecordPda(userAta);
|
|
377
376
|
const info = await connection.getAccountInfo(pda);
|
|
378
377
|
return info?.data ?? null;
|
|
379
378
|
}
|
|
380
379
|
|
|
380
|
+
|
|
381
381
|
// -----------------------------------------------------------------------------
|
|
382
382
|
// Pay-rate & fee utilities (on-chain compatible)
|
|
383
383
|
// -----------------------------------------------------------------------------
|
|
@@ -390,12 +390,12 @@ export async function getAveragePayRate(
|
|
|
390
390
|
const payRateHistoryPda = derivePayRateHistoryPda();
|
|
391
391
|
|
|
392
392
|
try {
|
|
393
|
-
const anyProgram = program
|
|
393
|
+
const anyProgram = program;
|
|
394
394
|
const payRateHistoryAccount = await anyProgram.account.payRateHistory.fetch(
|
|
395
395
|
payRateHistoryPda,
|
|
396
396
|
);
|
|
397
397
|
|
|
398
|
-
const entries
|
|
398
|
+
const entries = payRateHistoryAccount.entries ?? [];
|
|
399
399
|
const totalEntriesAdded = Number(
|
|
400
400
|
payRateHistoryAccount.totalEntriesAdded ?? 0,
|
|
401
401
|
);
|
|
@@ -448,6 +448,7 @@ export async function getAveragePayRate(
|
|
|
448
448
|
return DEFAULT_AVERAGE_PAY_RATE;
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
+
|
|
451
452
|
/**
|
|
452
453
|
* On-chain fee formula:
|
|
453
454
|
* fee = (average_pay_rate * 4 * deposit_amount_lamports) / 10^12
|
|
@@ -502,30 +503,39 @@ export function previewDepositEffects(params: {
|
|
|
502
503
|
* ---------------------------------------------------------------------------
|
|
503
504
|
* Outpost-specific helpers
|
|
504
505
|
* ---------------------------------------------------------------------------
|
|
506
|
+
*
|
|
507
|
+
* This is the SDK equivalent of `deriveWirePdas` in capital-staking tests.
|
|
508
|
+
* It aggregates all PDAs / ATAs needed for Outpost pretokens + synd/desynd.
|
|
505
509
|
*/
|
|
506
510
|
export interface OutpostAccounts {
|
|
507
511
|
user: PublicKey;
|
|
508
512
|
|
|
509
|
-
//
|
|
513
|
+
// Outpost / pretoken wiring
|
|
510
514
|
globalState: PublicKey;
|
|
511
515
|
poolAuthority: PublicKey;
|
|
512
516
|
liqsolMint: PublicKey;
|
|
513
517
|
liqsolPoolAta: PublicKey;
|
|
514
518
|
userAta: PublicKey;
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
519
|
+
outpostAccount: PublicKey;
|
|
520
|
+
userPretokenRecord: PublicKey;
|
|
521
|
+
|
|
522
|
+
// Distribution / yield context (user_record keyed by token accounts)
|
|
518
523
|
distributionState: PublicKey;
|
|
519
|
-
payRateHistory: PublicKey;
|
|
520
524
|
bucketAuthority: PublicKey;
|
|
521
525
|
bucketTokenAccount: PublicKey;
|
|
522
|
-
|
|
526
|
+
bucketUserRecord: PublicKey;
|
|
527
|
+
liqsolPoolUserRecord: PublicKey;
|
|
528
|
+
userUserRecord: PublicKey;
|
|
529
|
+
|
|
530
|
+
// Tranche / pricing
|
|
523
531
|
trancheState: PublicKey;
|
|
524
|
-
userWarrantRecord: PublicKey;
|
|
525
532
|
|
|
526
533
|
// Chainlink
|
|
527
534
|
chainLinkFeed: PublicKey;
|
|
528
535
|
chainLinkProgram: PublicKey;
|
|
536
|
+
|
|
537
|
+
// Transfer hook extra accounts
|
|
538
|
+
extraAccountMetaList: PublicKey;
|
|
529
539
|
}
|
|
530
540
|
|
|
531
541
|
export async function buildOutpostAccounts(
|
|
@@ -536,15 +546,14 @@ export async function buildOutpostAccounts(
|
|
|
536
546
|
const poolAuthority = deriveOutpostPoolAuthorityPda();
|
|
537
547
|
const liqsolMint = deriveLiqsolMintPda();
|
|
538
548
|
const distributionState = deriveDistributionStatePda();
|
|
539
|
-
const payRateHistory = derivePayRateHistoryPda();
|
|
540
549
|
const bucketAuthority = deriveBucketAuthorityPda();
|
|
541
|
-
const solBucket = deriveSolBucketPda();
|
|
542
550
|
const trancheState = deriveTrancheStatePda();
|
|
543
|
-
const wireReceipt = deriveWireReceiptPda(user);
|
|
544
|
-
const poolUserRecord = derivePoolUserRecordPda(poolAuthority);
|
|
545
|
-
const userUserRecord = deriveUserUserRecordPda(user);
|
|
546
|
-
const userWarrantRecord = deriveUserWarrantRecordPda(user);
|
|
547
551
|
|
|
552
|
+
// Outpost / pretoken PDAs
|
|
553
|
+
const outpostAccount = deriveOutpostAccountPda(user);
|
|
554
|
+
const userPretokenRecord = deriveUserPretokenRecordPda(user);
|
|
555
|
+
|
|
556
|
+
// ATAs
|
|
548
557
|
const liqsolPoolAta = await getAssociatedTokenAddress(
|
|
549
558
|
liqsolMint,
|
|
550
559
|
poolAuthority,
|
|
@@ -566,21 +575,31 @@ export async function buildOutpostAccounts(
|
|
|
566
575
|
TOKEN_2022_PROGRAM_ID,
|
|
567
576
|
);
|
|
568
577
|
|
|
578
|
+
// user_record PDAs keyed by TOKEN ACCOUNTS (matches capital-staking)
|
|
579
|
+
const bucketUserRecord = deriveUserRecordPda(bucketTokenAccount);
|
|
580
|
+
const liqsolPoolUserRecord = deriveUserRecordPda(liqsolPoolAta);
|
|
581
|
+
const userUserRecord = deriveUserRecordPda(userAta);
|
|
582
|
+
|
|
583
|
+
const extraAccountMetaList = deriveExtraAccountMetaListPda(liqsolMint);
|
|
584
|
+
|
|
569
585
|
// Chainlink program feeds
|
|
570
586
|
let chainLinkFeed = CHAINLINK_FEED;
|
|
571
|
-
let chainLinkProgram = CHAINLINK_PROGRAM
|
|
587
|
+
let chainLinkProgram = CHAINLINK_PROGRAM;
|
|
572
588
|
|
|
573
589
|
try {
|
|
574
590
|
const program = getLiqsolCoreProgram(connection);
|
|
575
|
-
const ts: TrancheState =
|
|
591
|
+
const ts: TrancheState =
|
|
592
|
+
await program.account.trancheState.fetch(trancheState);
|
|
593
|
+
|
|
594
|
+
// If on-chain config overrides are present, prefer those.
|
|
576
595
|
if (ts.chainlinkFeed && ts.chainlinkProgram) {
|
|
577
596
|
chainLinkFeed = ts.chainlinkFeed as PublicKey;
|
|
578
597
|
chainLinkProgram = ts.chainlinkProgram as PublicKey;
|
|
579
598
|
}
|
|
580
599
|
} catch {
|
|
581
600
|
// If trancheState isn't initialized yet, we fall back to the constants.
|
|
582
|
-
// In that case,
|
|
583
|
-
// behavior until admin initializes TrancheState on-chain.
|
|
601
|
+
// In that case, purchase instructions will still fail, which is the
|
|
602
|
+
// correct behavior until admin initializes TrancheState on-chain.
|
|
584
603
|
}
|
|
585
604
|
|
|
586
605
|
void connection; // reserved for future extra validation
|
|
@@ -592,21 +611,20 @@ export async function buildOutpostAccounts(
|
|
|
592
611
|
liqsolMint,
|
|
593
612
|
liqsolPoolAta,
|
|
594
613
|
userAta,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
userUserRecord,
|
|
614
|
+
outpostAccount,
|
|
615
|
+
userPretokenRecord,
|
|
598
616
|
distributionState,
|
|
599
|
-
payRateHistory,
|
|
600
617
|
bucketAuthority,
|
|
601
618
|
bucketTokenAccount,
|
|
602
|
-
|
|
619
|
+
bucketUserRecord,
|
|
620
|
+
liqsolPoolUserRecord,
|
|
621
|
+
userUserRecord,
|
|
603
622
|
trancheState,
|
|
604
|
-
userWarrantRecord,
|
|
605
623
|
chainLinkFeed,
|
|
606
624
|
chainLinkProgram,
|
|
625
|
+
extraAccountMetaList
|
|
607
626
|
};
|
|
608
627
|
}
|
|
609
|
-
|
|
610
628
|
// -----------------------------------------------------------------------------
|
|
611
629
|
// Epoch / scheduling helpers
|
|
612
630
|
// -----------------------------------------------------------------------------
|
|
@@ -780,5 +798,4 @@ export async function waitUntilSafeToExecuteFunction(
|
|
|
780
798
|
export interface ScheduleConfig {
|
|
781
799
|
early?: number; // fraction of epoch, default 0.10
|
|
782
800
|
late?: number; // fraction of epoch, default 0.90
|
|
783
|
-
}
|
|
784
|
-
|
|
801
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -37,30 +37,120 @@ export interface IStakingClient {
|
|
|
37
37
|
}): Promise<TrancheSnapshot | null>;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Cross-chain portfolio view for a single account/wallet.
|
|
42
|
+
*
|
|
43
|
+
* On Solana (liqSOL + Outpost + pretokens) we fill:
|
|
44
|
+
* - native: SOL wallet lamports
|
|
45
|
+
* - liq: liqSOL in user ATA
|
|
46
|
+
* - staked: liqSOL staked into Outpost (stakedLiqsol)
|
|
47
|
+
* - wire: WIRE pretokens purchased (1e8 scale)
|
|
48
|
+
* - yield: Outpost yield view (index/shares + implied claim/yield)
|
|
49
|
+
*
|
|
50
|
+
* On other chains:
|
|
51
|
+
* - native/liq/wire/staked can still be populated as appropriate
|
|
52
|
+
* - yield may be undefined if no index/shares concept exists.
|
|
53
|
+
*/
|
|
40
54
|
export interface Portfolio {
|
|
41
|
-
/** Native balance on chain: ETH, SOL */
|
|
55
|
+
/** Native balance on chain: ETH, SOL, etc. */
|
|
42
56
|
native: BalanceView;
|
|
43
|
-
|
|
57
|
+
|
|
58
|
+
/** Liquid staking token balance (LiqETH, LiqSOL, etc.). */
|
|
44
59
|
liq: BalanceView;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Outpost-staked balance:
|
|
63
|
+
* - On Solana: liqSOL staked via `synd` (stakedLiqsol, in lamports).
|
|
64
|
+
* - On other chains: protocol-specific staked principal, if any.
|
|
65
|
+
*/
|
|
66
|
+
staked: BalanceView;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Prelaunch WIRE “shares” (pretokens).
|
|
70
|
+
* - On Solana: totalPretokensPurchased (1e8 scale).
|
|
71
|
+
* - On other chains: analogous pretoken balance if supported.
|
|
72
|
+
*/
|
|
48
73
|
wire: BalanceView;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Yield / index-based view (SOL + Outpost only for now).
|
|
77
|
+
*
|
|
78
|
+
* If the connected chain doesn’t expose an index+shares model,
|
|
79
|
+
* this will be undefined.
|
|
80
|
+
*/
|
|
81
|
+
yield?: YieldView;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Extra PDAs, account addresses, and raw state useful for debugging
|
|
85
|
+
* and advanced UI (e.g. tranche price, global index, PDAs).
|
|
86
|
+
*/
|
|
53
87
|
extras?: Record<string, any>;
|
|
54
|
-
|
|
88
|
+
|
|
89
|
+
/** Chain ID of the network from which this portfolio was fetched. */
|
|
55
90
|
chainID: ChainID;
|
|
56
91
|
}
|
|
57
92
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Canonical view of a single balance on a given chain.
|
|
95
|
+
*
|
|
96
|
+
* amount – integer base units (wei, lamports, token base units)
|
|
97
|
+
* symbol – display symbol (“SOL”, “LiqSOL”, “$WIRE”, etc.)
|
|
98
|
+
* decimals – how many decimal places to use when formatting
|
|
99
|
+
* ata – optional SPL ATA / ERC-20 address (where applicable)
|
|
100
|
+
*/
|
|
101
|
+
export interface BalanceView {
|
|
102
|
+
amount: bigint;
|
|
103
|
+
symbol: string;
|
|
104
|
+
decimals: number;
|
|
105
|
+
ata?: SolPubKey;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* SOL / Outpost yield view.
|
|
110
|
+
*
|
|
111
|
+
* All amounts are integers in base units (lamports for liqSOL).
|
|
112
|
+
*
|
|
113
|
+
* Math matches capital-staking:
|
|
114
|
+
* INDEX_SCALE = 1e12
|
|
115
|
+
* sharesToTokens = shares * currentIndex / INDEX_SCALE
|
|
116
|
+
*/
|
|
117
|
+
export interface YieldView {
|
|
118
|
+
/**
|
|
119
|
+
* Current global index for the Outpost pool.
|
|
120
|
+
* - 1e12 scale (INDEX_SCALE)
|
|
121
|
+
* - sharesToTokens(shares) = shares * currentIndex / indexScale
|
|
122
|
+
*/
|
|
123
|
+
currentIndex: bigint;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Fixed scale factor used for index math.
|
|
127
|
+
* - Always 1_000_000_000_000n (1e12) on Solana Outpost.
|
|
128
|
+
*/
|
|
129
|
+
indexScale: bigint;
|
|
130
|
+
|
|
131
|
+
/** Total shares outstanding in the Outpost pool (all users). */
|
|
132
|
+
totalShares: bigint;
|
|
133
|
+
|
|
134
|
+
/** User’s staked shares in the Outpost pool. */
|
|
135
|
+
userShares: bigint;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Total liqSOL (lamports) the user could claim right now if they fully
|
|
139
|
+
* unwound their stake:
|
|
140
|
+
* estimatedClaimLiqsol = userShares * currentIndex / indexScale
|
|
141
|
+
*/
|
|
142
|
+
estimatedClaimLiqsol: bigint;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Portion of estimatedClaimLiqsol that is “yield” above principal:
|
|
146
|
+
* estimatedYieldLiqsol = max(0, estimatedClaimLiqsol - stakedLiqsol)
|
|
147
|
+
*
|
|
148
|
+
* NOTE: stakedLiqsol principal itself is surfaced separately as
|
|
149
|
+
* Portfolio.staked.amount.
|
|
150
|
+
*/
|
|
151
|
+
estimatedYieldLiqsol: bigint;
|
|
152
|
+
}
|
|
153
|
+
|
|
64
154
|
export interface TrancheLadderItem {
|
|
65
155
|
/** On-chain tranche id, 0-based (0,1,2,...) */
|
|
66
156
|
id: number;
|
|
@@ -110,10 +200,11 @@ export interface TrancheSnapshot {
|
|
|
110
200
|
supplyGrowthBps: number; // e.g. 100 = +1% per tranche
|
|
111
201
|
priceGrowthBps: number; // e.g. 200 = +2% per tranche
|
|
112
202
|
|
|
203
|
+
totalPretokensSold: bigint; // total pretokens sold across all tranches (1e8 scale)
|
|
204
|
+
|
|
113
205
|
/** Current tranche supply state (1e8 scale) */
|
|
114
206
|
currentTrancheSupply: bigint; // remaining in current tranche
|
|
115
207
|
initialTrancheSupply: bigint; // capacity for current tranche
|
|
116
|
-
totalWarrantsSold: bigint; // global cumulative sold (all tranches), 1e8
|
|
117
208
|
|
|
118
209
|
/** Native token → USD price if available (SOL/USD, ETH/USD, etc, 1e8 scale) */
|
|
119
210
|
nativePriceUsd?: bigint;
|