Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions light-token/cookbook/create-ata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import ProgramCreateAtaMacrosAiPrompt from "/snippets/ai-prompts/program-cookbook/create-ata-macros.mdx";

1. Associated Light Token accounts can hold token balances of light, SPL, or Token 2022 mints.
2. Light-ATAs are on-chain accounts like SPL ATA's, but the light token program sponsors the rent-exemption cost for you.

Check warning on line 37 in light-token/cookbook/create-ata.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/cookbook/create-ata.mdx#L37

Did you really mean 'ATA's'?

<Accordion title="Light Rent Config Explained">
<CompressibleRentExplained />
Expand Down Expand Up @@ -266,9 +266,9 @@

```toml
[dependencies]
light-sdk = { version = "0.18.0", features = ["anchor", "v2", "cpi-context"] }
light-sdk-macros = "0.18.0"
light-compressible = "0.1.0"
light-sdk = { version = "0.23.0", features = ["anchor", "v2", "cpi-context"] }
light-sdk-macros = "0.23.0"
light-compressible = "0.6.0"
anchor-lang = "0.31"
```

Expand Down
6 changes: 3 additions & 3 deletions light-token/cookbook/create-mint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import ProgramCreateMintCpiAiPrompt from "/snippets/ai-prompts/program-cookbook/create-mint-cpi.mdx";
import ProgramCreateMintMacrosAiPrompt from "/snippets/ai-prompts/program-cookbook/create-mint-macros.mdx";

1. Mint accounts uniquely represent a token on Solana and store its global metadata.

Check warning on line 49 in light-token/cookbook/create-mint.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/cookbook/create-mint.mdx#L49

Did you really mean 'Solana'?
2. Light mints are on-chain accounts like SPL mints, but the light token program sponsors the rent-exemption cost for you.
3. Add an interface PDA to existing SPL or Token 2022 mints for interoperability with Light Token. The interface PDA holds SPL or Token 2022 tokens when wrapped to Light Token.

Expand All @@ -61,7 +61,7 @@

<Tab title="TypeScript Client">

`createMintInterface` is a unified interface that dispatches to different mint creation paths based on programId:

Check warning on line 64 in light-token/cookbook/create-mint.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/cookbook/create-mint.mdx#L64

Did you really mean 'programId'?

- `TOKEN_PROGRAM_ID` or `TOKEN_2022_PROGRAM_ID` → delegates to SPL or T22 `createMint`
- Otherwise it defaults to `LIGHT_TOKEN_PROGRAM_ID` → creates a Light Token mint
Expand Down Expand Up @@ -300,7 +300,7 @@
```

<Info>
The address of the mint account is stored in an address Merkle tree

Check warning on line 303 in light-token/cookbook/create-mint.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/cookbook/create-mint.mdx#L303

Did you really mean 'Merkle'?
, which is maintained by the protocol.
The client passes a validity proof that proves the mint address does not
exist yet.
Expand Down Expand Up @@ -334,12 +334,12 @@
</Step>

<Step>
### Build Account Infos and CPI the Light Token Program

Check warning on line 337 in light-token/cookbook/create-mint.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/cookbook/create-mint.mdx#L337

Did you really mean 'Infos'?

Use `invoke` or `invoke_signed`:
- When `mint_seed` is an external keypair, use `invoke`.

Check warning on line 340 in light-token/cookbook/create-mint.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/cookbook/create-mint.mdx#L340

Did you really mean 'keypair'?
- When `mint_seed` is a PDA, use `invoke_signed` with its seeds.
- When both `mint_seed` and `authority` are PDAs, use `invoke_signed` with both seeds.

Check warning on line 342 in light-token/cookbook/create-mint.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/cookbook/create-mint.mdx#L342

Did you really mean 'PDAs'?

<Tabs>
<Tab title="invoke (External signer)">
Expand Down Expand Up @@ -478,9 +478,9 @@

```toml
[dependencies]
light-sdk = { version = "0.18.0", features = ["anchor", "v2", "cpi-context"] }
light-sdk-macros = "0.18.0"
light-compressible = "0.1.0"
light-sdk = { version = "0.23.0", features = ["anchor", "v2", "cpi-context"] }
light-sdk-macros = "0.23.0"
light-compressible = "0.6.0"
anchor-lang = "0.31"
```

Expand Down
6 changes: 3 additions & 3 deletions light-token/cookbook/create-token-account.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import ProgramCreateTokenAccountCpiAiPrompt from "/snippets/ai-prompts/program-cookbook/create-token-account-cpi.mdx";
import ProgramCreateTokenAccountMacrosAiPrompt from "/snippets/ai-prompts/program-cookbook/create-token-account-macros.mdx";

1. Light token accounts are Solana accounts that hold token balances of light, SPL, or Token 2022 mints.

Check warning on line 30 in light-token/cookbook/create-token-account.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/cookbook/create-token-account.mdx#L30

Did you really mean 'Solana'?
2. Light token accounts are on-chain accounts like SPL ATA's, but the light token program sponsors the rent-exemption cost for you.

Check warning on line 31 in light-token/cookbook/create-token-account.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/cookbook/create-token-account.mdx#L31

Did you really mean 'ATA's'?

<Accordion title="Light Rent Config Explained">
<CompressibleRentExplained />
Expand Down Expand Up @@ -201,9 +201,9 @@

```toml
[dependencies]
light-sdk = { version = "0.18.0", features = ["anchor", "v2", "cpi-context"] }
light-sdk-macros = "0.18.0"
light-compressible = "0.1.0"
light-sdk = { version = "0.23.0", features = ["anchor", "v2", "cpi-context"] }
light-sdk-macros = "0.23.0"
light-compressible = "0.6.0"
anchor-lang = "0.31"
```

Expand Down
4 changes: 2 additions & 2 deletions light-token/defi/programs-pinocchio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import AgentSkillDefi from "/snippets/setup/agent-skill-defi.mdx";
import DefiPinocchioAiPrompt from "/snippets/ai-prompts/defi/defi-pinocchio.mdx";

The Light-SDK sponsors rent-exemption for your PDAs, token accounts, and mints. Your program logic stays the same.

Check warning on line 9 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L9

Did you really mean 'PDAs'?

| | Before | After |
|------------------------|--------|-------|
Expand All @@ -19,7 +19,7 @@
| State struct | Add `compression_info: CompressionInfo` field, derive `LightPinocchioAccount` |
| Program enum | Derive `LightProgramPinocchio` to generate compress/decompress handlers |
| Entrypoint | Route generated discriminators alongside your custom ones |
| Init handler | Replace `spl_token` CPIs with `light_token_pinocchio` CPIs to create rent-free accounts |

Check warning on line 22 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L22

Did you really mean 'CPIs'?

Check warning on line 22 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L22

Did you really mean 'CPIs'?
| Other instructions | No changes |

If you use Anchor instead of Pinocchio, see [Program Integration](./programs).
Expand All @@ -29,7 +29,7 @@
<AgentSkillDefi />

<Callout type="info">
Complete pinocchio Swap reference implementation: [pinocchio-swap](https://github.com/Lightprotocol/examples-light-token/tree/simplify-trait/pinocchio/swap)

Check warning on line 32 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L32

Did you really mean 'pinocchio'?
</Callout>

<Tabs>
Expand All @@ -39,8 +39,8 @@

```toml
[dependencies]
light-account-pinocchio = { version = "0.20", features = ["token", "std"] }
light-token-pinocchio = "0.20"
light-account-pinocchio = { version = "0.23.0", features = ["token", "std"] }
light-token-pinocchio = "0.23.0"

