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

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Advanced Token Instructions

> Batch multiple token operations into a single instruction, and recover SOL from token accounts, mints, and multisigs with the Token Program.

Beyond the common create, mint, and transfer operations, the Token Program is
also called from onchain programs via CPI and includes instructions for
recovering lamports:

<Columns cols={2}>
  <Card
    title="Calling the Token Program via CPI"
    href="/developers/docs/tokens/advanced/cpi"
  >
    Invoke the Token Program from an onchain program — transfer, mint, and burn
    tokens, sign with a PDA authority, and batch instructions into a single CPI.
  </Card>

<Card
  title="Withdraw Excess Lamports"
  href="/developers/docs/tokens/advanced/withdraw-excess-lamports"
>
  Recover SOL above the rent-exempt minimum from token accounts, mints, and
  multisig accounts without changing token balances.
</Card>

  <Card title="Unwrap Lamports" href="/developers/docs/tokens/advanced/unwrap-lamports">
    Convert wrapped SOL back into lamports, in full or in part, without closing
    the token account.
  </Card>
</Columns>

<Info>

`WithdrawExcessLamports` and `UnwrapLamports` are available through the
[`@solana-program/token`](https://www.npmjs.com/package/@solana-program/token)
client. Calling the Token Program via CPI applies to onchain programs.

</Info>

## Lamport recovery

`WithdrawExcessLamports` recovers SOL above the rent-exempt minimum from
token accounts, mints, and multisig accounts. `UnwrapLamports` converts
wrapped SOL in a native token account back into lamports.
