> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exponent.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Sell PT

> Low-level instruction to sell PT tokens for base assets

# createSellPtInstruction

Builds a raw instruction to sell PT tokens for base assets. This instruction handles SY redemption to the base asset internally via remaining accounts, making it a convenience wrapper that combines the sell-PT and redeem-SY steps into a single instruction.

## Usage

```typescript theme={null}
import { createSellPtInstruction } from "@exponent-labs/exponent-sdk/client/clmm";
import { PublicKey, SystemProgram } from "@solana/web3.js";

const ix = createSellPtInstruction({
  seller: sellerKeypair.publicKey,
  market: marketAddress,
  tokenSyTrader: sellerSyTokenAccount,
  tokenPtTrader: sellerPtTokenAccount,
  tokenSyEscrow: marketSyEscrow,
  tokenPtEscrow: marketPtEscrow,
  addressLookupTable: lookupTableAddress,
  tokenProgram: tokenProgramId,
  syProgram: syProgramId,
  tokenFeeTreasurySy: feeTreasurySyAccount,
  tokenFeeTreasuryPt: feeTreasuryPtAccount,
  ticks: ticksAccount,
  eventAuthority: eventAuthorityPda,
  program: clmmProgramId,
  amountPt: 1_000_000_000n,
  minBaseAmount: 900_000_000n,
  priceSpotLimit: 0.95,
  redeemSyRemAccountsUntil: 5,
});
```

## Accounts

| Name                 | Type        | Signer | Writable | Description                   |
| -------------------- | ----------- | ------ | -------- | ----------------------------- |
| `seller`             | `PublicKey` | Yes    | Yes      | Wallet executing the trade    |
| `market`             | `PublicKey` | No     | Yes      | The CLMM market account       |
| `ticks`              | `PublicKey` | No     | Yes      | The market tick array account |
| `tokenSyTrader`      | `PublicKey` | No     | Yes      | Trader's SY token account     |
| `tokenPtTrader`      | `PublicKey` | No     | Yes      | Trader's PT token account     |
| `tokenSyEscrow`      | `PublicKey` | No     | Yes      | Market SY escrow account      |
| `tokenPtEscrow`      | `PublicKey` | No     | Yes      | Market PT escrow account      |
| `addressLookupTable` | `PublicKey` | No     | No       | Market address lookup table   |
| `tokenProgram`       | `PublicKey` | No     | No       | SPL Token program             |
| `syProgram`          | `PublicKey` | No     | No       | SY program                    |
| `tokenFeeTreasurySy` | `PublicKey` | No     | Yes      | SY fee treasury account       |
| `tokenFeeTreasuryPt` | `PublicKey` | No     | Yes      | PT fee treasury account       |
| `eventAuthority`     | `PublicKey` | No     | No       | Event authority PDA           |
| `program`            | `PublicKey` | No     | No       | CLMM program ID               |

## Args

| Name                       | Type             | Description                                                 |
| -------------------------- | ---------------- | ----------------------------------------------------------- |
| `amountPt`                 | `u64`            | Amount of PT tokens to sell                                 |
| `minBaseAmount`            | `u64`            | Minimum amount of base asset to receive                     |
| `priceSpotLimit`           | `f64` (optional) | Price limit for anti-sandwich protection                    |
| `redeemSyRemAccountsUntil` | `u8`             | Number of remaining accounts used for the SY redemption CPI |

## Returns

`TransactionInstruction` — a transaction instruction ready to be added to a transaction.