pinocchio = "0.9"
pinocchio-pubkey = { version = "0.3", features = ["const"] }
Expand Down Expand Up @@ -465,9 +465,9 @@

The SDK pays the rent-exemption cost. After extended inactivity, cold accounts auto-compress. Your program only ever
interacts with hot accounts. Clients can safely load cold accounts back into the
onchain Solana account space when needed via `create_load_instructions`.

Check warning on line 468 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L468

Did you really mean 'onchain'?

Check warning on line 468 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L468

Did you really mean 'Solana'?

Under the hood, clients use `AccountInterface` - a superset of Solana's

Check warning on line 470 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L470

Did you really mean 'superset'?

Check warning on line 470 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L470

Did you really mean 'Solana's'?
`Account` that unifies hot and cold state. See [Router Integration](./routers)
for details.

Expand All @@ -491,21 +491,21 @@

<Accordion title="How does it prevent re-init attacks?"> When creating an
account for the first time, the SDK provides a proof that the account doesn't
exist in the cold address space. The SVM already verifies this for the onchain

Check warning on line 494 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L494

Did you really mean 'onchain'?
space. Both address spaces are checked before creation, preventing re-init
attacks, even if the account is currently cold. </Accordion>

<Accordion title="Who triggers compression?">
Miners (Forester nodes) compress accounts that have been inactive for an extended period of time (when their virtual rent balance drops below threshold).
In practice, having to load cold accounts should be rare. The common path (hot) has no extra overhead and does not increase CU or txn size.

Check warning on line 500 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L500

Did you really mean 'txn'?
</Accordion>

<Accordion title="How is the SDK able to sponsor rent exemption?">
When accounts compress after extended inactivity, the on-chain rent-exemption is released back
to the rent sponsor. This creates a revolving lifecycle: active "hot" accounts hold a
rent-exempt lamports balance, inactive "cold" accounts release it back. The

Check warning on line 506 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L506

Did you really mean 'lamports'?
rent sponsor must be derived from the program owner. For all mint, ATA, and
token accounts, the Light Token Program is the rent sponsor. For your own program-owned PDAs, the SDK derives a rent sponsor address automatically.

Check warning on line 508 in light-token/defi/programs-pinocchio.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs-pinocchio.mdx#L508

Did you really mean 'PDAs'?
</Accordion>

<Accordion title="Do rent-free accounts increase CU?">
Expand Down
6 changes: 3 additions & 3 deletions light-token/defi/programs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import AgentSkillDefi from "/snippets/setup/agent-skill-defi.mdx";
import DefiAnchorAiPrompt from "/snippets/ai-prompts/anchor-programs/defi-anchor.mdx";

The Light-SDK sponsors rent-exemption for your PDAs, token accounts, and mints. Your program logic stays the same.

Check warning on line 9 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L9

Did you really mean 'PDAs'?

| | Before | After |
|------------------------|--------|-------|
Expand Down Expand Up @@ -43,9 +43,9 @@
```toml
[dependencies]

light-sdk = { version = "0.19.0", features = ["anchor", "v2", "cpi-context"] }
light-sdk-macros = "0.19.0"
light-token = { version = "0.4.0", features = ["anchor"] }
light-sdk = { version = "0.23.0", features = ["anchor", "v2", "cpi-context"] }
light-sdk-macros = "0.23.0"
light-token = { version = "0.23.0", features = ["anchor"] }
light-anchor-spl = "0.31" # TokenInterface uses light_token::ID
anchor-lang = "0.31"
```
Expand Down Expand Up @@ -98,7 +98,7 @@
Derive `LightAccounts` on your `Accounts` struct and add `#[light_account(...)]` next to `#[account(...)]`.

<Tabs>
<Tab title="PDAs">

Check warning on line 101 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L101

Did you really mean 'PDAs'?
```rust
#[account(
init,
Expand All @@ -108,7 +108,7 @@
space = 8 + PoolState::INIT_SPACE
)]
#[light_account(init)]
pub pool_state: Box<Account<'info, PoolState>>,

Check warning on line 111 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L111

Did you really mean 'pool_state'?
```
</Tab>
<Tab title="Token Account">
Expand All @@ -124,10 +124,10 @@
init,
token,
authority = [AUTH_SEED.as_bytes()],
mint = token_mint,

Check warning on line 127 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L127

Did you really mean 'token_mint'?
owner = authority,
)]
pub token_vault: UncheckedAccount<'info>,

Check warning on line 130 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L130

Did you really mean 'token_vault'?
```

<Accordion title="Manual">
Expand Down Expand Up @@ -172,13 +172,13 @@
#[light_account(
init,
mint,
mint_signer = lp_mint_signer,

Check warning on line 175 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L175

Did you really mean 'mint_signer'?

Check warning on line 175 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L175

Did you really mean 'lp_mint_signer'?
authority = authority,
decimals = 9,
mint_seeds = &[LP_MINT_SIGNER_SEED, pool_state.key().as_ref(), &[params.mint_signer_bump]],

Check warning on line 178 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L178

Did you really mean 'mint_seeds'?
authority_seeds = &[AUTH_SEED.as_bytes(), &[params.authority_bump]]

Check warning on line 179 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L179

Did you really mean 'authority_seeds'?
)]
pub lp_mint: UncheckedAccount<'info>,

Check warning on line 181 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L181

Did you really mean 'lp_mint'?
```

<Accordion title="Mint with Metadata">
Expand Down Expand Up @@ -280,7 +280,7 @@
</Accordion>

## Step 5: Instructions
Replace `spl_token` with `light_token` instructions as you need. The API is a superset of SPL-token so switching is straightforward.

Check warning on line 283 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L283

Did you really mean 'superset'?

