@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.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 `wrapper_merge` (redeem PT → underlying **base**
1258
- * token, e.g. bulkSOL in one ix, post-maturity, no slippage)
1259
- * 2. swap base new PT via the multi-provider swap engine (the same one the loop/collateral
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
- * Structurally identical to {@link MakeSwapCollateralTxParams} with a `wrapper_merge` leg in
1264
- * front: it takes the same `swapOpts` (base new PT) plus a thin `rollOpts` (the matured
1265
- * Exponent market/vault + the underlying base token). The swap is liquidity-bounded by the
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
- /** Swap config for the base new-PT leg (same as swap-collateral's `swapOpts`). */
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 redeem config for {@link makeRollPtTx}. `makeRollPtTx` resolves the matured vault's
1303
- * `wrapper_merge` accounts internally from these addresses the caller never assembles
1304
- * Exponent accounts/ixs. The buy leg is the swap engine (`swapOpts`), not part of this.
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
- * The vault's underlying **base** token (e.g. bulkSOL) — the token `wrapper_merge` redeems
1313
- * the SY into and the swap leg consumes. Required: it isn't stored on the vault.
1314
- */
1315
- baseMint: PublicKey;
1316
- /** Token program for the base mint (defaults to the classic Token program). */
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
- * `wrapper_merge` + swap flashloan back under the tx size limit
1321
- * (see `examples/create-pt-roll-lut.ts`).
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 `wrapper_merge` (PT_old → underlying base, e.g. bulkSOL)
3375
- * → swap-engine (base → PT_new, Titan/Jupiter) → deposit PT_new
3367
+ * withdraw PT_old → Exponent `merge` (PT_old → SY) CLMM `trade_pt` (SY → PT_new)
3368
+ * → deposit PT_new
3376
3369
  *
3377
- * Structurally `makeSwapCollateralTx` with a `wrapper_merge` leg in front: the matured PT is
3378
- * redeemed to a normal, swappable base token (never the un-swappable SY), then the existing
3379
- * multi-provider swap engine buys the new PT. The caller passes the matured Exponent
3380
- * market/vault + base token (`rollOpts`) and the swap config (`swapOpts`); everything Exponent
3381
- * is resolved internally. The buy is bounded by the new PT's market depth.
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, swapOpts, rollOpts, etc.)
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 `wrapper_merge` (redeem PT → underlying **base**
1258
- * token, e.g. bulkSOL in one ix, post-maturity, no slippage)
1259
- * 2. swap base new PT via the multi-provider swap engine (the same one the loop/collateral
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
- * Structurally identical to {@link MakeSwapCollateralTxParams} with a `wrapper_merge` leg in
1264
- * front: it takes the same `swapOpts` (base new PT) plus a thin `rollOpts` (the matured
1265
- * Exponent market/vault + the underlying base token). The swap is liquidity-bounded by the
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
- /** Swap config for the base new-PT leg (same as swap-collateral's `swapOpts`). */
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 redeem config for {@link makeRollPtTx}. `makeRollPtTx` resolves the matured vault's
1303
- * `wrapper_merge` accounts internally from these addresses the caller never assembles
1304
- * Exponent accounts/ixs. The buy leg is the swap engine (`swapOpts`), not part of this.
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
- * The vault's underlying **base** token (e.g. bulkSOL) — the token `wrapper_merge` redeems
1313
- * the SY into and the swap leg consumes. Required: it isn't stored on the vault.
1314
- */
1315
- baseMint: PublicKey;
1316
- /** Token program for the base mint (defaults to the classic Token program). */
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
- * `wrapper_merge` + swap flashloan back under the tx size limit
1321
- * (see `examples/create-pt-roll-lut.ts`).
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 `wrapper_merge` (PT_old → underlying base, e.g. bulkSOL)
3375
- * → swap-engine (base → PT_new, Titan/Jupiter) → deposit PT_new
3367
+ * withdraw PT_old → Exponent `merge` (PT_old → SY) CLMM `trade_pt` (SY → PT_new)
3368
+ * → deposit PT_new
3376
3369
  *
3377
- * Structurally `makeSwapCollateralTx` with a `wrapper_merge` leg in front: the matured PT is
3378
- * redeemed to a normal, swappable base token (never the un-swappable SY), then the existing
3379
- * multi-provider swap engine buys the new PT. The caller passes the matured Exponent
3380
- * market/vault + base token (`rollOpts`) and the swap config (`swapOpts`); everything Exponent
3381
- * is resolved internally. The buy is bounded by the new PT's market depth.
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, swapOpts, rollOpts, etc.)
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[];