@0dotxyz/p0-ts-sdk 2.3.0-alpha.4 → 2.3.0-alpha.5
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/index.cjs +6340 -362
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -33
- package/dist/index.d.ts +28 -33
- package/dist/index.js +6340 -362
- package/dist/index.js.map +1 -1
- package/dist/vendor.cjs +6145 -189
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +910 -152
- package/dist/vendor.d.ts +910 -152
- package/dist/vendor.js +6138 -190
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1254,16 +1254,14 @@ interface MakeSwapCollateralTxParams {
|
|
|
1254
1254
|
* Params for {@link makeRollPtTx} — rolling a matured Exponent PT collateral position into
|
|
1255
1255
|
* its next-maturity PT, so the **full deposit ends up as new PT** (no leftover), in one
|
|
1256
1256
|
* flash-loan-wrapped bundle:
|
|
1257
|
-
* 1. withdraw the old PT, then Exponent `
|
|
1258
|
-
*
|
|
1259
|
-
*
|
|
1260
|
-
* swaps use — a normal token is swappable, the un-swappable SY is never exposed)
|
|
1257
|
+
* 1. withdraw the old PT, then Exponent `merge` (redeem PT → SY, post-maturity, 1:1)
|
|
1258
|
+
* 2. buy the new PT with that SY directly on the successor's **CLMM** (`MarketThree`) PT/SY
|
|
1259
|
+
* pool via `trade_pt` — no base-token round-trip, no external aggregator
|
|
1261
1260
|
* 3. deposit the new PT.
|
|
1262
1261
|
*
|
|
1263
|
-
*
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1266
|
-
* new PT's market depth.
|
|
1262
|
+
* The buy is liquidity-bounded by the successor pool's depth. The SY → PT price is quoted by
|
|
1263
|
+
* simulating the redeem + trade (reading the CLMM `TradePtEvent.amount_out`), so the deposit
|
|
1264
|
+
* is sized to the guaranteed minimum out.
|
|
1267
1265
|
*/
|
|
1268
1266
|
interface MakeRollPtTxParams {
|
|
1269
1267
|
program: MarginfiProgram;
|
|
@@ -1285,9 +1283,7 @@ interface MakeRollPtTxParams {
|
|
|
1285
1283
|
depositBank: BankType;
|
|
1286
1284
|
tokenProgram: PublicKey;
|
|
1287
1285
|
};
|
|
1288
|
-
/**
|
|
1289
|
-
swapOpts: SwapOpts;
|
|
1290
|
-
/** Exponent `wrapper_merge` (redeem) config for the matured PT. */
|
|
1286
|
+
/** Exponent redeem (`merge`) + successor-CLMM buy config for the matured PT. */
|
|
1291
1287
|
rollOpts: RollPtOpts;
|
|
1292
1288
|
addressLookupTableAccounts?: AddressLookupTableAccount[];
|
|
1293
1289
|
overrideInferAccounts?: {
|
|
@@ -1295,30 +1291,27 @@ interface MakeRollPtTxParams {
|
|
|
1295
1291
|
authority?: PublicKey;
|
|
1296
1292
|
};
|
|
1297
1293
|
crossbarUrl?: string;
|
|
1298
|
-
/** See `MakeLoopTxParams.swapEngineRunner`. */
|
|
1299
|
-
swapEngineRunner?: SwapEngineRunner;
|
|
1300
1294
|
}
|
|
1301
1295
|
/**
|
|
1302
|
-
* Exponent
|
|
1303
|
-
* `
|
|
1304
|
-
*
|
|
1296
|
+
* Exponent roll config for {@link makeRollPtTx}. `makeRollPtTx` resolves the matured vault's
|
|
1297
|
+
* `merge` accounts and the successor pool's CLMM `trade_pt` accounts internally from these
|
|
1298
|
+
* addresses — the caller never assembles Exponent accounts/ixs.
|
|
1305
1299
|
*/
|
|
1306
1300
|
interface RollPtOpts {
|
|
1307
1301
|
/** The matured PT's Exponent `MarketTwo` — its `vault` is read (one of market/vault required). */
|
|
1308
1302
|
maturedMarket?: PublicKey;
|
|
1309
1303
|
/** …or the matured vault directly. */
|
|
1310
1304
|
maturedVault?: PublicKey;
|
|
1311
|
-
/**
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
baseTokenProgram?: PublicKey;
|
|
1305
|
+
/** The successor maturity's **CLMM** (`MarketThree`) pool — where the new PT trades (SY → PT). */
|
|
1306
|
+
successorMarket: PublicKey;
|
|
1307
|
+
/** Slippage tolerance (bps) for the SY → PT CLMM swap. Defaults to 50. */
|
|
1308
|
+
slippageBps?: number;
|
|
1309
|
+
/** Token program for the shared SY mint (defaults to the classic Token program). */
|
|
1310
|
+
syTokenProgram?: PublicKey;
|
|
1318
1311
|
/**
|
|
1319
1312
|
* Optional dedicated PT-roll address lookup table (fetched internally) that compresses the
|
|
1320
|
-
*
|
|
1321
|
-
*
|
|
1313
|
+
* merge + CLMM-swap flashloan bytes (see `examples/create-pt-roll-lut.ts`). Account *locks*
|
|
1314
|
+
* are already bounded by the compact, fixed CLMM footprint.
|
|
1322
1315
|
*/
|
|
1323
1316
|
lookupTable?: PublicKey;
|
|
1324
1317
|
}
|
|
@@ -3371,14 +3364,16 @@ declare function makeSwapDebtTx(params: MakeSwapDebtTxParams): Promise<{
|
|
|
3371
3364
|
* Roll a matured Exponent PT collateral position into its next-maturity PT, so the **full
|
|
3372
3365
|
* deposit ends up as new PT** (no leftover), in one flash-loan-wrapped bundle:
|
|
3373
3366
|
*
|
|
3374
|
-
* withdraw PT_old → Exponent `
|
|
3375
|
-
* →
|
|
3367
|
+
* withdraw PT_old → Exponent `merge` (PT_old → SY) → CLMM `trade_pt` (SY → PT_new)
|
|
3368
|
+
* → deposit PT_new
|
|
3376
3369
|
*
|
|
3377
|
-
*
|
|
3378
|
-
*
|
|
3379
|
-
*
|
|
3380
|
-
*
|
|
3381
|
-
*
|
|
3370
|
+
* The matured PT is redeemed 1:1 to its SY, then the successor PT is bought **directly on its
|
|
3371
|
+
* CLMM (`MarketThree`) PT/SY pool** — no base-token round-trip and no external aggregator. The
|
|
3372
|
+
* newer maturities (e.g. October bulkSOL) only list a CLMM pool (no `MarketTwo`, no order
|
|
3373
|
+
* book), and the CLMM uses a single `ticks` account, so the swap is a fixed, compact account
|
|
3374
|
+
* set regardless of trade size. The caller passes the matured Exponent market/vault + the
|
|
3375
|
+
* successor CLMM pool (`rollOpts`); everything Exponent is resolved internally. The buy is
|
|
3376
|
+
* bounded by the pool's depth.
|
|
3382
3377
|
*/
|
|
3383
3378
|
declare function makeRollPtTx(params: MakeRollPtTxParams): Promise<{
|
|
3384
3379
|
transactions: ExtendedV0Transaction[];
|
|
@@ -5580,7 +5575,7 @@ declare class MarginfiAccountWrapper {
|
|
|
5580
5575
|
*
|
|
5581
5576
|
* Auto-injects: program, marginfiAccount, bankMap, oraclePrices, bankMetadataMap, addressLookupTables
|
|
5582
5577
|
*
|
|
5583
|
-
* @param params - Roll-PT parameters (user provides: connection, withdrawOpts, depositOpts,
|
|
5578
|
+
* @param params - Roll-PT parameters (user provides: connection, withdrawOpts, depositOpts, rollOpts, etc.)
|
|
5584
5579
|
*/
|
|
5585
5580
|
makeRollPtTx(params: Omit<MakeRollPtTxParams, "program" | "marginfiAccount" | "bankMap" | "oraclePrices" | "bankMetadataMap" | "addressLookupTableAccounts">): Promise<{
|
|
5586
5581
|
transactions: ExtendedV0Transaction[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1254,16 +1254,14 @@ interface MakeSwapCollateralTxParams {
|
|
|
1254
1254
|
* Params for {@link makeRollPtTx} — rolling a matured Exponent PT collateral position into
|
|
1255
1255
|
* its next-maturity PT, so the **full deposit ends up as new PT** (no leftover), in one
|
|
1256
1256
|
* flash-loan-wrapped bundle:
|
|
1257
|
-
* 1. withdraw the old PT, then Exponent `
|
|
1258
|
-
*
|
|
1259
|
-
*
|
|
1260
|
-
* swaps use — a normal token is swappable, the un-swappable SY is never exposed)
|
|
1257
|
+
* 1. withdraw the old PT, then Exponent `merge` (redeem PT → SY, post-maturity, 1:1)
|
|
1258
|
+
* 2. buy the new PT with that SY directly on the successor's **CLMM** (`MarketThree`) PT/SY
|
|
1259
|
+
* pool via `trade_pt` — no base-token round-trip, no external aggregator
|
|
1261
1260
|
* 3. deposit the new PT.
|
|
1262
1261
|
*
|
|
1263
|
-
*
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1266
|
-
* new PT's market depth.
|
|
1262
|
+
* The buy is liquidity-bounded by the successor pool's depth. The SY → PT price is quoted by
|
|
1263
|
+
* simulating the redeem + trade (reading the CLMM `TradePtEvent.amount_out`), so the deposit
|
|
1264
|
+
* is sized to the guaranteed minimum out.
|
|
1267
1265
|
*/
|
|
1268
1266
|
interface MakeRollPtTxParams {
|
|
1269
1267
|
program: MarginfiProgram;
|
|
@@ -1285,9 +1283,7 @@ interface MakeRollPtTxParams {
|
|
|
1285
1283
|
depositBank: BankType;
|
|
1286
1284
|
tokenProgram: PublicKey;
|
|
1287
1285
|
};
|
|
1288
|
-
/**
|
|
1289
|
-
swapOpts: SwapOpts;
|
|
1290
|
-
/** Exponent `wrapper_merge` (redeem) config for the matured PT. */
|
|
1286
|
+
/** Exponent redeem (`merge`) + successor-CLMM buy config for the matured PT. */
|
|
1291
1287
|
rollOpts: RollPtOpts;
|
|
1292
1288
|
addressLookupTableAccounts?: AddressLookupTableAccount[];
|
|
1293
1289
|
overrideInferAccounts?: {
|
|
@@ -1295,30 +1291,27 @@ interface MakeRollPtTxParams {
|
|
|
1295
1291
|
authority?: PublicKey;
|
|
1296
1292
|
};
|
|
1297
1293
|
crossbarUrl?: string;
|
|
1298
|
-
/** See `MakeLoopTxParams.swapEngineRunner`. */
|
|
1299
|
-
swapEngineRunner?: SwapEngineRunner;
|
|
1300
1294
|
}
|
|
1301
1295
|
/**
|
|
1302
|
-
* Exponent
|
|
1303
|
-
* `
|
|
1304
|
-
*
|
|
1296
|
+
* Exponent roll config for {@link makeRollPtTx}. `makeRollPtTx` resolves the matured vault's
|
|
1297
|
+
* `merge` accounts and the successor pool's CLMM `trade_pt` accounts internally from these
|
|
1298
|
+
* addresses — the caller never assembles Exponent accounts/ixs.
|
|
1305
1299
|
*/
|
|
1306
1300
|
interface RollPtOpts {
|
|
1307
1301
|
/** The matured PT's Exponent `MarketTwo` — its `vault` is read (one of market/vault required). */
|
|
1308
1302
|
maturedMarket?: PublicKey;
|
|
1309
1303
|
/** …or the matured vault directly. */
|
|
1310
1304
|
maturedVault?: PublicKey;
|
|
1311
|
-
/**
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
baseTokenProgram?: PublicKey;
|
|
1305
|
+
/** The successor maturity's **CLMM** (`MarketThree`) pool — where the new PT trades (SY → PT). */
|
|
1306
|
+
successorMarket: PublicKey;
|
|
1307
|
+
/** Slippage tolerance (bps) for the SY → PT CLMM swap. Defaults to 50. */
|
|
1308
|
+
slippageBps?: number;
|
|
1309
|
+
/** Token program for the shared SY mint (defaults to the classic Token program). */
|
|
1310
|
+
syTokenProgram?: PublicKey;
|
|
1318
1311
|
/**
|
|
1319
1312
|
* Optional dedicated PT-roll address lookup table (fetched internally) that compresses the
|
|
1320
|
-
*
|
|
1321
|
-
*
|
|
1313
|
+
* merge + CLMM-swap flashloan bytes (see `examples/create-pt-roll-lut.ts`). Account *locks*
|
|
1314
|
+
* are already bounded by the compact, fixed CLMM footprint.
|
|
1322
1315
|
*/
|
|
1323
1316
|
lookupTable?: PublicKey;
|
|
1324
1317
|
}
|
|
@@ -3371,14 +3364,16 @@ declare function makeSwapDebtTx(params: MakeSwapDebtTxParams): Promise<{
|
|
|
3371
3364
|
* Roll a matured Exponent PT collateral position into its next-maturity PT, so the **full
|
|
3372
3365
|
* deposit ends up as new PT** (no leftover), in one flash-loan-wrapped bundle:
|
|
3373
3366
|
*
|
|
3374
|
-
* withdraw PT_old → Exponent `
|
|
3375
|
-
* →
|
|
3367
|
+
* withdraw PT_old → Exponent `merge` (PT_old → SY) → CLMM `trade_pt` (SY → PT_new)
|
|
3368
|
+
* → deposit PT_new
|
|
3376
3369
|
*
|
|
3377
|
-
*
|
|
3378
|
-
*
|
|
3379
|
-
*
|
|
3380
|
-
*
|
|
3381
|
-
*
|
|
3370
|
+
* The matured PT is redeemed 1:1 to its SY, then the successor PT is bought **directly on its
|
|
3371
|
+
* CLMM (`MarketThree`) PT/SY pool** — no base-token round-trip and no external aggregator. The
|
|
3372
|
+
* newer maturities (e.g. October bulkSOL) only list a CLMM pool (no `MarketTwo`, no order
|
|
3373
|
+
* book), and the CLMM uses a single `ticks` account, so the swap is a fixed, compact account
|
|
3374
|
+
* set regardless of trade size. The caller passes the matured Exponent market/vault + the
|
|
3375
|
+
* successor CLMM pool (`rollOpts`); everything Exponent is resolved internally. The buy is
|
|
3376
|
+
* bounded by the pool's depth.
|
|
3382
3377
|
*/
|
|
3383
3378
|
declare function makeRollPtTx(params: MakeRollPtTxParams): Promise<{
|
|
3384
3379
|
transactions: ExtendedV0Transaction[];
|
|
@@ -5580,7 +5575,7 @@ declare class MarginfiAccountWrapper {
|
|
|
5580
5575
|
*
|
|
5581
5576
|
* Auto-injects: program, marginfiAccount, bankMap, oraclePrices, bankMetadataMap, addressLookupTables
|
|
5582
5577
|
*
|
|
5583
|
-
* @param params - Roll-PT parameters (user provides: connection, withdrawOpts, depositOpts,
|
|
5578
|
+
* @param params - Roll-PT parameters (user provides: connection, withdrawOpts, depositOpts, rollOpts, etc.)
|
|
5584
5579
|
*/
|
|
5585
5580
|
makeRollPtTx(params: Omit<MakeRollPtTxParams, "program" | "marginfiAccount" | "bankMap" | "oraclePrices" | "bankMetadataMap" | "addressLookupTableAccounts">): Promise<{
|
|
5586
5581
|
transactions: ExtendedV0Transaction[];
|