Examples include: `MintToCpi`, `TransferCpi`, `TransferInterfaceCpi`,
`CreateTokenAccountCpi`, and `CreateTokenAtaCpi`.
Expand Down Expand Up @@ -503,9 +503,9 @@

The SDK pays the rent-exemption cost. After extended inactivity, cold accounts auto-compress. Your program only ever
interacts with hot accounts. Clients can safely load cold accounts back into the
onchain Solana account space when needed via `create_load_instructions`.

Check warning on line 506 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L506

Did you really mean 'onchain'?

Check warning on line 506 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L506

Did you really mean 'Solana'?

Under the hood, clients use `AccountInterface` - a superset of Solana's

Check warning on line 508 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L508

Did you really mean 'superset'?

Check warning on line 508 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L508

Did you really mean 'Solana's'?
`Account` that unifies hot and cold state. See [Router Integration](./routers)
for details.

Expand All @@ -525,19 +525,19 @@

<Accordion title="How does it prevent re-init attacks?"> When creating an
account for the first time, the SDK provides a proof that the account doesn't
exist in the cold address space. The SVM already verifies this for the onchain

Check warning on line 528 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L528

Did you really mean 'onchain'?
space. Both address spaces are checked before creation, preventing re-init
attacks, even if the account is currently cold. </Accordion>

<Accordion title="Who triggers compression?">
Miners (Forester nodes) compress accounts that have been inactive for an extended period of time (when their virtual rent balance drops below threshold).
In practice, having to load cold accounts should be rare. The common path (hot) has no extra overhead and does not increase CU or txn size.

Check warning on line 534 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L534

Did you really mean 'txn'?
</Accordion>

<Accordion title="How is the SDK able to sponsor rent exemption?">
When accounts compress after extended inactivity, the on-chain rent-exemption is released back
to the rent sponsor. This creates a revolving lifecycle: active "hot" accounts hold a
rent-exempt lamports balance, inactive "cold" accounts release it back. The

Check warning on line 540 in light-token/defi/programs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/programs.mdx#L540

Did you really mean 'lamports'?
rent sponsor must be derived from the program owner. For all mint, ATA, and
token accounts, the Light Token Program is the rent sponsor. For your own program-owned PDAs, the SDK derives a rent sponsor address automatically.
</Accordion>
Expand Down
2 changes: 1 addition & 1 deletion light-token/defi/routers.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Router Integration"
description: "Add support for rent-free AMMs on Solana."

Check warning on line 3 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L3

Did you really mean 'AMMs'?

Check warning on line 3 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L3

Did you really mean 'Solana'?
---

import AgentSkillRouter from "/snippets/setup/agent-skill-router.mdx";
Expand Down Expand Up @@ -133,7 +133,7 @@
}
```

- `instruction_accounts` -- returns the pubkeys the instruction reads/writes.

Check warning on line 136 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L136

Did you really mean 'pubkeys'?
- `load_specs` -- given cold `AccountInterface`s (with `ColdContext`), returns the `AccountSpec`s
that `create_load_instructions` needs to load them.

Expand All @@ -145,7 +145,7 @@

```toml
[dependencies]
light-client = { version = "0.19.0", features = ["v2"] }
light-client = { version = "0.23.0", features = ["v2"] }

# AMM SDK that implements LightProgramInterface (provided by the AMM team)
example-amm-sdk = "0.1"
Expand Down Expand Up @@ -193,7 +193,7 @@
| Type | Source | Purpose |
|------|--------|---------|
| `AccountInterface` | `light-client` | Account data with optional `ColdContext` |
| `LightProgramInterface` | `light-client` | Trait that AMM SDKs implement |

Check warning on line 196 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L196

Did you really mean 'SDKs'?
| `AccountSpec` | `light-client` | Input to `create_load_instructions` |

### Reference implementation
Expand All @@ -213,7 +213,7 @@
| Quote | Works | Works |
| Swap | Direct | Load first / Bundle |
| Latency | Normal | +0-200ms* |
| Tx size | Normal | +100-2400 bytes*|

Check warning on line 216 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L216

Did you really mean 'Tx'?
| CU | Normal | +15k-400k CU*|

*Depends on the number and type of cold accounts.*
Expand All @@ -221,7 +221,7 @@
### When does a market go cold?

Accounts go cold after extended inactivity. Their virtual rent balance drops
below a threshold and miners compress them onto the Solana ledger.

Check warning on line 224 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L224

Did you really mean 'Solana'?

They stay cold until any client loads them back in-flight via `create_load_instructions`.

Expand All @@ -244,7 +244,7 @@
**Hot (common path)**: No.

**Cold**: Loading accounts adds 1-200ms depending on whether a validity proof
is needed. If load + swap exceed Solana's 1232 byte limit, use Jito bundles.

Check warning on line 247 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L247

Did you really mean 'Solana's'?

Check warning on line 247 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L247

Did you really mean 'Jito'?
</Accordion>

<Accordion title="How long do accounts stay hot after loading?">
Expand All @@ -254,7 +254,7 @@

<Accordion title="What if load + swap exceed Solana's tx size limit?">

Send as a Jito bundle:

Check warning on line 257 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L257

Did you really mean 'Jito'?

```rust expandable
use solana_sdk::{instruction::Instruction, pubkey::Pubkey, system_instruction};
Expand Down Expand Up @@ -293,17 +293,17 @@
</Accordion>

<Accordion title="Do RPC providers support get_account_interface?">
Yes. Supported by Helius and Triton. Can also be self-hosted via the

Check warning on line 296 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L296

Did you really mean 'Helius'?
<a href="https://github.com/helius-labs/photon" target="_blank">open-source Photon indexer</a>.
</Accordion>

<Accordion title="What if the indexer is down?"> Hot markets work all the same
as long as Solana is up. Cold accounts can't be loaded until the indexer

Check warning on line 301 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L301

Did you really mean 'Solana'?
recovers. Compression is cryptographically verifiable, and safety
does not depend on the indexer. </Accordion>

<Accordion title="I don't stream. Can I still support rent free markets?"> Yes.
To read state, and to build txns, simply use `get_multiple_account_interfaces`

Check warning on line 306 in light-token/defi/routers.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/defi/routers.mdx#L306

Did you really mean 'txns'?
for the instruction's accounts and check `is_cold()`. This adds a RPC round-trip
but requires no streaming setup. </Accordion>

Expand Down
2 changes: 1 addition & 1 deletion light-token/streaming/mints.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Streaming Mint Accounts"
sidebarTitle: "Mint Accounts"
description: "Stream light-mint accounts and metadata via Laserstream."

Check warning on line 4 in light-token/streaming/mints.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/mints.mdx#L4

Did you really mean 'Laserstream'?
keywords: ["streaming mint accounts solana", "laserstream light mint", "grpc mint streaming"]
---

Expand All @@ -14,12 +14,12 @@
|:------|:------------|
| **New mints** | Raw mint data |
| **Mint updates** | Supply changes, authority changes |
| **TokenMetadata** | Name, symbol, URI, additional_metadata |

Check warning on line 17 in light-token/streaming/mints.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/mints.mdx#L17

Did you really mean 'additional_metadata'?
| **Cold/hot transitions** | Mint compressed or decompressed |

<Note>
This guide is for teams building custom data pipelines (aggregators, market makers).
If you just need account lookups, use [`get_account_interface`](/light-token/defi/routers) instead.

Check warning on line 22 in light-token/streaming/mints.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/mints.mdx#L22

Did you really mean 'lookups'?
</Note>

<AgentSkillStreaming />
Expand All @@ -29,12 +29,12 @@

## Architecture

Light mints are Solana accounts owned by the Light Token Program. The streaming

Check warning on line 32 in light-token/streaming/mints.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/mints.mdx#L32

Did you really mean 'Solana'?
setup requires two gRPC subscriptions:

| Subscription | Detects | How |
|:-------------|:--------|:----|
| Account sub (`owner: cToken...`, `account_type == 1`) | Hot state + cold-to-hot | Pubkey cache lookup |

Check warning on line 37 in light-token/streaming/mints.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/mints.mdx#L37

Did you really mean 'Pubkey'?
| Transaction sub (`account_include: cToken...`) | Hot-to-cold | Balance heuristic (`pre > 0, post == 0`) |

The account subscription delivers all state changes while mints are hot.
Expand All @@ -51,7 +51,7 @@
futures = "0.3"
bs58 = "0.5"
borsh = "0.10"
light-token-interface = "0.3.0"
light-token-interface = "0.5.0"
```

```rust
Expand Down Expand Up @@ -141,7 +141,7 @@
</Step>

<Step>
### Deserialize mint accounts

Check warning on line 144 in light-token/streaming/mints.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/mints.mdx#L144

Did you really mean 'Deserialize'?

```rust
use helius_laserstream::grpc::subscribe_update::UpdateOneof;
Expand Down
2 changes: 1 addition & 1 deletion light-token/streaming/tokens.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Streaming Token Accounts"
sidebarTitle: "Token Accounts"
description: "Stream light-token accounts via Laserstream. Same base layout as SPL Token."

Check warning on line 4 in light-token/streaming/tokens.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/tokens.mdx#L4

Did you really mean 'Laserstream'?
keywords: ["streaming token accounts solana", "laserstream light token", "grpc token streaming"]
---

Expand All @@ -12,7 +12,7 @@

<Note>
This guide is for teams building custom data pipelines (aggregators, market makers).
If you just need account lookups, use [`get_account_interface`](/light-token/defi/routers) instead.

Check warning on line 15 in light-token/streaming/tokens.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/tokens.mdx#L15

Did you really mean 'lookups'?
</Note>

<AgentSkillStreaming />
Expand All @@ -28,7 +28,7 @@

| Subscription | Detects | How |
|:-------------|:--------|:----|
| Account sub (`owner: cToken...`) | Hot state + cold-to-hot | Pubkey cache lookup |

Check warning on line 31 in light-token/streaming/tokens.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/tokens.mdx#L31

Did you really mean 'Pubkey'?
| Transaction sub (`account_include: cToken...`) | Hot-to-cold | Balance heuristic (`pre > 0, post == 0`) |

The account subscription delivers all state changes while accounts are hot.
Expand Down Expand Up @@ -56,7 +56,7 @@
futures = "0.3"
bs58 = "0.5"
borsh = "0.10"
light-token-interface = "0.3.0"
light-token-interface = "0.5.0"
```

```rust
Expand Down Expand Up @@ -161,7 +161,7 @@

### Hot-to-cold

For each transaction update, find accounts whose lamport balance dropped to zero.

Check warning on line 164 in light-token/streaming/tokens.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/tokens.mdx#L164

Did you really mean 'lamport'?
The `cache.remove` call ensures only accounts you're already tracking are processed:

<FindClosedAccounts />
Expand All @@ -169,7 +169,7 @@
### Cold-to-hot

When a token account is decompressed, the account subscription delivers the
re-created account. Match its pubkey against `cold_cache`:

Check warning on line 172 in light-token/streaming/tokens.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/tokens.mdx#L172

Did you really mean 'pubkey'?

```rust
Some(UpdateOneof::Account(account_update)) => {
Expand All @@ -186,7 +186,7 @@
## Point queries

`getAccountInfo` returns null for cold accounts. `get_account_interface()` races
hot and cold lookups and returns raw account bytes that work with your standard SPL parser:

Check warning on line 189 in light-token/streaming/tokens.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/tokens.mdx#L189

Did you really mean 'lookups'?

```rust
use light_client::rpc::{LightClient, LightClientConfig, Rpc};
Expand Down Expand Up @@ -248,7 +248,7 @@
| Variant | Description |
|:--------|:------------|
| `TokenMetadata(TokenMetadata)` | Name, symbol, URI, additional metadata |
| `PausableAccount(PausableAccountExtension)` | Marker: mint is pausable (no data; pause state lives on mint) |

Check warning on line 251 in light-token/streaming/tokens.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

light-token/streaming/tokens.mdx#L251

Did you really mean 'pausable'?
| `PermanentDelegateAccount(PermanentDelegateAccountExtension)` | Marker: mint has permanent delegate |
| `TransferFeeAccount(TransferFeeAccountExtension)` | Withheld fees from transfers |
| `TransferHookAccount(TransferHookAccountExtension)` | Marker: mint has transfer hook |
Expand Down
12 changes: 6 additions & 6 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ This documentation provides guides, references and tutorials for developers buil
- [Primitives](#primitives)
- [AI Agent Resources](#ai-agent-resources)
- [Getting Started](#getting-started)
- [Light Token Basics](#light-token-basics)
- [SDK Reference](#sdk-reference)
- [Solana to Light Reference](#solana-to-light-reference)
- [Anchor Reference](#anchor-reference)
- [For Payments and Wallets](#for-payments-and-wallets)
- [For DeFi](#for-defi)
- [For Data Streaming](#for-data-streaming)
- [Light Token Basics](#light-token-basics)
- [PDA Account basics for Solana programs](#pda-account-basics-for-solana-programs)
- [For Other Use Cases](#for-other-use-cases)
- [Learn](#learn)
- [Resources](#resources)
- [SDK Reference](#sdk-reference)
- [Solana to Light Reference](#solana-to-light-reference)
- [Anchor Reference](#anchor-reference)
- [JSON RPC Methods](#json-rpc-methods)
- [Support](#support)
- [Examples for DeFi](#examples-for-defi)
Expand Down Expand Up @@ -75,7 +75,7 @@ Comparing creation cost and CU usage:
- [Anchor Constraints LightAccount](https://www.zkcompression.com/api-reference/anchor.md): Syntax reference for #[light_account] constraints with sponsored rent-exemption.

## For Payments and Wallets
- [Payment Flows on Solana with Light Token](https://www.zkcompression.com/light-token/payments/overview.md): Learn how the Light Token API's reduce account creation cost for stablecoin payment infrastructure by 99% with minimal code differences and similar developer experience to SPL / Token 2022.
- [Payment Flows on Solana with Light Token](https://www.zkcompression.com/light-token/payments/overview.md): Learn how the Light Token API's reduce account creation cost for stablecoin payment infrastructure by 99% with similar developer experience to SPL / Token 2022.
- [Integration Guide for Stablecoin Payments](https://www.zkcompression.com/light-token/payments/integration-guide.md): Guide to integrate light-token APIs for stablecoin payments with comparison to SPL.
- [Integration Guide for Wallet Applications](https://www.zkcompression.com/light-token/wallets/overview.md): Guide for Wallet Applications to add Light-token support.
- [Sign with Privy](https://www.zkcompression.com/light-token/wallets/privy.md): Integrate light-token with Privy embedded wallets for rent-free token accounts and transfers.
Expand Down Expand Up @@ -114,7 +114,7 @@ Comparing creation cost and CU usage:
- **Compressed PDA:** [Overview & Program Template](https://www.zkcompression.com/pda/compressed-pdas/overview.md): Compressed PDAs provide full composability and functionality of accounts at PDAs, without rent-exemption cost per account. Suited for accounts where each user or entity gets their own PDA and state is infrequently accessed.
- **Compressed PDA:** [Client Guide](https://www.zkcompression.com/pda/compressed-pdas/guides/client-guide.md): Rust and Typescript client guides with step-by-step implementation and full code examples.
- **Compressed PDA:** [Create Nullifier PDAs](https://www.zkcompression.com/pda/compressed-pdas/how-to-create-nullifier-pdas.md): Create rent-free nullifier PDAs to prevent duplicate actions.
- **Compressed PDA > Program Guides:** [Overview](https://www.zkcompression.com/pda/compressed-pdas/guides.md): Overview to guides for Solana programs to create, update, close, reinitialize, and burn permanently
- **Compressed PDA > Program Guides:** [Overview](https://www.zkcompression.com/pda/compressed-pdas/guides.md): Overview to guides for Solana programs to create, update, close, reinitialize, and burn permanently compressed accounts.
- **Compressed PDA:** [Program Examples](https://www.zkcompression.com/pda/compressed-pdas/program-examples.md): Program example repository for compressed accounts with tests.

## For Other Use Cases
Expand Down
4 changes: 2 additions & 2 deletions pda/light-pda/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Light PDA"
description: "Create Solana PDA accounts with sponsored rent-exemption and minimal code changes. Use like any Solana PDA, e.g. for DeFi pools, vaults, pool accounts, or other shared state."

Check warning on line 3 in pda/light-pda/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

pda/light-pda/overview.mdx#L3

Did you really mean 'Solana'?

Check warning on line 3 in pda/light-pda/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

pda/light-pda/overview.mdx#L3

Did you really mean 'Solana'?
---

import FullCounterExample from '/snippets/code-snippets/light-token/counter/anchor-macro/full-example.mdx';
Expand All @@ -9,9 +9,9 @@

| Creation Cost | Regular PDA | Light-PDA |
|------------------|----------------------|-----------------|
| 100-byte account | ~1,600,000 lamports | ~11,500 lamports |

Check warning on line 12 in pda/light-pda/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

pda/light-pda/overview.mdx#L12

Did you really mean 'lamports'?

Check warning on line 12 in pda/light-pda/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

pda/light-pda/overview.mdx#L12

Did you really mean 'lamports'?

A Light-PDA is a standard Solana PDA. Seeds, bump derivation, and

Check warning on line 14 in pda/light-pda/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

pda/light-pda/overview.mdx#L14

Did you really mean 'Solana'?
`invoke_signed` work the same way. Your instruction handlers for reads,
updates, and closes don't change.

Expand All @@ -24,7 +24,7 @@
| State struct | Derive `LightAccount`, add `compression_info: CompressionInfo` |
| Accounts struct | Derive `LightAccounts`, add `#[light_account]` on init accounts |
| Program module | Add `#[light_program]` above `#[program]` |
| Instructions (reads, updates, closes) | No program changes. Client prepends a load instruction if account is cold. |

Check warning on line 27 in pda/light-pda/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

pda/light-pda/overview.mdx#L27

Did you really mean 'prepends'?

---

Expand All @@ -37,8 +37,8 @@

```toml
[dependencies]
light-account = { version = "0.20.0", features = ["anchor"] }
light-sdk = { version = "0.20.0", features = ["anchor", "v2", "cpi-context"] }
light-account = { version = "0.23.0", features = ["anchor"] }
light-sdk = { version = "0.23.0", features = ["anchor", "v2", "cpi-context"] }
anchor-lang = "0.31"
```

Expand Down Expand Up @@ -177,21 +177,21 @@

<Accordion title="How does it prevent re-init attacks?"> When creating an
account for the first time, the SDK provides a proof that the account doesn't
exist in the cold address space. The SVM already verifies this for the onchain

Check warning on line 180 in pda/light-pda/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

pda/light-pda/overview.mdx#L180

Did you really mean 'onchain'?
space. Both address spaces are checked before creation, preventing re-init
attacks, even if the account is currently cold. </Accordion>

<Accordion title="Who triggers compression?">
Miners (Forester nodes) compress accounts that have been inactive for an extended period of time (when their virtual rent balance drops below threshold).
In practice, having to load cold accounts should be rare. The common path (hot) has no extra overhead and does not increase CU or txn size.

Check warning on line 186 in pda/light-pda/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

pda/light-pda/overview.mdx#L186

Did you really mean 'txn'?
</Accordion>

<Accordion title="How is the SDK able to sponsor rent exemption?">
When accounts compress after extended inactivity, the on-chain rent-exemption is released back
to the rent sponsor. This creates a revolving lifecycle: active "hot" accounts hold a
rent-exempt lamports balance, inactive "cold" accounts release it back. The

Check warning on line 192 in pda/light-pda/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

pda/light-pda/overview.mdx#L192

Did you really mean 'lamports'?
rent sponsor must be derived from the program owner. For all mint, ATA, and
token accounts, the Light Token Program is the rent sponsor. For your own program-owned PDAs, the SDK derives a rent sponsor address automatically.

Check warning on line 194 in pda/light-pda/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

pda/light-pda/overview.mdx#L194

Did you really mean 'PDAs'?
</Accordion>

<Accordion title="Do rent-free accounts increase CU?">
Expand Down
64 changes: 48 additions & 16 deletions scripts/generate-llms-txt.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ function collectPages(entry, prefix) {
}
if (entry && entry.group) {
const newPrefix = prefix ? `${prefix} > ${entry.group}` : entry.group;
// Program Guides: only include overview, not individual how-to pages
if (entry.group === 'Program Guides') {
const overview = entry.pages[0];
if (typeof overview === 'string') return [formatPage(overview, newPrefix)];
return [];
}
return entry.pages.flatMap((p) => collectPages(p, newPrefix));
}
return [];
Expand Down Expand Up @@ -177,7 +183,7 @@ function splitLightTokenProgram(group) {
basics.push(formatPage(entry));
} else if (entry.group === 'Cookbook' || entry.group === 'Examples') {
basics.push(...collectFlatPages(entry.pages));
} else if (entry.group === 'For Payments') {
} else if (entry.group === 'For Stablecoin Payments') {
paymentsWallets.push(...collectFlatPages(entry.pages));
} else if (entry.group === 'For Wallets') {
paymentsWallets.push(...collectFlatPages(entry.pages));
Expand All @@ -189,10 +195,10 @@ function splitLightTokenProgram(group) {
}

return [
{ name: 'Light Token Basics', lines: basics },
{ name: 'For Payments and Wallets', lines: paymentsWallets },
{ name: 'For DeFi', lines: defi },
{ name: 'For Data Streaming', lines: streaming },
{ name: 'Light Token Basics', lines: basics },
];
}

Expand Down Expand Up @@ -297,26 +303,49 @@ function generate() {
const aiAnchor = anchors.find((a) => a.anchor === 'AI Tools');
sections.push({ name: 'AI Agent Resources', lines: buildAiTools(aiAnchor) });

// 2. Documentation anchor — each group becomes an H2
// 2. Documentation and API Reference — interleaved
const docAnchor = anchors.find((a) => a.anchor === 'Documentation');
const apiAnchor = anchors.find((a) => a.anchor === 'API Reference');
const apiSections = buildApiReferenceSections(apiAnchor);

const sectionRenames = {
Introduction: 'Getting Started',
'PDA Accounts': 'PDA Account basics for Solana programs',
};

// Getting Started
const introGroup = docAnchor.groups.find((g) => g.group === 'Introduction');
if (introGroup) {
sections.push({
name: 'Getting Started',
lines: introGroup.pages.flatMap((p) => collectPages(p)),
});
}

// API Reference sections (SDK, Solana to Light, Anchor) — before Light Token
for (const s of apiSections) {
if (s.name !== 'JSON RPC Methods') sections.push(s);
}

// Light Token sections (payments, defi, streaming, then basics)
const ltGroup = docAnchor.groups.find(
(g) => g.group === 'Light Token Program',
);
if (ltGroup) sections.push(...splitLightTokenProgram(ltGroup));

// Remaining Documentation groups (PDA, Other Use Cases, Learn, Resources)
for (const group of docAnchor.groups) {
if (group.group === 'Light Token Program') {
sections.push(...splitLightTokenProgram(group));
} else {
sections.push({
name: sectionRenames[group.group] || group.group,
lines: group.pages.flatMap((p) => collectPages(p)),
});
}
if (group.group === 'Introduction' || group.group === 'Light Token Program')
continue;
sections.push({
name: sectionRenames[group.group] || group.group,
lines: group.pages.flatMap((p) => collectPages(p)),
});
}

// 3. API Reference anchor — each group becomes its own H2
const apiAnchor = anchors.find((a) => a.anchor === 'API Reference');
sections.push(...buildApiReferenceSections(apiAnchor));
// JSON RPC Methods (after Resources)
const jsonRpc = apiSections.find((s) => s.name === 'JSON RPC Methods');
if (jsonRpc) sections.push(jsonRpc);

// 4. Support anchor
const supportAnchor = anchors.find((a) => a.anchor === 'Support');
Expand Down Expand Up @@ -344,11 +373,14 @@ function generate() {
out.push('# ZK Compression by Light Protocol and Helius Labs');
out.push('');
out.push(
"> ZK Compression is a framework on Solana for stablecoin payment rails, consumer apps and defi. The Light SDK and API's let you create mint, token and PDA accounts >99% cheaper with familiar Solana developer experience.",
'> ZK Compression is a framework on Solana for stablecoin payment rails, agent commerce, consumer apps, defi protocols, depin, and more. ',
);
out.push(
"> The Light SDK and API's let you create mint, token and PDA accounts >99% cheaper with familiar Solana developer experience.",
);
out.push('');
out.push(
'This documentation provides guides, reference and tutorials for developers building on Solana.',
'This documentation provides guides, references and tutorials for developers building on Solana.',
);
out.push('');

Expand Down
4 changes: 2 additions & 2 deletions snippets/ai-prompts/anchor-programs/defi-anchor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Key macros/APIs: #[light_program], LightAccount, LightAccounts, #[light_account(
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps if missing: Bash \`cargo add light-sdk@0.19 --features anchor,v2,cpi-context\` and \`cargo add light-sdk-macros@0.19\` and \`cargo add light-token@0.4 --features anchor\` and \`cargo add light-anchor-spl@0.31\`
- Add deps if missing: Bash \`cargo add light-sdk@0.23 --features anchor,v2,cpi-context\` and \`cargo add light-sdk-macros@0.23\` and \`cargo add light-token@0.23 --features anchor\` and \`cargo add light-anchor-spl@0.31\`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's check the file exists and read the context around lines 43 and 102
fd defi-anchor.mdx

Repository: Lightprotocol/docs-v2

Length of output: 157


🏁 Script executed:

# Read the file to see the current state and context around lines 43 and 102
if [ -f "snippets/ai-prompts/anchor-programs/defi-anchor.mdx" ]; then
  echo "=== Lines 35-50 (around line 43) ==="
  sed -n '35,50p' "snippets/ai-prompts/anchor-programs/defi-anchor.mdx"
  echo ""
  echo "=== Lines 95-110 (around line 102) ==="
  sed -n '95,110p' "snippets/ai-prompts/anchor-programs/defi-anchor.mdx"
fi

Repository: Lightprotocol/docs-v2

Length of output: 1844


🏁 Script executed:

# Get the full file to understand the context better
wc -l "snippets/ai-prompts/anchor-programs/defi-anchor.mdx"

Repository: Lightprotocol/docs-v2

Length of output: 120


🏁 Script executed:

# Read the entire file to understand the context
cat -n "snippets/ai-prompts/anchor-programs/defi-anchor.mdx"

Repository: Lightprotocol/docs-v2

Length of output: 6859


🏁 Script executed:

# Check crates.io metadata for light-sdk 0.23.0
curl -s "https://crates.io/api/v1/crates/light-sdk/0.23.0" | python3 << 'EOF'
import json
import sys
data = json.load(sys.stdin)
print("light-sdk version:", data["crate"]["max_version"])
print("\nDependencies:")
for dep in data["dependencies"]:
    if dep["kind"] == "normal":
        print(f"  - {dep['crate_id']}: {dep.get('req', 'any')}")
EOF

Repository: Lightprotocol/docs-v2

Length of output: 785


🏁 Script executed:

# Also check light-anchor-spl to understand the anchor-lang requirement chain
curl -s "https://crates.io/api/v1/crates/light-anchor-spl/0.31" | python3 << 'EOF'
import json
import sys
data = json.load(sys.stdin)
print("light-anchor-spl version:", data["crate"]["max_version"])
print("\nDependencies:")
for dep in data["dependencies"]:
    if dep["kind"] == "normal":
        print(f"  - {dep['crate_id']}: {dep.get('req', 'any')}")
EOF

Repository: Lightprotocol/docs-v2

Length of output: 785


🌐 Web query:

light-sdk 0.23 anchor-lang dependency Anchor integration

💡 Result:

To integrate light-sdk = 0.23.0 into an Anchor program, you need to compile Light’s types with Anchor serialization and keep anchor-lang aligned to what light-sdk expects.

1) Cargo.toml (program)

light-sdk 0.23.0 has an optional dependency on anchor-lang ^0.31.1. [1]

[dependencies]
anchor-lang = "0.31.1"

light-sdk = { version = "0.23.0", features = ["anchor", "v2", "cpi-context"] }
  • Use the anchor feature so light-sdk derives AnchorSerialize/AnchorDeserialize (instead of Borsh). [1]
  • The Light docs also show Anchor integration using anchor-lang = "0.31" (same major/minor family). [2]

2) Code usage (Anchor)

In your program code, you can use anchor_lang normally and import Light helpers, e.g. (from the crate docs):

  • use anchor_lang::{prelude::*, Discriminator};
  • use light_sdk::{ ... LightAccount ... LightSystemProgramCpi ... ValidityProof ... } [1]

3) Common gotcha: Anchor version mismatch

If your project is on newer Anchor (e.g. Anchor docs show anchor-lang = "0.32.1" for Rust clients), you may hit Cargo resolution/type mismatch issues because light-sdk 0.23.0 is pinned to the 0.31.x line. In that case, either:

  • move your program to Anchor 0.31.x, or
  • use a Cargo override/patch strategy so the whole workspace resolves to a single anchor-lang version. [1][3]

Sources: [1] light-sdk 0.23.0 docs.rs crate page (deps + examples), [2] Light Protocol “Program Integration” page, [3] Anchor Rust client docs showing anchor-lang = "0.32.1".


🌐 Web query:

zkcompression.com light-token defi programs dependencies

💡 Result:

From the Light Token → For DeFi → Program Integration guide, the Step 1: Dependencies section lists these Cargo.toml deps: [1]

[dependencies]
light-sdk = { version = "0.19.0", features = ["anchor", "v2", "cpi-context"] }
light-sdk-macros = "0.19.0"
light-token = { version = "0.4.0", features = ["anchor"] }
light-anchor-spl = "0.31"    # TokenInterface uses light_token::ID
anchor-lang = "0.31"

Sources: [1]


Add anchor-lang@0.31 to the from-scratch dependency command.

The prompt supports a "new program from scratch" flow (step 3), but the cargo add command omits anchor-lang, which is required for Anchor integration with light-sdk@0.23.0. The official zkcompression.com guide explicitly includes anchor-lang = "0.31" in its dependencies section, and light-sdk 0.23.0 requires it when using the anchor feature. A fresh project following only this prompt's dependencies will fail at the verify step (anchor build).

Suggested fix
-- Add deps if missing: Bash `cargo add light-sdk@0.23 --features anchor,v2,cpi-context` and `cargo add light-sdk-macros@0.23` and `cargo add light-token@0.23 --features anchor` and `cargo add light-anchor-spl@0.31`
+- Add deps if missing: Bash `cargo add light-sdk@0.23 --features anchor,v2,cpi-context` and `cargo add light-sdk-macros@0.23` and `cargo add light-token@0.23 --features anchor` and `cargo add light-anchor-spl@0.31` and `cargo add anchor-lang@0.31`

Also applies to: 102-102

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@snippets/ai-prompts/anchor-programs/defi-anchor.mdx` at line 43, Update the
dependency installation command to include anchor-lang@0.31 so a from-scratch
Anchor program builds correctly: locate the Bash line that runs cargo add for
light-sdk@0.23, light-sdk-macros@0.23, light-token@0.23, and
light-anchor-spl@0.31 and add anchor-lang@0.31 to that list (ensuring the anchor
feature remains specified for light-sdk); this ensures the created project has
the required Anchor runtime dependency for functions relying on Anchor
integration.

- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down Expand Up @@ -99,7 +99,7 @@ Key macros/APIs: #[light_program], LightAccount, LightAccounts, #[light_account(
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps if missing: Bash `cargo add light-sdk@0.19 --features anchor,v2,cpi-context` and `cargo add light-sdk-macros@0.19` and `cargo add light-token@0.4 --features anchor` and `cargo add light-anchor-spl@0.31`
- Add deps if missing: Bash `cargo add light-sdk@0.23 --features anchor,v2,cpi-context` and `cargo add light-sdk-macros@0.23` and `cargo add light-token@0.23 --features anchor` and `cargo add light-anchor-spl@0.31`
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down
2 changes: 1 addition & 1 deletion snippets/ai-prompts/cpi-program-template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- Grep `declare_id|#\[program\]|entrypoint!|Pubkey|AccountInfo{{EXTRA_GREP}}` across src/
- Glob `**/*.rs` and `**/Cargo.toml` for project structure
- Identify: program ID, existing instructions, account structs, framework (Anchor or native)
- Read Cargo.toml — note existing dependencies and Solana SDK version

Check warning on line 21 in snippets/ai-prompts/cpi-program-template.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

snippets/ai-prompts/cpi-program-template.mdx#L21

Did you really mean 'Solana'?
- Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel

### 2. Read references
Expand All @@ -39,7 +39,7 @@
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash `cargo add light-sdk@0.16` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether docs consistently use exact vs floating light-sdk version notation.
rg -n 'cargo add\s+light-sdk@'
rg -n 'light-sdk\s*=\s*"?0\.23(\.0)?'

Repository: Lightprotocol/docs-v2

Length of output: 5101


Pin version notation to exact release across all AI prompt instructions for consistency.

The cargo add light-sdk@0.23 command at line 42 uses floating semver notation, while all static Cargo.toml snippets in the codebase use exact versions (0.23.0). This inconsistency exists systematically across the AI prompt files (anchor-programs, cpi-programs, program-cookbook). To ensure deterministic outcomes for users and align with the static snippet convention, update to cargo add light-sdk@0.23.0.

Proposed diff
-- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
+- Add deps: Bash `cargo add light-sdk@0.23.0` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Add deps: Bash `cargo add light-sdk@0.23.0` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@snippets/ai-prompts/cpi-program-template.mdx` at line 42, Replace floating
semver tokens in the AI prompt instructions with exact release versions: change
the Bash snippet cargo add light-sdk@0.23 to cargo add light-sdk@0.23.0 and
likewise pin anchor_lang@0.31 → anchor_lang@0.31.0 and solana-program@2.2 +
borsh@0.10 → solana-program@2.2.0 + borsh@0.10.0; apply these same exact-version
substitutions across the related AI prompt files (anchor-programs, cpi-programs,
program-cookbook) so all prompt command examples and inline cargo snippets
consistently use exact patch versions.

- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down
4 changes: 2 additions & 2 deletions snippets/ai-prompts/cpi-programs/burn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Key SDK API: LightAccount::new_burn()
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash \`cargo add light-sdk@0.16\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust)
- Add deps: Bash \`cargo add light-sdk@0.23\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust)
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down Expand Up @@ -99,7 +99,7 @@ Key SDK API: LightAccount::new_burn()
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash `cargo add light-sdk@0.16` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down
4 changes: 2 additions & 2 deletions snippets/ai-prompts/cpi-programs/client-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Key APIs:

### 5. Implement
- For TypeScript: Bash \`npm install @lightprotocol/stateless.js @lightprotocol/compressed-token @solana/web3.js\`
- For Rust: Bash \`cargo add light-client@0.16 light-sdk@0.16\`
- For Rust: Bash \`cargo add light-client@0.23 light-sdk@0.23\`
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down Expand Up @@ -109,7 +109,7 @@ Key APIs:

### 5. Implement
- For TypeScript: Bash `npm install @lightprotocol/stateless.js @lightprotocol/compressed-token @solana/web3.js`
- For Rust: Bash `cargo add light-client@0.16 light-sdk@0.16`
- For Rust: Bash `cargo add light-client@0.23 light-sdk@0.23`
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down
4 changes: 2 additions & 2 deletions snippets/ai-prompts/cpi-programs/close.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Key SDK API: LightAccount::new_close()
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash \`cargo add light-sdk@0.16\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust)
- Add deps: Bash \`cargo add light-sdk@0.23\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust)
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down Expand Up @@ -99,7 +99,7 @@ Key SDK API: LightAccount::new_close()
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash `cargo add light-sdk@0.16` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down
4 changes: 2 additions & 2 deletions snippets/ai-prompts/cpi-programs/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Key SDK API: LightAccount::new_init(), derive_address()
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash \`cargo add light-sdk@0.16\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust)
- Add deps: Bash \`cargo add light-sdk@0.23\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust)
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down Expand Up @@ -99,7 +99,7 @@ Key SDK API: LightAccount::new_init(), derive_address()
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash `cargo add light-sdk@0.16` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down
4 changes: 2 additions & 2 deletions snippets/ai-prompts/cpi-programs/reinitialize.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Prompt description="Build a program that reinitializes closed compressed accounts" actions={["copy", "cursor"]}>

Check warning on line 1 in snippets/ai-prompts/cpi-programs/reinitialize.mdx

View check run for this annotation

Mintlify / Mintlify Validation (luminouslabs-cc5545c6) - vale-spellcheck

snippets/ai-prompts/cpi-programs/reinitialize.mdx#L1

Did you really mean 'reinitializes'?
{`---
description: Build a program that reinitializes closed compressed accounts
allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression
Expand Down Expand Up @@ -40,7 +40,7 @@
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash \`cargo add light-sdk@0.16\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust)
- Add deps: Bash \`cargo add light-sdk@0.23\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Does cargo add anchor_lang@0.31resolve to theanchor-langcrate, or should documentation prefercargo add anchor-lang@0.31 as the canonical package name?

💡 Result:

cargo add anchor_lang@0.31 will resolve to the same crates.io package as cargo add anchor-lang@0.31 (crates.io normalizes - and _ as equivalent for crate/package naming, and Cargo uses the canonical name from the index). [1]

So, for documentation, prefer cargo add anchor-lang@0.31 as the canonical package name (matching the published crates.io name / how it will be recorded), while still using anchor_lang in Rust code (use anchor_lang::...) because Cargo/rustc translate - to _ for the crate identifier. [2][3]


Use canonical package name anchor-lang in the cargo add command.

Lines 43 and 102 use anchor_lang@0.31; while Cargo will resolve both names identically, the published crate name on crates.io is anchor-lang, which is the canonical spelling to use in documentation.

🔧 Suggested update
-- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
+- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor-lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)

Also applies to: 102-102

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@snippets/ai-prompts/cpi-programs/reinitialize.mdx` at line 43, Replace the
non-canonical crate name usage `anchor_lang@0.31` with the canonical crates.io
name `anchor-lang@0.31` in the two occurrences in the reinitialize.mdx prompt
text (the line showing the cargo add command and the later occurrence at line
102); update the documentation text so both `cargo add` examples use
`anchor-lang@0.31` (keeping other alternatives like `solana-program@2.2` +
`borsh@0.10` unchanged).

- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down Expand Up @@ -99,7 +99,7 @@
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash `cargo add light-sdk@0.16` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down
4 changes: 2 additions & 2 deletions snippets/ai-prompts/cpi-programs/update.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Key SDK API: LightAccount::new_mut()
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash \`cargo add light-sdk@0.16\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust)
- Add deps: Bash \`cargo add light-sdk@0.23\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust)
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down Expand Up @@ -99,7 +99,7 @@ Key SDK API: LightAccount::new_mut()
- Present the plan to the user for approval before proceeding

### 5. Implement
- Add deps: Bash `cargo add light-sdk@0.16` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
- Follow the guide and the approved plan
- Write/Edit to create or modify files
- TaskUpdate to mark each step done
Expand Down
Loading
Loading