Skip to content

Add compressed token program documentation#3

Merged
tilo-14 merged 145 commits intomainfrom
ctoken
Dec 12, 2025
Merged

Add compressed token program documentation#3
tilo-14 merged 145 commits intomainfrom
ctoken

Conversation

@tilo-14
Copy link
Member

@tilo-14 tilo-14 commented Nov 27, 2025

Summary

  • Add comprehensive compressed token program documentation with cMint and cToken guides
  • Add program-side guide for creating cToken accounts via CPI
  • Add reusable snippets for rent comparison and account lists
  • Update docs.json navigation structure for compressed token program sections

New Documentation Files

Core Overview:

  • compressed-token-program/c-token-program.mdx - Main overview with cMint and cToken concepts

cMint Guides:

  • compressed-token-program/cmint/cmint.mdx - Create cMint with token metadata (client/program tabs)
  • compressed-token-program/cmint/update-metadata.mdx - Update cMint metadata

cToken Guides:

  • compressed-token-program/ctoken/create-ctoken.mdx - Create cToken accounts from clients
  • compressed-token-program/ctoken/program-create-ctoken.mdx - Create cToken accounts from programs via CPI
  • compressed-token-program/ctoken/mint-ctokens.mdx - Mint cTokens
  • compressed-token-program/ctoken/create-ata.mdx - Create associated token accounts
  • compressed-token-program/ctoken/ctoken-transfer.mdx - Transfer cTokens
  • compressed-token-program/ctoken/SPL-to-ctoken-transfer.mdx - Transfer SPL to cToken (compress)
  • compressed-token-program/ctoken/ctoken-to-spl-decompress.mdx - Transfer cToken to SPL (decompress)
  • compressed-token-program/ctoken/close-ctoken.mdx - Close cToken accounts
  • compressed-token-program/ctoken/compress-and-close.mdx - Compress and close accounts
  • compressed-token-program/ctoken/mint-actions.mdx - Mint authority actions

Reusable Snippets:

  • snippets/compressible-vs-solana-rent.mdx - Rent comparison accordion
  • snippets/ctoken-create-accounts-list.mdx - Account list table for CPI
  • snippets/install-dependencies-codegroup.mdx - Installation instructions (referenced)

Key Features

  • Program-side CPI guide with invoke() and invoke_signed() examples
  • Client/program tabs for flexible implementation approaches
  • Detailed rent model explanations with compressible extension
  • Code examples with inline comments and full working implementations
  • Structured navigation with expanded/collapsed sections in docs.json

Test Plan

  • Verify all internal links resolve correctly
  • Confirm code snippets render properly in both TypeScript and Rust tabs
  • Test accordion components (Account List, Compressible vs Solana Rent)
  • Validate navigation structure in docs.json
  • Review metadata frontmatter for all new files
  • Ensure reusable snippets import correctly across pages

Summary by CodeRabbit

  • New Features

    • Added Light Token Standard documentation with comprehensive guides and toolkit resources.
    • Introduced interactive calculators for rent costs, break-even analysis, and token compression comparison.
    • Added cookbook guides for light-token account creation, minting, transfers, and closing operations.
  • Documentation

    • Restructured navigation from tabs to grouped categories for better organization.
    • Expanded rent mechanics documentation with visual explainers and lifecycle visualizers.
    • Added toolkit sections for payments, wallets, DEXs, launchpads, trading apps, and streaming.
    • Published Light Token Standard FAQ and technical overview.
  • Chores

    • Reorganized documentation import paths for better maintainability.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request restructures the documentation site navigation from tabs to groups, introduces comprehensive light-token standard content including new cookbook guides and toolkits, adds interactive React components for rent calculations, reorganizes snippet file structure, updates internal links to reflect the new URL structure, and establishes a GitHub Actions workflow for syncing documentation from the light-protocol repository.

Changes

Cohort / File(s) Summary
Navigation & Configuration
docs.json, .windsurf/workflows/ask-deepwiki.md
Adds top-level banner with non-dismissible HTML content; replaces tab-based navigation with grouped structure; introduces "Light-Token Standard (Beta)" group; reorganizes compressed tokens; adds /landing/welcome redirect; removes path references from workflow markdown
Link Updates
learn/ai-tools-guide.mdx, learn/core-concepts/considerations.mdx, quickstart.mdx, resources/cli-installation.mdx, resources/addresses-and-urls.mdx
Updates card hrefs from /compressed-tokens/overview to /compressed-tokens; updates "Interface PDA" terminology and related info block; changes "Next Steps" card destination
Light-Token Core Documentation
light-token/README.mdx, light-token/faq.mdx, light-token/cookbook/*, light-token/toolkits/*
Adds comprehensive light-token standard guides including create-mint, create-ata, transfer-interface, close-token-account, mint-tokens, and extensions documentation; introduces toolkit guides for payments, wallets, DEXs, launchpads, trading apps, streaming, and FAQ covering overview, cost comparison, rent model, and token compatibility
Compressed Tokens & Rent Documentation
compressed-tokens/README.mdx, rent.mdx, snippets/compressible-vs-solana-rent.mdx, snippets/compressible-rent-explained.mdx, snippets/compressible-default-rent-config.mdx, compressed-token-program/stash.mdx
Adds new README for compressed tokens overview; introduces rent calculator documentation and rent mechanics explanation; updates default rent config values (22,208 → 17,208 lamports, 766 → 776 lamports); adds rent-requirement tip for SPL mints
React Calculation Components
snippets/jsx/solana-rent-calculator.jsx, snippets/jsx/compressible-rent-calculator.jsx, snippets/jsx/break-even-calculator.jsx, snippets/jsx/rent-lifecycle-visualizer.jsx
Adds four new interactive calculator/visualizer components: SolanaRentCalculator for rent-exempt balance calculation, CompressibleRentCalculator for prepaid rent configuration, BreakEvenCalculator for cost comparison, and RentLifecycleVisualizer for animated rent/economy simulation
Supporting React Components & Utilities
snippets/jsx/token-account-compressed-vs-spl.jsx, snippets/jsx/token22-extensions-table.jsx, snippets/jsx/code-compare.jsx, snippets/jsx/light-token-vs-spl-calculator.jsx, snippets/jsx/toolkit-card.jsx
Updates TokenAccount component styling; adds Token22ExtensionsTable for extension filtering/display; introduces CodeCompare for side-by-side code visualization with draggable divider; adds CTokenVsSplCalculator for cost comparison; introduces ToolkitCard component for toolkit overview layout
Snippet Import Path Reorganization
compressed-pdas/create-a-program-with-compressed-pdas.mdx, compressed-pdas/guides.mdx, compressed-pdas/guides/*, compressed-tokens/advanced-guides.mdx, compressed-tokens/advanced-guides/*, compressed-tokens/guides.mdx, compressed-tokens/guides/*, client-library/client-guide.mdx, resources/sdks/program-development.mdx
Updates import paths: setup snippets moved to /snippets/setup/*, accounts-list snippets moved to /snippets/accounts-list/*, overview-tables snippets moved to /snippets/overview-tables/* across numerous guide files
New Snippet Files: Accounts Lists
snippets/accounts-list/*
Adds new accounts documentation tables: close-account-infos, transfer-interface-accounts (SPL 2), light-mint-system-accounts, light-mint-to-light-token-accounts, light-token-create (client and on-chain), light-token-create-ata, and transfer-interface accounts lists
New Snippet Files: Setup & Configuration
snippets/setup/*, snippets/light-token-configure-rent.mdx, snippets/light-token-guides/*
Adds Rust and setup environment tabs; custom rent config documentation; light-token guide intros for ATA, client prerequisites, transfer-interface, and close operations; client/TypeScript prerequisites compositions
New Snippet Files: Overview Tables
snippets/overview-tables/*
Updates compressed-tokens-guides-table link text; adds integrate-light-token-guides, light-mint-guides, and light-token-guides tables
Core Concepts Documentation
learn/light-token-standard.mdx
Introduces comprehensive light-token standard conceptual guide with CompressedMint, BaseMint, CToken, and TokenData structure definitions; contrasts Light-Mint vs SPL Mint and Light-Token vs SPL Token; documents light-ATA derivation and rent configuration
Build & Automation
.github/workflows/sync-handlers.yml, scripts/sync-docs.sh
Adds GitHub Actions workflow sync-handlers triggered on repository_dispatch that checks out repos, runs sync script, and creates PR; introduces bash script to synchronize MDX documentation with Rust source files using awk-based code block replacement
Blog & Content
blog/README.mdx, blog/c-token.mdx
Adds blog section landing page; introduces c-token article detailing light-token standard, rent-free mints/tokens, pay-as-you-go rent model, and integration paths for wallets, DEXs, launchpads
UI & Styling
styles.css
Adds fadeIn keyframe animation (0 → 100% opacity) with 0.6s ease-out applied to article, content container, and main's first child elements
Removed File
.windsurf/rules/mint.md
Deletes comprehensive Mintlify documentation guidelines and standards document
Content Deletion
compressed-tokens/overview.mdx
Removes old compressed-tokens overview page (replaced by new compressed-tokens/README.mdx)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas requiring attention:
    • React calculator components (solana-rent-calculator.jsx, compressible-rent-calculator.jsx, break-even-calculator.jsx) — verify state management, computation logic, and edge-case handling for input bounds and formatting
    • CodeCompare component — verify draggable divider interaction, syntax highlighting regex correctness, copy-to-clipboard functionality, and keyboard navigation
    • RentLifecycleVisualizer component — verify SVG animation timing, state transitions, and interval-based simulation logic
    • docs.json restructuring — spot-check navigation group hierarchy, page paths, and redirect configuration for consistency
    • Import path updates across 20+ files — sample several to confirm path reorganization is consistent and all references are updated
    • GitHub Actions workflow and sync-docs.sh script — verify trigger conditions, repository checkout logic, and awk-based code replacement works correctly for target MDX files

Possibly related PRs

Poem

🐰 A rabbit hops through docs so bright,
New rent calculators, a wondrous sight!
Light-tokens bloom in organized piles,
Navigation groups stretch many a mile.
GitHub workflows sync with grace,
Documentation at a faster pace!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly describes the main change: adding comprehensive documentation for the compressed token program, which aligns with the extensive file additions and documentation structure changes throughout the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1069f43 and 6ec66e7.

📒 Files selected for processing (2)
  • docs.json (4 hunks)
  • quickstart.mdx (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs.json (1)

455-531: Fix non-existent file reference and inconsistent configuration in cToken Program tab.

Verification confirms critical issues in the cToken Program tab (lines 455-531):

  1. Non-existent file: compressed-token-program/ctoken/ctoken (line 473) does not exist. The ctoken directory contains no ctoken.mdx file.

  2. Missing expanded property: The Docs tab marks its "Guides" group as "expanded": true (line 61), but the cToken Program tab omits this property (line 471), creating inconsistent behavior.

  3. Content divergence: The two tabs contain different page lists:

    • Docs tab includes "compressed-token-program/ctoken/mint-ctokens" but cToken Program tab does not
    • cToken Program tab includes the invalid "compressed-token-program/ctoken/ctoken" reference but Docs tab does not

The cToken Program tab appears to be an intentional separate navigation structure, but contains corrupted references. Either remove the invalid ctoken page reference and add mint-ctokens, or restore consistency with the Docs tab structure. Additionally, decide whether the "expanded": true property should be applied to the cToken Program tab's Guides group.

🧹 Nitpick comments (1)
compressed-token-program/ctoken/create-ctoken.mdx (1)

6-6: Verify reusable snippet import.

Line 6 imports the CompressibleVsSolanaRent snippet from /snippets/compressible-vs-solana-rent.mdx. Confirm this snippet file exists and is correctly located at that path.

Also applies to: 45-45

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ee2d10 and 6aa5b2b.

📒 Files selected for processing (17)
  • compressed-token-program/c-token-program.mdx (1 hunks)
  • compressed-token-program/cmint/cmint.mdx (1 hunks)
  • compressed-token-program/cmint/update-metadata.mdx (1 hunks)
  • compressed-token-program/ctoken/SPL-to-ctoken-transfer.mdx (1 hunks)
  • compressed-token-program/ctoken/close-ctoken.mdx (1 hunks)
  • compressed-token-program/ctoken/compress-and-close.mdx (1 hunks)
  • compressed-token-program/ctoken/create-ata.mdx (1 hunks)
  • compressed-token-program/ctoken/create-ctoken.mdx (1 hunks)
  • compressed-token-program/ctoken/ctoken-to-spl-decompress.mdx (1 hunks)
  • compressed-token-program/ctoken/ctoken-transfer.mdx (1 hunks)
  • compressed-token-program/ctoken/mint-actions.mdx (1 hunks)
  • compressed-token-program/ctoken/mint-ctokens.mdx (1 hunks)
  • compressed-token-program/ctoken/program-create-ctoken.mdx (1 hunks)
  • compressed-token-program/overview.mdx (1 hunks)
  • docs.json (3 hunks)
  • snippets/compressible-vs-solana-rent.mdx (1 hunks)
  • snippets/ctoken-create-accounts-list.mdx (1 hunks)
🔇 Additional comments (9)
compressed-token-program/ctoken/create-ctoken.mdx (1)

42-42: Verify anchor link to c-token-program.mdx.

Line 42 references an anchor link #ctoken-accounts in the compressed-token-program overview. Confirm this heading exists in the target file with the correct ID format.

compressed-token-program/c-token-program.mdx (1)

7-7: Verify reusable snippet import.

Line 7 imports CompressibleVsSolanaRent snippet. Ensure this snippet file exists at /snippets/compressible-vs-solana-rent.mdx and is correctly integrated.

Also applies to: 45-45, 298-298

compressed-token-program/ctoken/ctoken-to-spl-decompress.mdx (1)

26-42: I'll help you verify the SDK imports and transaction pattern in this documentation file. Let me search the codebase to confirm the API paths and function signatures match the current SDK.
<function_calls>

find . -type f -name "*.rs" | grep -E "(transfer_interface|token_pool)" | head -20

</function_calls>
<function_calls>

find . -type f -name "lib.rs" | grep light_compressed_token_sdk | head -10

</function_calls>
<function_calls>

fd -t f ".rs$" | rg -l "light_compressed_token_sdk" | head -10

</function_calls>

Let me search for the SDK structure in the repository:
<function_calls>

fd -t d "light_compressed_token_sdk" | head -10

</function_calls>
<function_calls>

git ls-files | grep -i "transfer|token_pool" | head -20

</function_calls>

Now let me search for the TransferCtokenToSpl struct and related functions:
<function_calls>

rg -n "TransferCtokenToSpl" --type rs | head -20

</function_calls>
<function_calls>

rg -n "find_token_pool_pda_with_index" --type rs | head -20

</function_calls>

Let me also check for the SPL_TOKEN_PROGRAM_ID usage:
<function_calls>

rg -n "SPL_TOKEN_PROGRAM_ID" --type rs | head -20

</function_calls>

Let me search more broadly for ctoken-related files:
<function_calls>

git ls-files | grep -i ctoken | head -30

</function_calls>

<function_calls>

find . -name "Cargo.toml" | head -10

</function_calls>

<function_calls>

git ls-files | grep -E "(Cargo.toml|src/|lib.rs)" | grep -v node_modules | head -30

</function_calls>

Let me check the repository structure:
<function_calls>

ls -la

</function_calls>

<function_calls>

find . -maxdepth 3 -type f -name "*.mdx" | head -20

</function_calls>

<function_calls>

cat -n compressed-token-program/ctoken/ctoken-to-spl-decompress.mdx 2>/dev/null | head -60

</function_calls>

Now let me search the entire repository for the SDK module definitions:
<function_calls>

rg -n "mod transfer_interface|pub mod transfer_interface" --type rs

</function_calls>

<function_calls>

rg -n "struct TransferCtokenToSpl" --type rs -A 15

</function_calls>

<function_calls>

rg -n "fn find_token_pool_pda_with_index" --type rs -A 10

</function_calls>

Let me check if this is perhaps an external dependency by looking at Cargo.toml files:
<function_calls>

find . -name "Cargo.toml" -exec grep -l "light-compressed-token-sdk|light_compressed_token_sdk" {} ;

</function_calls>

<function_calls>

git log --oneline -1

</function_calls>

Let me check if light_compressed_token_sdk is defined in this repository or is an external crate:
<function_calls>

rg -n "^light_compressed_token_sdk|crate::.*transfer_interface" --type rs | head -20

</function_calls>

<function_calls>

find . -path "/light_compressed_token_sdk/" -o -path "/ctoken/" | grep -E ".(rs|toml)$" | head -30

</function_calls>

Let me search more directly in the compressed-token-program directory:
<function_calls>

find compressed-token-program -type f -name "*.rs" | head -20

</function_calls>

<function_calls>

cat compressed-token-program/Cargo.toml 2>/dev/null | head -50

</function_calls>

<function_calls>

ls -la compressed-token-program/ 2>/dev/null

</function_calls>

<function_calls>

find compressed-token-program -type f ( -name ".rs" -o -name ".toml" ) | head -30

</function_calls>

Let me look for SDK modules in a src directory:
<function_calls>

find . -type d -name "src" | head -10

</function_calls>

<function_calls>

rg -l "light_compressed_token_sdk::" --type rs | head -20

</function_calls>

Let me check if this is a monorepo with workspaces:
<function_calls>

cat Cargo.toml 2>/dev/null | grep -A 20 "[workspace]"

</function_calls>

<function_calls>

find . -maxdepth 2 -name "Cargo.toml" -exec echo "=== {} ===" ; -exec grep -E "^[package]|^name = " {} ;

</function_calls>

Let me search for any Rust SDK files that might define these types:
<function_calls>

find . -type f -name ".rs" -path "/sdk/*" | head -30

</function_calls>

<function_calls>

rg "TransferCtokenToSpl|find_token_pool_pda_with_index" -t rs -B 3 -A 5 | head -100

</function_calls>

Let me verify the documentation file itself to understand context better:
<function_calls>

cat compressed-token-program/ctoken/ctoken-to-spl-decompress.mdx 2>/dev/null

</function_calls>

Let me try a different approach - search for any references to these imports in the docs:
<function_calls>

find . -type f ( -name ".mdx" -o -name ".md" ) -exec grep -l "TransferCtokenToSpl|find_token_pool_pda_with_index" {} ;

</function_calls>

<function_calls>

find . -type f ( -name ".mdx" -o -name ".md" ) | head -20

</function_calls>

Let me check all documentation files to find references:
<function_calls>

rg "TransferCtokenToSpl" --type md --type mdx -B 2 -A 5

</function_calls>

Let me search for any external SDK reference or comments about API versions:
<function_calls>

rg "light-compressed-token-sdk|light_compressed_token_sdk" --type toml --type md --type mdx

</function_calls>

Let me verify if there's an SDK directory or if it's defined elsewhere:
<function_calls>

git ls-files | grep -E "sdk|lib" | grep -i rust | head -30

</function_calls>

<function_calls>

find . -type f -name "*.rs" | wc -l

</function_calls>

<function_calls>

find . -type f -name "*.rs" | head -50

</function_calls>

Let me search the first few Rust files:
<function_calls>

rg "ctoken|transfer_interface" --type rs -l | head -20

</function_calls>

Based on my investigation, let me try searching online for this SDK:
<function_calls>

light_compressed_token_sdk ctoken transfer_interface Rust crate

</function_calls>

<function_calls>

TransferCtokenToSpl light compressed token SDK instruction

</function_calls>

<function_calls>

find_token_pool_pda_with_index light_compressed_token_sdk

</function_calls>

compressed-token-program/ctoken/create-ata.mdx (1)

40-66: I'll verify the SDK API references mentioned in the documentation. Let me start by exploring the codebase structure and locating the SDK files.
<function_calls>

find . -type f -name "*.rs" | grep -E "(light_compressed_token|create_associated|ctoken)" | head -20

</function_calls>

Let me search more broadly for the SDK structure:
<function_calls>

git ls-files | grep -E "(Cargo.toml|lib.rs|create.*ata)" | head -30

</function_calls>

Let me try a different approach to understand the repository structure:
<function_calls>

ls -la

</function_calls>

Now let me search for files containing the create_associated_token_account functions:
<function_calls>

rg -l "create_associated_token_account|create_compressible_associated_token_account" --type rs | head -20

</function_calls>

Let me also check the documentation file itself and the surrounding context:
<function_calls>

cat -n compressed-token-program/ctoken/create-ata.mdx 2>/dev/null | head -110

</function_calls>

Let me find the documentation file:
<function_calls>

find . -name "create-ata.mdx" -o -name "*.mdx" | head -10

</function_calls>

Let me check the repository structure and locate relevant files:
<function_calls>

git ls-files | grep -E ".(rs|toml)$" | grep -i ctoken | head -20

</function_calls>

<function_calls>

rg "create_associated_token_account|create_compressible_associated_token_account" --type rs -A 5 | head -80

</function_calls>

<function_calls>

rg "CreateCompressibleAssociatedTokenAccountInputs" --type rs -B 2 -A 10 | head -80

</function_calls>

<function_calls>

rg "TokenDataVersion" --type rs -A 5 | head -50

</function_calls>

Let me try searching for Rust files in a more targeted way:
<function_calls>

find . -type f -name "*.rs" 2>/dev/null | wc -l

</function_calls>

<function_calls>

find . -type d -name "ctoken" 2>/dev/null

</function_calls>

<function_calls>

git ls-files | head -50

</function_calls>

Let me check all available files in the repo:
<function_calls>

git ls-files | wc -l && git ls-files | tail -50

</function_calls>

<function_calls>

git ls-files compressed-token-program/

</function_calls>

<function_calls>

cat compressed-token-program/ctoken/create-ata.mdx

</function_calls>

Perfect! Now I have the documentation file. Let me search for the SDK source code that implements these functions:
<function_calls>

rg "pub fn create_associated_token_account|pub fn create_compressible_associated_token_account" -A 10 --type rs

</function_calls>

<function_calls>

rg "struct CreateCompressibleAssociatedTokenAccountInputs|pub struct CreateCompressibleAssociatedTokenAccountInputs" -A 20 --type rs

</function_calls>

<function_calls>

rg "enum TokenDataVersion|pub enum TokenDataVersion" -A 10 --type rs

</function_calls>

Let me search more broadly for these APIs:
<function_calls>

rg "create_associated_token_account|CreateCompressibleAssociatedTokenAccountInputs|TokenDataVersion" --type rs | head -30

</function_calls>

Let me check if there are any Rust source files at all:
<function_calls>

find . -name "*.rs" -type f 2>/dev/null | head -20

</function_calls>

Let me check what files are in the repository:
<function_calls>

git ls-files | grep -v ".mdx$" | head -50

</function_calls>

<function_calls>

git ls-files

</function_calls>

I see this repository contains only documentation files. Let me search the web for the light_compressed_token_sdk API documentation to verify these APIs:
<function_calls>

light_compressed_token_sdk ctoken create_associated_token_account API reference

</function_calls>

<function_calls>

light compressed token SDK CreateCompressibleAssociatedTokenAccountInputs struct

</function_calls>

<function_calls>

"light_compressed_token_sdk" github rust crate

</function_calls>

<function_calls>

light protocol compressed tokens SDK Rust documentation

</function_calls>

Let me also check the mdx file more carefully for all API references across the full file:
<function_calls>

rg "create_associated_token_account|create_compressible_associated_token_account|TokenDataVersion|CreateCompressibleAssociatedTokenAccountInputs" compressed-token-program/ctoken/create-ata.mdx

</function_calls>

<function_calls>

grep -n "create_associated_token_account|create_compressible_associated_token_account|TokenDataVersion|CreateCompressibleAssociatedTokenAccountInputs" compressed-token-program/ctoken/create-ata.mdx

</function_calls>

Let me view the complete mdx file to get all context:
<function_calls>

wc -l compressed-token-program/ctoken/create-ata.mdx && cat compressed-token-program/ctoken/create-ata.mdx

</function_calls>

Based on my investigation:

  1. Repository structure: This is a documentation-only repository containing .mdx files. There are no Rust source files to verify against.

  2. SDK APIs referenced: The documentation references:

    • create_associated_token_account()
    • create_compressible_associated_token_account()
    • create_associated_token_account2()
    • create_compressible_associated_token_account2()
    • CreateCompressibleAssociatedTokenAccountInputs struct
    • TokenDataVersion::ShaFlat enum variant
  3. Web search results: I was unable to find detailed API documentation for light_compressed_token_sdk through web searches. The SDK appears to be part of the Light Protocol, but specific API references are not readily available in public documentation.

Since I cannot verify these APIs against the actual SDK source code or official API documentation, the review comment's request for verification remains valid but cannot be conclusively answered. The documentation could be accurate, but without access to the SDK implementation, I cannot confirm this.

The original review comment asking for API verification is appropriate and should remain.

compressed-token-program/ctoken/SPL-to-ctoken-transfer.mdx (1)

24-35: Let me search the local codebase more thoroughly to understand the project structure and find the actual transfer functions:
<function_calls>


#!/bin/bash

List the directory structure to understand the project layout

ls -la | head -30


</function_calls>
<function_calls>


#!/bin/bash

Find all Cargo.toml files and check workspace structure

find . -name "Cargo.toml" -type f -exec sh -c 'echo "=== {} ===" && head -30 {}' ; | head -150


</function_calls>
<function_calls>


#!/bin/bash

Search for any module or crate definitions related to transfer

rg -n "mod transfer|pub mod transfer|mod transfer2" --type rust


</function_calls>
<function_calls>


#!/bin/bash

Search for functions with "transfer" in their name

rg -n "fn.transfer.(" --type rust | head -30


</function_calls>
<function_calls>


#!/bin/bash

Check what documentation files exist in the project

find . -name ".mdx" -o -name ".md" | grep -i transfer | head -20


</function_calls>
<function_calls>


#!/bin/bash

Check the actual mdx file being reviewed

cat "compressed-token-program/ctoken/SPL-to-ctoken-transfer.mdx" 2>/dev/null | head -50


</function_calls>

snippets/ctoken-create-accounts-list.mdx (1)

1-65: Tooltip is a built-in Mintlify component—no import required.

This repository uses Mintlify (confirmed by $schema: "https://mintlify.com/docs.json" in docs.json). Tooltip is a standard global component provided by Mintlify and is automatically available in all MDX files without explicit imports. The snippet file is correct as-is.

compressed-token-program/ctoken/program-create-ctoken.mdx (1)

6-7: Snippet imports verified as correct.

Both imported snippets exist and are properly named:

  • ctoken-create-accounts-list.mdx exists at ./snippets/
  • compressible-vs-solana-rent.mdx exists at ./snippets/

Both files are in the correct MDX format and the import paths are accurately referenced.

compressed-token-program/cmint/cmint.mdx (1)

150-157: Now let me examine the specific file mentioned in the review to verify the exact content:
<function_calls>


#!/bin/bash

Read the cmint.mdx file around lines 150-157

sed -n '145,160p' compressed-token-program/cmint/cmint.mdx | cat -n


</function_calls>

Let me also check if there are any routing configuration files:
<function_calls>


#!/bin/bash

Look for routing or configuration files that might map old paths to new ones

find . -type f ( -name ".config." -o -name "route" -o -name "nav" -o -name "sidebar" -o -name "next.config.*" -o -name "mint.json" ) 2>/dev/null | head -20


</function_calls>

docs.json (1)

20-27: Introduction group refactor looks good.

The wrapping of intro pages into a dedicated "Introduction" group improves navigation hierarchy and clarity.

Comment on lines +58 to +62
### Create cMint with Token Metadata

*test*!
<CodeGroup>

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Remove placeholder/debug content.

Line 60 contains *test*! which appears to be debug or placeholder text. This should be removed or replaced with actual documentation content before merging.

 <Step>
 ### Create cMint with Token Metadata
 
-*test*!
 <CodeGroup>
📝 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
### Create cMint with Token Metadata
*test*!
<CodeGroup>
### Create cMint with Token Metadata
<CodeGroup>
🤖 Prompt for AI Agents
In compressed-token-program/cmint/cmint.mdx around lines 58 to 62, remove the
placeholder/debug text "*test*!" on line 60 and replace it with the intended
documentation content or delete the line entirely; ensure the surrounding
Markdown remains valid (update headings or example content as needed) so the
"Create cMint with Token Metadata" section contains real instructions or
examples instead of placeholder text.

Comment on lines +82 to +89
<Card
title=" Learn about all relevant actions to cMints"
icon="chevron-right"
color="#0066ff"
href="/compressed-token-program/cmint/update-metadata"
horizontal
>
</Card>
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

Fix self-referential link in Next Steps card.

The Next Steps card (line 86) links to itself (href="/compressed-token-program/cmint/update-metadata"), which is the current page. Update this href to point to a relevant related page, such as the comprehensive cMint actions guide or overview page based on your documentation structure.

🤖 Prompt for AI Agents
In compressed-token-program/cmint/update-metadata.mdx around lines 82 to 89, the
Next Steps Card's href points to the current page
("/compressed-token-program/cmint/update-metadata"); change the href to a
relevant related page (for example the cMint actions guide or overview) such as
"/compressed-token-program/cmint/actions" or "/compressed-token-program/cmint"
so the card navigates to a different, more useful resource.

Comment on lines +1 to +5
### CompressAndClose mode


The `Transfer2` instruction provides a `CompressAndClose` mode that compresses the full balance of a CToken account and closes it in a single transaction.

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Add frontmatter (title and description metadata) to this documentation file.

The file starts directly with ### CompressAndClose mode instead of including MDX frontmatter. All other documentation files in this PR include frontmatter with title and description metadata. This file needs frontmatter to be properly indexed and navigated in the documentation site.

Add frontmatter at the beginning of the file:

+---
+title: Compress and Close
+description: Use CompressAndClose mode to compress a cToken account and close it in a single transaction.
+---
+
 ### CompressAndClose mode

Alternatively, if this file is intended to be a subsection embedded within another document, clarify the organization in docs.json.

📝 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
### CompressAndClose mode
The `Transfer2` instruction provides a `CompressAndClose` mode that compresses the full balance of a CToken account and closes it in a single transaction.
---
title: Compress and Close
description: Use CompressAndClose mode to compress a cToken account and close it in a single transaction.
---
### CompressAndClose mode
The `Transfer2` instruction provides a `CompressAndClose` mode that compresses the full balance of a CToken account and closes it in a single transaction.
🤖 Prompt for AI Agents
In compressed-token-program/ctoken/compress-and-close.mdx around lines 1 to 5,
the file is missing MDX frontmatter (title and description) required by the docs
site; add a YAML frontmatter block at the very top containing a descriptive
title (e.g., "CompressAndClose") and a short description summarizing the page so
it matches other docs files and is indexable, or if this file is meant to be an
embedded subsection instead, update docs.json to reference it appropriately and
leave the file without frontmatter.

Comment on lines +1 to +42
---
title: Mint actions overview
description: Builder instructions for creating and managing compressed token accounts and transfers.
---

The CToken SDK provides builder instructions for managing compressed token accounts. These instructions follow a consistent builder pattern and handle account creation, minting, transfers, and conversions between compressed and SPL token formats.

## Account creation

### CreateCTokenAccount



### CreateAssociatedTokenAccount

### CreateAssociatedTokenAccount2


## Mint operations

### CreateCMint


### MintToCTokenTransfer

## Transfer operations

### CtokenTransfer


### SplToCtokenTransfer


### CtokenToSpl

### CtokenToSplTransferAndClose

## Account management

### Close Token Account

### CompressAndClose mode
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

File is mostly empty with placeholder section headings.

This file contains section headers for CreateCTokenAccount, CreateAssociatedTokenAccount, CreateCMint, and transfer/account management operations, but nearly all sections lack actual content. Either this should be populated with documentation and code examples, or it should be explicitly marked as a work-in-progress and tracked separately.

Consider adding:

  • Content for each section or removing empty sections
  • Code examples (TypeScript/Rust tabs as mentioned in test plan)
  • Usage guidance for each builder instruction

Alternatively, explicitly document this as incomplete/WIP if deferred to a later PR.

🤖 Prompt for AI Agents
compressed-token-program/ctoken/mint-actions.mdx lines 1-42: the file currently
contains only section headings and placeholder content; populate each documented
section (CreateCTokenAccount, CreateAssociatedTokenAccount,
CreateAssociatedTokenAccount2, CreateCMint, MintToCTokenTransfer,
CtokenTransfer, SplToCtokenTransfer, CtokenToSpl, CtokenToSplTransferAndClose,
Close Token Account, CompressAndClose mode) with concrete documentation and
examples or mark the file explicitly as WIP. For each section add a short
description, expected parameters, example usage snippets (TypeScript and/or Rust
as per project conventions), and any expected behavior or edge-cases; if you
cannot complete now, replace the placeholders with a brief WIP note and a
tracking issue/PR reference so reviewers know it’s intentionally incomplete.

Comment on lines +17 to +32
```rust
use light_compressed_token_sdk::compressed_token::mint_action::{
MintActionCompressedInstructionData,
MintToCTokenAction,
};

let instruction_data = MintActionCompressedInstructionData::new_mint(
input.compressed_mint_with_context.address,
input.compressed_mint_with_context.root_index,
compressed_proof,
input.compressed_mint_with_context.mint.clone(),
)
.with_mint_to_ctoken(MintToCTokenAction {
account_index: 0, // First account in remaining accounts
amount: 1_000_000,
});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, let's understand the repository structure and find SDK-related files
git ls-files | head -20

Repository: Lightprotocol/docs-v2

Length of output: 1036


🏁 Script executed:

# Search for light_compressed_token_sdk references
rg "light_compressed_token_sdk" -t rust -C 2 | head -50

Repository: Lightprotocol/docs-v2

Length of output: 213


🏁 Script executed:

# Look for the mint_action module specifically
fd "mint_action" -t rs

Repository: Lightprotocol/docs-v2

Length of output: 234


🏁 Script executed:

# Search for MintActionCompressedInstructionData type definition
rg "MintActionCompressedInstructionData" -t rust -C 3

Repository: Lightprotocol/docs-v2

Length of output: 213


🏁 Script executed:

# Search for MintToCTokenAction type definition
rg "MintToCTokenAction" -t rust -C 3

Repository: Lightprotocol/docs-v2

Length of output: 213


🏁 Script executed:

# Find Cargo.toml files to see SDK dependencies
find . -name "Cargo.toml" -type f

Repository: Lightprotocol/docs-v2

Length of output: 47


🏁 Script executed:

# Look for references to SDK version or source
rg "light_compressed_token_sdk" -C 3

Repository: Lightprotocol/docs-v2

Length of output: 3591


🏁 Script executed:

# Check if there's a context directory with program examples
ls -la .context/program-examples 2>/dev/null | head -20

Repository: Lightprotocol/docs-v2

Length of output: 171


🌐 Web query:

light_compressed_token_sdk compressed_token mint_action MintActionCompressedInstructionData

💡 Result:

I couldn't find an exact symbol named "MintActionCompressedInstructionData" in public sources, but the item you mention appears to be part of the Light Protocol / ZK Compression compressed-token program's instruction data for minting. Relevant references and where to look:

  • Light Protocol (ZK Compression) docs and TypeScript SDK info (compressed-token SDK, minting guides). [1].
  • Rust crate documentation for the light-compressed-token program (lists mint/process_mint modules and instruction structs used for minting/compressed-token operations). Use the process_mint and instruction modules there to inspect the concrete Rust types. [2].
  • Light Protocol GitHub (light-protocol) — source code for compressed-token, token pool / mint logic and SDKs (search the repo for "mint", "process_mint", or "InstructionData" to find the exact struct). [3].

If you want, I can:

  • Search the Light Protocol repo for the exact symbol name and return the source file and definition, or
  • Show the TypeScript / Rust code example for creating a compressed-token mint (createMint / mint_to) and where the instruction-data is assembled.

Which would you prefer?

Sources:

  1. Light Protocol — ZK Compression SDK docs. [https://lightprotocol.github.io/light-protocol/]. [1]
  2. docs.rs — light-compressed-token crate (process_mint, instruction types). [2]
  3. Light Protocol GitHub — light-protocol repository. [3]

🌐 Web query:

site:github.com/Lightprotocol/light-protocol "MintActionCompressedInstructionData"

💡 Result:

I couldn't find any results for that exact identifier on the Lightprotocol GitHub repo (site:github.com/Lightprotocol/light-protocol). Would you like me to:

  • search the entire web for "MintActionCompressedInstructionData", or
  • search the Lightprotocol organization/repos without the site: filter, or
  • search for similar names (e.g., MintAction, CompressedInstructionData) within that repo?

🌐 Web query:

site:github.com/Lightprotocol/light-protocol mint_action module compressed_token

💡 Result:

I searched the Lightprotocol GitHub. I found the main light-protocol repo and its compressed-token JS/typedoc artifacts, but I could not find any symbol or file named "mint_action" in that repository. (github.com)

If you want, I can:

  • search the repo tree for a specific file/path (please confirm), or
  • search other Lightprotocol repos (e.g., js packages) for "mint_action".

Citations:


🌐 Web query:

site:github.com/Lightprotocol/light-protocol "with_mint_to_ctoken"

💡 Result:

I searched the Lightprotocol GitHub repo for "with_mint_to_ctoken" and found no matches. (No results returned for site:github.com/Lightprotocol/light-protocol "with_mint_to_ctoken".)

Would you like me to:

  • broaden the search to all of GitHub or the whole web, or
  • search the Lightprotocol repo for related symbols (e.g., "mint_to_ctoken", "mintToCToken", "with_mint", "ctoken")?

🌐 Web query:

light_compressed_token_sdk crate crates.io rust

💡 Result:

I found the Rust docs for the crate and related Light/ZK Compression SDK pages:

  • Documentation (docs.rs) for light_compressed_token_sdk. [1]
  • ZK Compression / Light Protocol SDK overview (mentions the compressed-token tooling and Rust SDKs such as light-client / light-sdk). [2]

If you want the crates.io package page or latest version published, tell me and I’ll fetch the crates.io entry and current version for you.

Sources:
[1] https://docs.rs/light-compressed-token-sdk/latest/light_compressed_token_sdk/
[2] https://www.zkcompression.com/resources/sdks/client-development/


🌐 Web query:

"MintActionCompressedInstructionData" OR "MintToCTokenAction" rust

💡 Result:

I couldn't find any public references for "MintActionCompressedInstructionData" or "MintToCTokenAction" (Rust or otherwise) in web-searchable code or docs. Do you want me to:

  • search specific GitHub/org/repos you suspect (paste links or names), or
  • search private code you can upload, or
  • suggest likely places these names would appear (e.g., Solana compressed-instruction or token-minting crates) and search those?

🌐 Web query:

light_compressed_token_sdk mint_action new_mint with_mint_to_ctoken

💡 Result:

Short answer — yes: the Light Protocol compressed-token TypeScript SDK exposes mint-related helpers (createMint / token pool registration and compressed mints) and functions to mint tokens into compressed accounts. See the SDK package and docs here for the exact API and examples: [1][2]. For sending/minting compressed tokens you typically use the compressed-token client (e.g. createMint / createTokenPool then mint/compress/mintTo flows) together with the stateless RPC; an example flow and transfer/mint helpers are shown in the implementation guide. [2][3]

Minimal example (TypeScript, illustrative — adapt imports/keys/params from your app):

  • create/register an SPL mint + token pool:
    const { mint } = await createMint(rpc, payer, mintAuthority.publicKey, decimals); // from @lightprotocol/compressed-token. [2]
  • mint to compressed token accounts / collection (use compressed-token mint helpers / mintTo equivalents):
    // use compressed-token mint / mintTo helpers and stateless RPC; sample helper usage shown in docs/guides. [2][3]

References

  1. @lightprotocol/compressed-token (npm) — package and README.
  2. Light Protocol compressed-token guides / API docs (createMint, createTokenPool, examples).
  3. ZK Compression / compressed-tokens implementation guide (mint/transfer examples).

🌐 Web query:

site:docs.rs light_compressed_token_sdk mint

💡 Result:

I found these relevant docs.rs pages for "light_compressed_token_sdk" and related "mint" items:

  1. light_compressed_token_sdk crate index. [1]
  2. light_compressed_token::light_compressed_token module (includes mint_to description). [2]
  3. light_compressed_token crate overview and process_mint items (create_mint_to_instruction, process_mint::mint_spl_to_pool_pda). [3]
  4. Complete list of items in light_compressed_token (includes MintToInstruction and SDK helpers). [4]

Sources:
[1] docs.rs/light_compressed_token_sdk.
[2] docs.rs/light_compressed_token::light_compressed_token (mint_to).
[3] docs.rs/light_compressed_token (process_mint).
[4] docs.rs/light_compressed_token::all (item list).


🌐 Web query:

site:docs.rs light_compressed_token_sdk compressed_token

💡 Result:

I couldn't find any docs.rs pages matching "light_compressed_token_sdk" or "compressed_token". Try searching crates.io or the project's GitHub instead — e.g. crates/pypi/GitHub results for related "LightCompress"/token-compression tools. (pypi.org)

Citations:


🌐 Web query:

site:docs.rs/light-compressed-token-sdk mint_action

💡 Result:

No matches for an item named "mint_action" in the light_compressed_token_sdk docs on docs.rs. The SDK crate page shows no documented items (0% documented). [1]

Related symbols in the Light compressed-token ecosystem you may find useful: the light_compressed_token crate exposes a mint_to instruction and process_mint helpers (e.g., create_mint_to_instruction). [2]

Sources:
[1] docs.rs — light_compressed_token_sdk crate page. (docs.rs)
[2] docs.rs — light_compressed_token (includes mint_to and process_mint items). (docs.rs)

Citations:


The SDK API references in the code example cannot be verified in current published versions and appear to be incorrect.

The example uses imports and method signatures that do not exist in the published light_compressed_token_sdk crate:

  • MintActionCompressedInstructionData — not found in any public docs or source
  • MintToCTokenAction — not found in any public docs or source
  • .new_mint() method — not found
  • .with_mint_to_ctoken() method — not found
  • mint_action module — does not exist in light_compressed_token_sdk (crate shows 0% documented)

The related crate light_compressed_token contains different types like MintToInstruction and helpers in process_mint, suggesting the module path or API design may be incorrect. Verify the actual SDK version in use and cross-reference with either the correct crate documentation or the Light Protocol GitHub repository to provide accurate code examples.

🤖 Prompt for AI Agents
In compressed-token-program/ctoken/mint-ctokens.mdx around lines 17 to 32, the
example uses non‑existent SDK types and methods
(MintActionCompressedInstructionData, MintToCTokenAction, .new_mint(),
.with_mint_to_ctoken(), and mint_action module); verify the exact
light_compressed_token_sdk crate and version in Cargo.toml, open its docs or
GitHub source (or use cargo doc/cargo tree) to find the correct module path and
types (or switch to light_compressed_token equivalents such as
MintToInstruction/process_mint if that is the correct crate), then update the
imports and the example call to use the real API names and signatures, adjust
parameters to match the actual constructor/helper function, and confirm the
example compiles against the specified crate version before committing.

Comment on lines +49 to +57
## Next Steps

<Card
title="Create compressed token accounts"
icon="chevron-right"
color="#0066ff"
href="/compressed-token-program/compressed-tokens/basic-guides/how-to-create-compressed-token-accounts"
horizontal
/> No newline at end of file
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:

#!/bin/bash
# Search for documentation files related to creating compressed token accounts
# and explore the documentation structure under compressed-token-program

# First, find all mdx/md files in the repository
echo "=== Searching for files matching 'create' and 'token' ==="
fd -e mdx -e md | grep -E "compressed|token" | sort

echo ""
echo "=== Specifically looking for 'create.*account' patterns ==="
fd -e mdx -e md | grep -iE "create.*account|account.*create" | head -20

Repository: Lightprotocol/docs-v2

Length of output: 14809


🏁 Script executed:

#!/bin/bash
# Read the overview.mdx file to see the current state
echo "=== Content of compressed-token-program/overview.mdx ==="
cat -n compressed-token-program/overview.mdx

echo ""
echo "=== Checking for any create-ctoken related files ==="
fd -e mdx "create.*ctoken|ctoken.*create" compressed-token-program/

echo ""
echo "=== Checking the ctoken directory structure ==="
fd -e mdx compressed-token-program/ctoken/

Repository: Lightprotocol/docs-v2

Length of output: 2383


🏁 Script executed:

#!/bin/bash
# Let's check the contents of the ctoken creation files to understand their purpose
echo "=== Content of compressed-token-program/ctoken/create-ctoken.mdx (first 30 lines) ==="
head -30 compressed-token-program/ctoken/create-ctoken.mdx

echo ""
echo "=== Content of compressed-token-program/ctoken/program-create-ctoken.mdx (first 30 lines) ==="
head -30 compressed-token-program/ctoken/program-create-ctoken.mdx

echo ""
echo "=== Checking the old compressed-tokens file ==="
head -30 compressed-tokens/guides/how-to-create-compressed-token-accounts.mdx

echo ""
echo "=== List all files in compressed-token-program/ctoken/ ==="
fd . compressed-token-program/ctoken/ --type f

Repository: Lightprotocol/docs-v2

Length of output: 4279


Update the href to reference the correct documentation page in the new namespace.

The href path on line 55 is broken: /compressed-token-program/compressed-tokens/basic-guides/how-to-create-compressed-token-accounts does not exist.

Based on the new documentation structure in the PR, this should be updated to /compressed-token-program/ctoken/create-ctoken, which is the page for creating cToken accounts with the compressible extension in the new namespace.

🤖 Prompt for AI Agents
In compressed-token-program/overview.mdx around lines 49 to 57, the Card
component's href points to a removed path
(/compressed-token-program/compressed-tokens/basic-guides/how-to-create-compressed-token-accounts);
update the href to the new documentation path
/compressed-token-program/ctoken/create-ctoken so the "Create compressed token
accounts" card links to the correct page in the new namespace.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
snippets/ctoken-create-accounts-list-client.mdx (1)

8-15: Add labels to empty header cells for accessibility.

The first two header cells (lines 10-11) are empty, which may confuse screen readers or reduce clarity. Consider adding descriptive headers like "Index" and "Account Name".

  <thead>
    <tr>
-      <th style={{textAlign: 'left'}}></th>
-      <th style={{textAlign: 'left'}}></th>
+      <th style={{textAlign: 'left'}}>Index</th>
+      <th style={{textAlign: 'left'}}>Account</th>
       <th style={{textAlign: 'left'}}>Constraints</th>
       <th style={{textAlign: 'left'}}>Description</th>
    </tr>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 31a63a7 and c8e26d8.

📒 Files selected for processing (3)
  • compressed-token-program/ctoken/program-create-ctoken.mdx (1 hunks)
  • snippets/ctoken-create-accounts-list-client.mdx (1 hunks)
  • snippets/ctoken-protocol-pdas.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • snippets/ctoken-protocol-pdas.mdx
🔇 Additional comments (6)
snippets/ctoken-create-accounts-list-client.mdx (2)

43-43: I'll help you verify the concerns about the Tooltip component availability and the Solscan links. Let me start by investigating the codebase.
<function_calls>

#!/bin/bash

Search for Tooltip component definition and exports

echo "=== Searching for Tooltip component definition ==="
rg -n "export\s+(const|function|default)\s+Tooltip" --type=tsx --type=ts --type=jsx

echo ""
echo "=== Searching for Tooltip component usage in various file types ==="
rg -n "<Tooltip" --type=mdx --type=jsx --type=tsx --type=ts -A2 -B2 | head -40


</function_calls>
<function_calls>

#!/bin/bash

Check the MDX file under review

echo "=== Content of the MDX file under review ==="
cat -n snippets/ctoken-create-accounts-list-client.mdx | head -70

echo ""
echo "=== Searching for imports and component sources in the file ==="
head -20 snippets/ctoken-create-accounts-list-client.mdx


</function_calls>
<function_calls>

#!/bin/bash

Find all Tooltip occurrences and check context

echo "=== All Tooltip usages in the project ==="
rg -n "Tooltip" --type=mdx --type=tsx --type=ts --type=jsx -C3

echo ""
echo "=== Search for component providers or configuration ==="
rg -n "Tooltip" --type=mdx | wc -l


</function_calls>

Now let me verify the Solana program IDs:
<function_calls>

Solana System Program address 11111111111111111111111111111111

</function_calls>
<function_calls>

cTokenpN6n8uj2gwJJszLDaeMpJt6aVqGbPWLJbvTFg2 Solana program verification

</function_calls>


16-73: I'll help you verify the cToken account list documentation. Let me search for cToken program IDL files and specifications in the repository.
<function_calls>

#!/bin/bash

Description: Search for cToken program IDL, specification, or related program documentation files

Look for IDL and JSON files that might contain cToken program specifications

echo "=== Searching for IDL and JSON files related to cToken ==="
fd -e json -e idl | grep -i ctoken | head -20

echo -e "\n=== Searching for markdown files with cToken references ==="
fd -e md -e mdx | head -30 | xargs grep -l "cToken|Rent Sponsor|create-accounts" 2>/dev/null | head -20

echo -e "\n=== General search for IDL files in the repo ==="
fd -e idl -o -e json | head -20


</function_calls>

Let me also search more broadly for program-related files and documentation:
<function_calls>

#!/bin/bash

Description: Broader search for cToken program documentation and type definitions

echo "=== Search for files containing 'Rent Sponsor' ==="
rg -i "Rent Sponsor" --type md --type mdx -n | head -30

echo -e "\n=== Search for files containing 'Compressible Config' ==="
rg -i "Compressible Config" --type md --type mdx -n | head -30

echo -e "\n=== Search for 'invoke_signed' references ==="
rg -i "invoke_signed" --type md --type mdx -n | head -20

echo -e "\n=== Repository structure overview ==="
git ls-files | grep -E "(program|spec|idl|account)" | head -30


</function_calls>

<function_calls>

#!/bin/bash

Description: Search for documentation files and program references

echo "=== List all markdown/mdx documentation files ==="
fd -e md -o -e mdx | sort | head -50

echo -e "\n=== Search for files referencing LightRegistry ==="
rg -i "LightRegistry" -n --type md --type mdx | head -20


</function_calls>

compressed-token-program/ctoken/program-create-ctoken.mdx (4)

162-275: Program-side implementation is well-structured with proper error handling and documentation.

The full code example provides clear, comprehensive Rust implementations for both invoke() and invoke_signed() paths. Inline comments document account order, PDA derivation, and verification steps. Error handling for insufficient account keys is present in both handlers. The account cloning pattern is consistent.


278-442: Client-side implementation covers invoke and invoke_signed with good discriminator documentation.

The Rust client section clearly delineates the two account-ownership scenarios with discriminator values (2u8 and 3u8). Dependencies are specified with versions. The code example demonstrates proper account derivation for PDA-owned accounts and instruction construction. Discriminator highlighting in code snippets aids clarity.


452-454: TypeScript client implementation is marked incomplete.

The TypeScript tab contains only a "Coming soon" placeholder. Clarify the intended timeline for TypeScript implementation, or consider moving this tab to a dedicated future roadmap section.

Is the TypeScript implementation scheduled? If so, consider creating a tracking issue or noting the expected completion timeline in the documentation.


1-9: All imported snippets are present and correctly named.

Verification confirms that all four reusable snippets referenced in lines 6-9 exist in the /snippets/ directory with the exact names specified:

  • ctoken-create-accounts-list.mdx
  • ctoken-create-accounts-list-client.mdx
  • ctoken-protocol-pdas.mdx
  • compressible-vs-solana-rent.mdx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs.json (1)

467-552: Perfect! The verification confirms the review comment is accurate and actually understates the severity. The actual files prove that the Docs tab (Tab 1) has correct paths while the cToken Program tab (Tab 2) has multiple incorrect paths that will cause 404 errors.

Critical path errors in the "cToken Program" tab cause broken documentation links.

The second "cToken Program" tab references incorrect page paths that don't match the actual file structure:

Confirmed mismatches:

  • Actual file: compressed-token-program/cmint/client-guides/cmint.mdx

    • Docs tab (correct): compressed-token-program/cmint/client-guides/cmint
    • cToken Program tab (broken): compressed-token-program/cmint/cmint
  • Actual file: compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx

    • Docs tab (correct): compressed-token-program/ctoken/program-guides/program-create-ctoken
    • cToken Program tab (broken): compressed-token-program/ctoken/program-guides/create-ctoken
  • Actual file: compressed-token-program/ctoken/program-guides/program-mint-to-cToken.mdx

    • Docs tab (correct): compressed-token-program/ctoken/program-guides/program-mint-to-cToken
    • cToken Program tab (broken): compressed-token-program/ctoken/program-guides/mint-ctokens

The cToken Program tab's cmint, and ctoken program-guides sections all reference non-existent paths. Replace them with the paths used in the Docs tab, which correctly match the actual file structure.

♻️ Duplicate comments (1)
compressed-token-program/cmint/client-guides/cmint.mdx (1)

60-60: Remove placeholder text before merge.

Line 60 contains *test*! which appears to be debug or placeholder content. This must be removed or replaced with actual documentation before this PR can be merged.

 <Step>
 ### Create cMint with Token Metadata

-*test*!
 <CodeGroup>

If this line was meant to introduce the code examples below, consider replacing it with brief instructional text like "Here's how to create a cMint with token metadata:" or similar.

🧹 Nitpick comments (3)
compressed-token-program/ctoken/client-guides/client-mint-to-ctoken.mdx (1)

99-101: TypeScript implementation noted as TODO.

The TypeScript tab contains only a TODO comment. While acceptable for an initial PR, ensure this is tracked and completed in a follow-up PR to maintain feature parity with the Rust implementation.

Would you like me to help you generate the TypeScript implementation for minting to cToken? I can create a parallel implementation to the Rust version once the TypeScript SDK is available.

compressed-token-program/ctoken/client-guides/client-create-cmint.mdx (1)

86-88: TypeScript implementation tracked as TODO.

The TypeScript tab contains a TODO comment. Ensure this is tracked separately to maintain SDK feature parity and provide TypeScript users with complete documentation.

Once the TypeScript SDK is available, I can help implement the parallel TypeScript version of the Rust create_compressed_mint function.

compressed-token-program/ctoken/client-guides/client-create-cATA.mdx (1)

50-54: Incomplete TypeScript implementation.

The TypeScript example includes only a TODO placeholder. Verify whether this is intentional (to be addressed in a separate commit) or should be completed as part of this PR.

If you'd like, I can help generate the TypeScript equivalent of the Rust implementation. Would you like me to do that?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d568ef and 1b85245.

📒 Files selected for processing (16)
  • compressed-token-program/c-token-program.mdx (1 hunks)
  • compressed-token-program/cmint/client-guides/cmint.mdx (1 hunks)
  • compressed-token-program/cmint/client-guides/update-metadata.mdx (1 hunks)
  • compressed-token-program/cmint/program-guides/program-create-cmint.mdx (1 hunks)
  • compressed-token-program/ctoken/client-guides/client-create-cATA.mdx (1 hunks)
  • compressed-token-program/ctoken/client-guides/client-create-cmint.mdx (1 hunks)
  • compressed-token-program/ctoken/client-guides/client-create-ctoken.mdx (1 hunks)
  • compressed-token-program/ctoken/client-guides/client-mint-to-ctoken.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-create-cATA.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-mint-to-cToken.mdx (1 hunks)
  • compressed-tokens/README.mdx (1 hunks)
  • docs.json (3 hunks)
  • snippets/cmint-system-accounts-list.mdx (1 hunks)
  • snippets/compressible-vs-solana-rent.mdx (1 hunks)
  • snippets/ctoken-create-ata-accounts-list.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • snippets/cmint-system-accounts-list.mdx
  • compressed-token-program/ctoken/program-guides/program-mint-to-cToken.mdx
  • compressed-token-program/cmint/client-guides/update-metadata.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • compressed-token-program/c-token-program.mdx
🔇 Additional comments (15)
compressed-token-program/cmint/client-guides/cmint.mdx (3)

63-99: TypeScript code example is clear and complete.

The TypeScript code demonstrates cMint creation with token metadata, showing proper use of the SDK. The example includes error handling, airdrop funding, and clear console output. Well-structured for a learning guide.


102-132: Rust code example demonstrates metadata setup well.

The Rust code shows proper deserialization and metadata construction with additional_metadata support. However, this example is incomplete—it lacks the RPC call to send the transaction. Consider whether this is intentional (pointing to a more complete example elsewhere) or if it should be a full, executable example like the TypeScript version.

Verify whether this Rust example should include a transaction submission step or if it's intentionally a partial code snippet.


38-38: Link verification successful — no issues found.

The internal link on line 38 is valid. The target file compressed-token-program/c-token-program.mdx exists, and it contains the heading "# cMint Accounts" which generates the anchor #cmint-accounts. The link path and anchor are correctly configured.

compressed-token-program/ctoken/client-guides/client-mint-to-ctoken.mdx (1)

9-94: Rust example is comprehensive and follows SDK patterns well.

The code demonstrates the complete minting flow: account retrieval, deserialization, proof generation, parameter construction, and transaction submission. The error handling with .unwrap() is acceptable for a documentation example. Output formatting is helpful for understanding results.

compressed-token-program/ctoken/client-guides/client-create-ctoken.mdx (2)

50-116: Full Rust example is comprehensive and well-commented.

The implementation properly demonstrates:

  • Keypair generation for the new account
  • Instruction data structure construction
  • PDA derivation for config and rent sponsor
  • Account list assembly in correct order (matches expectations)
  • Transaction signing with multiple signers (payer and new account)
  • Clear output for verification

This is a solid, production-ready example for documentation purposes.


39-39: Link to cMint creation guide is valid and correctly references an existing file.

The file client-create-cmint.mdx exists at compressed-token-program/ctoken/client-guides/ and is discoverable. The link path /compressed-token-program/ctoken/client-guides/client-create-cmint is correct.

snippets/compressible-vs-solana-rent.mdx (1)

1-141: Rent model documentation is clear and well-structured.

The explanation of compressible account rent mechanics is comprehensive, covering initial top-up, per-transaction updates, and account closing scenarios. Tables effectively present complex financial concepts with concrete examples (260-byte account, SPL comparison). However, verify that the rent constants and calculations reflect the current protocol specification.

Please confirm that the following values are current in the protocol:

  • 388 lamports per epoch for 260-byte accounts (line 9)
  • 2-epoch minimum for compressible accounts (line 3)
  • 12,600 slots per 2 epochs (line 3)
  • 11,000 lamports compression incentive (line 137)
  • 5,000-10,000 lamports standard transaction fees (line 40)
compressed-token-program/cmint/program-guides/program-create-cmint.mdx (3)

206-468: Full code examples are comprehensive and well-documented.

The three handler functions cover all major CPI scenarios:

  1. External signer (invoke)
  2. Single PDA signer (invoke_signed)
  3. Dual PDA signer (invoke_signed)

Each includes clear account ordering comments and proper error handling. The code is well-structured for learning and reference. Account count validation, PDA derivation, and seed handling all follow correct Solana patterns.


202-203: GitHub source code link is accessible and valid.

The link resolves with HTTP status 200, confirming that the GitHub source file at https://github.com/Lightprotocol/light-protocol/blob/main/sdk-tests/sdk-ctoken-test/src/create_token_account.rs is currently accessible and maintained.


404-404: Cannot verify MINT_AUTHORITY_SEED definition—this is a documentation repository without actual source code.

The file compressed-token-program/cmint/program-guides/program-create-cmint.mdx is a code example in a documentation repository (Lightprotocol/docs-v2). The actual compressed-token-program source code is maintained in a separate repository and is not included here. Verification of whether MINT_AUTHORITY_SEED is genuinely defined in the mint_to_ctoken module requires access to the actual program source repository.

compressed-token-program/ctoken/client-guides/client-create-cmint.mdx (1)

9-81: Rust implementation is complete and demonstrates end-to-end cMint creation well.

The code shows the proper sequence for client-side cMint creation: keypair generation, tree information retrieval, address derivation, proof generation, parameter construction, and transaction submission. The function returns both the SPL mint PDA and the compression address, which is helpful for subsequent operations. Error handling via .unwrap() is acceptable for documentation purposes.

compressed-tokens/README.mdx (1)

62-62: I encountered a repository access issue and cannot clone the codebase to verify the link path. Without direct access to the documentation structure, I cannot definitively confirm whether /compressed-token-program/ctoken/ctoken is:

  1. A valid path to an actual documentation page
  2. A typo that should be /compressed-token-program/ctoken or another path

Manual verification is needed to confirm the correct internal link path.

You should:

  • Check if the file at /compressed-token-program/ctoken/ctoken.mdx (or similar) exists in the repository
  • Verify the actual documentation structure under compressed-token-program/
  • Confirm whether the double ctoken/ctoken segment is intentional or a typo
snippets/ctoken-create-ata-accounts-list.mdx (1)

1-77: Excellent! I have completed the verification of the account ordering and Tooltip references. Let me document my findings:

Verification Results:

  1. Account Ordering (0-6): ✅ VERIFIED CORRECT

    • Cross-referenced with program-guides/program-create-cATA.mdx
    • The code explicitly shows: accounts[0]: owner, accounts[1]: mint, accounts[2]: payer, accounts[3]: associated_token_account, accounts[4]: system_program
    • Followed by accounts[5]: compressible_config and accounts[6]: rent_sponsor in CompressibleParamsInfos
    • Matches the CreateAssociatedTokenAccount2Infos struct implementation exactly
  2. System Program ID: ✅ CORRECT

    • 11111111111111111111111111111111 is the standard Solana System Program ID
    • Solscan link is valid and works
  3. Tooltip References: ✅ ACCURATE

    • All descriptions align with program documentation
    • References are consistent across all account list snippets

Account List Table Structure and Content

The table accurately documents cToken ATA account requirements with correct ordering, constraints, and descriptions. All account indices (0-6) match the program implementation confirmed in the program-guides/program-create-cATA.mdx guide, which explicitly shows the CreateAssociatedTokenAccount2Infos struct using accounts in this exact sequence. System Program ID and Tooltip references are accurate and consistent throughout the documentation.

docs.json (1)

89-131: Verify path consistency for Compressed Token nested groups.

Lines 113-115 (Integration group) and 121-125 (Examples group) reference paths under compressed-token-program/compressed-tokens/advanced-guides/, while the Basic Guides (lines 95-104) use compressed-tokens/basic-guides/. This mixed namespace (some with compressed-token-program/ prefix, some without) is inconsistent. Confirm all paths match actual file locations.

compressed-token-program/ctoken/program-guides/program-create-cATA.mdx (1)

89-95: The builder type naming is correct and represents distinct SDK patterns—no standardization needed.

The verification confirms that CreateAssociatedTokenAccount2Infos is used exclusively in program-create-cATA.mdx (5 occurrences) for Associated Token Account creation, while CreateCTokenAccountInfos is used exclusively in program-create-ctoken.mdx (5 occurrences) for CToken Account creation. These type names are intentionally different because they represent distinct SDK patterns for different account creation operations. No inconsistency or standardization issue exists.

Comment on lines +30 to +37
### Dependencies

```toml
[dependencies]
light-compressed-token-sdk = "0.1.0"
solana-program = "2.2"
borsh = "0.10.0"
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch light-compressed-token-sdk package info from crates.io
curl -s https://crates.io/api/v1/crates/light-compressed-token-sdk | jq '.crate | {newest_version, max_version, max_stable_version, name, description}'

Repository: Lightprotocol/docs-v2

Length of output: 186


🌐 Web query:

light-compressed-token-sdk crates.io latest version

💡 Result:

I couldn't find a crate named exactly "light-compressed-token-sdk" on crates.io. Closest matches:

  • crate "light-compressed-token" — latest listed version referenced as 2.0.0. [1]
  • crate "light-sdk" (Light Protocol SDK) — latest listed version 0.13.0. [2][3]

If you meant a different exact crate name, tell me the exact spelling and I’ll fetch the current crates.io page.

Sources:
[1] lib.rs feature page for light-compressed-token (shows version 2.0.0).
[2] lib.rs page for light-sdk (shows version 0.13.0).
[3] Light Protocol docs / changelog references.


🏁 Script executed:

#!/bin/bash
# Search for Cargo.toml files that might reference the token SDK
find . -name "Cargo.toml" -type f | head -20

Repository: Lightprotocol/docs-v2

Length of output: 47


🌐 Web query:

light-compressed-token-sdk GitHub Lightprotocol

💡 Result:

Here are the main Light Protocol resources for the light-compressed-token SDK:

  1. Light Protocol GitHub (core repo, includes light_compressed_token program and links to SDKs). [1]
  2. @lightprotocol/compressed-token npm package (JavaScript SDK for the compressed-token program). [2]
  3. API docs / TypeScript SDK docs for ZK Compression (includes stateless.js and compressed-token). [3]

Sources:
[1] https://github.com/Lightprotocol/light-protocol
[2] https://www.npmjs.com/package/%40lightprotocol%2Fcompressed-token
[3] https://lightprotocol.github.io/light-protocol/index.html


🌐 Web query:

site:github.com/Lightprotocol light-compressed-token-sdk Cargo.toml Rust

💡 Result:

I couldn't find a repository named "light-compressed-token-sdk" under the Lightprotocol GitHub organization. Relevant matches:

  • The Lightprotocol main repo references a library named light_compressed_token (part of the light-protocol monorepo). [1]
  • The program-examples list of Rust crates for Lightprotocol (light-sdk, light-client, etc.) but does not show a separate "light-compressed-token-sdk" crate. [2]

Sources:
[1] Lightprotocol/light-protocol (GitHub).
[2] Lightprotocol/program-examples (GitHub).


The dependency package name and/or version appears to be incorrect and cannot be resolved.

Line 34 specifies light-compressed-token-sdk = "0.1.0", but this package does not exist on crates.io or in the Light Protocol GitHub organization. Web searches found:

  • No "light-compressed-token-sdk" crate published on crates.io
  • Closest match: "light-compressed-token" crate (version 2.0.0)
  • Light Protocol SDK packages use different names (light-sdk, light-client, etc.)

This breaks the example as developers cannot resolve this dependency. Verify the correct package name and current version with the Light Protocol maintainers and update accordingly.

🤖 Prompt for AI Agents
In compressed-token-program/cmint/program-guides/program-create-cmint.mdx around
lines 30–37 the dependency declaration uses a non-existent crate
"light-compressed-token-sdk = \"0.1.0\""; update the dependency to the correct
crate name and version (e.g., replace with "light-compressed-token = \"2.0.0\""
or the official Light Protocol SDK crate name/version provided by the
maintainers), confirm the exact package name with the Light Protocol repo or
maintainers, update the toml block accordingly, and verify by running cargo
fetch/build to ensure the dependency resolves.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (1)

6-8: Missing snippet import blocks build; two additional snippet imports are unused.

Lines 7-8 import CTokenProtocolPDAs from /snippets/ctoken-protocol-pdas.mdx (which does not exist) and CompressibleVsSolanaRent, neither of which is rendered anywhere in the document. Only CTokenCreateAccountsList (line 6) is actually used (line 105).

The missing ctoken-protocol-pdas.mdx is a build blocker; the unused imports suggest incomplete documentation or leftover template code.

Action required:

  1. Either create the missing /snippets/ctoken-protocol-pdas.mdx file or update line 7 to import an existing snippet.
  2. Remove the unused imports on lines 7–8 if they are not needed, or integrate them into the document where appropriate (e.g., render <CTokenProtocolPDAs /> and <CompressibleVsSolanaRent /> in relevant sections such as the rent configuration step or key points).
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b85245 and b4592c1.

📒 Files selected for processing (2)
  • compressed-token-program/ctoken/program-guides/program-create-cATA.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • compressed-token-program/ctoken/program-guides/program-create-cATA.mdx
🔇 Additional comments (1)
compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (1)

36-41: Code examples are well-structured and properly documented.

The Rust code examples demonstrate correct usage of the invoke() and invoke_signed() patterns with:

  • Proper account validation (NotEnoughAccountKeys check)
  • PDA derivation and verification in invoke_signed
  • Inline comments explaining each step
  • Consistent account ordering and error handling

Also applies to: 45-52, 62-69, 115-125, 130-156, 167-274

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
compressed-token-program/ctoken/program-guides/program-mint-to-cToken.mdx (1)

247-260: Align mint_authority in params with the derived PDA (or assert equality).

In process_mint_to_ctoken_invoke_signed, you derive and verify the PDA (pda) against accounts[2], but MintToCTokenParams::new still receives data.mint_authority. That leaves room for a mismatch between the authority encoded in instruction data and the actual PDA signer.

Consider either asserting equality or passing the PDA directly to the params:

     let (pda, bump) = Pubkey::find_program_address(&[MINT_AUTHORITY_SEED], &ID);

     // Verify the authority account is the PDA
     if &pda != accounts[2].key {
         return Err(ProgramError::InvalidSeeds);
     }

+    // Optional: ensure instruction data matches the derived PDA
+    if data.mint_authority != pda {
+        return Err(ProgramError::InvalidArgument);
+    }
+
-    let params = MintToCTokenParams::new(
-        data.compressed_mint_inputs,
-        data.amount,
-        data.mint_authority,
-        data.proof,
-    );
+    let params = MintToCTokenParams::new(
+        data.compressed_mint_inputs,
+        data.amount,
+        pda,
+        data.proof,
+    );

This keeps the example robust if readers copy it into production programs.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b4592c1 and f3153ca.

📒 Files selected for processing (13)
  • compressed-token-program/cmint/program-guides/program-create-cmint.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-close-ctoken.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-create-cATA.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-mint-to-cToken.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-transfer-ctoken.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-transfer-interface.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-transfer-spl-ctoken.mdx (1 hunks)
  • docs.json (3 hunks)
  • rent.mdx (1 hunks)
  • snippets/ctoken-create-accounts-list.mdx (1 hunks)
  • snippets/rent-calculator.jsx (1 hunks)
  • snippets/solana-rent-calculator.jsx (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • compressed-token-program/ctoken/program-guides/program-create-cATA.mdx
  • rent.mdx
  • compressed-token-program/ctoken/program-guides/program-transfer-spl-ctoken.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • snippets/ctoken-create-accounts-list.mdx
  • compressed-token-program/cmint/program-guides/program-create-cmint.mdx
🔇 Additional comments (8)
compressed-token-program/ctoken/program-guides/program-close-ctoken.mdx (5)

1-16: Well-structured documentation with clear overview. The frontmatter, Key Points section, and introductory callouts effectively set context and guide readers to relevant resources. The MDX structure is clean.


34-68: Code tabs clearly demonstrate both invocation patterns. The invoke() and invoke_signed() examples show the correct usage of CloseAccountInfos with appropriate comments indicating optional rent_sponsor handling. Both patterns are concise and well-aligned with the full code example.


79-155: Full code example is well-commented and implements proper error handling. Account structure, PDA derivation, and seed construction follow standard Solana patterns. The PDA verification at line 133 correctly checks &pda != accounts[3].key, and rent_sponsor optionality is properly handled in both handler functions.

Please verify that:

  1. The CloseAccountInfos struct and invoke/invoke_signed methods match the current light_compressed_token_sdk API.
  2. The PDA seed construction and signing pattern (line 143: &[TOKEN_ACCOUNT_SEED, &[bump]]) aligns with your project's conventions.

You can confirm this by searching the codebase for existing invoke_signed examples or checking the SDK's latest documentation.


15-15: Verify internal and external links are accessible. The documentation references:

  • Line 15: /compressed-token-program/c-token-program
  • Line 76: External GitHub link to light-protocol repository
  • Line 163: /compressed-token-program/ctoken/program-guides/program-transfer-spl-ctoken

Ensure all internal paths exist in the docs structure and that the external link is publicly accessible.

Also applies to: 76-76, 163-163


157-165: Next Steps navigation card provides good continuity. The link structure and presentation are consistent with other guides in the documentation set.

compressed-token-program/ctoken/program-guides/program-transfer-ctoken.mdx (1)

1-161: Documentation file is well-structured with valid internal links.

The referenced next-steps link (/compressed-token-program/ctoken/program-guides/program-close-ctoken) resolves correctly to an existing file in the documentation structure. The implementation guide clearly distinguishes between invoke() and invoke_signed() patterns, with proper account ordering and error handling demonstrated throughout.

compressed-token-program/ctoken/program-guides/program-transfer-interface.mdx (1)

1-232: All internal documentation links verified and valid.

The verification confirms all three referenced documentation files exist in the repository:

  • program-transfer-ctoken.mdx (line 16)
  • program-transfer-spl-ctoken.mdx (line 17)
  • c-token-program.mdx (line 231)

The implementation guide is well-structured with clear account ordering, proper validation of minimum account requirements (lines 138-140, 185-187), and correct PDA derivation and verification for the invoke_signed variant. The optional SPL bridge configuration is handled appropriately with a guard condition checking both account length and the optional token_pool_pda_bump field.

snippets/solana-rent-calculator.jsx (1)

1-8: The useState import is not needed in this Mintlify documentation context.

This repository uses Mintlify (a hosted documentation platform) as confirmed by the docs.json schema. Mintlify automatically injects React hooks into MDX and JSX components at build time, so explicit imports of useState are not required. Both snippets/solana-rent-calculator.jsx and snippets/rent-calculator.jsx follow this same pattern intentionally. The code will execute without errors when rendered through the Mintlify platform.

Comment on lines +6 to +9
import CTokenCreateAccountsList from '/snippets/ctoken-create-accounts-list.mdx';
import CTokenProtocolPDAs from '/snippets/ctoken-protocol-pdas.mdx';
import CompressibleVsSolanaRent from '/snippets/compressible-vs-solana-rent.mdx';
import { RentCalculator } from '/snippets/rent-calculator.jsx';
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:

#!/bin/bash

echo "=== 1. Checking for ctoken-protocol-pdas.mdx snippet ==="
find . -name "ctoken-protocol-pdas.mdx" -type f 2>/dev/null

echo ""
echo "=== 2. Checking if CTokenProtocolPDAs is used in program-create-ctoken.mdx ==="
rg "CTokenProtocolPDAs" compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx -n

echo ""
echo "=== 3. Checking line 281 for link content ==="
sed -n '275,285p' compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx

echo ""
echo "=== 4. Listing all available snippet files ==="
fd -e mdx -path "*/snippets/*" 2>/dev/null | sort

echo ""
echo "=== 5. Checking file size of program-create-ctoken.mdx ==="
wc -l compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx

Repository: Lightprotocol/docs-v2

Length of output: 680


🏁 Script executed:

#!/bin/bash

echo "=== 1. Check usage of all imported snippets ==="
echo "Looking for CTokenCreateAccountsList usage:"
rg "CTokenCreateAccountsList" compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx -n

echo ""
echo "Looking for CompressibleVsSolanaRent usage:"
rg "CompressibleVsSolanaRent" compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx -n

echo ""
echo "Looking for RentCalculator usage:"
rg "RentCalculator" compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx -n

echo ""
echo "=== 2. Search for any snippet files anywhere in repo ==="
find . -name "*.mdx" -o -name "*.jsx" | grep -i snippet | head -20

echo ""
echo "=== 3. Search for ctoken-transfer documentation ==="
find . -name "*transfer*" -type f | grep -E "(mdx|md)" | head -10

echo ""
echo "=== 4. Check directory structure for ctoken program guides ==="
find . -path "*/compressed-token-program/ctoken*" -type f -name "*.mdx" | sort

Repository: Lightprotocol/docs-v2

Length of output: 2730


🏁 Script executed:

#!/bin/bash

echo "=== Finding rent-calculator.jsx ==="
find . -name "rent-calculator.jsx" -type f

echo ""
echo "=== Verify the exact path needed for ctoken-transfer link ==="
cat ./compressed-token-program/ctoken/program-guides/program-transfer-ctoken.mdx | head -5

Repository: Lightprotocol/docs-v2

Length of output: 348


Remove unused imports and fix broken navigation link.

The review comment's severity assessment is partially incorrect:

Line 7 – Missing snippet (Minor, not Critical): The import CTokenProtocolPDAs from '/snippets/ctoken-protocol-pdas.mdx' references a non-existent file, but the component is never used in the file. This is dead code that should be removed; it won't cause a build failure.

Line 8 – Additional unused import (Minor): CompressibleVsSolanaRent is imported but never used. Remove this as well.

Line 281 – Broken navigation link (Major): The href is /compressed-token-program/ctoken/ctoken-transfer, but the correct path is /compressed-token-program/ctoken/program-guides/program-transfer-ctoken.

🤖 Prompt for AI Agents
In compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx
around lines 6-9 and line 281, remove the two unused dead imports by deleting
the import of CTokenProtocolPDAs ('/snippets/ctoken-protocol-pdas.mdx') and
CompressibleVsSolanaRent ('/snippets/compressible-vs-solana-rent.mdx') while
keeping the used imports, and update the broken navigation link at line 281 by
replacing href="/compressed-token-program/ctoken/ctoken-transfer" with the
correct path
href="/compressed-token-program/ctoken/program-guides/program-transfer-ctoken".

Comment on lines +277 to +283
<Card
title="Learn how to transfer cTokens"
icon="chevron-right"
color="#0066ff"
href="/compressed-token-program/ctoken/ctoken-transfer"
horizontal
/>
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

Fix broken internal link: missing path segment.

The href on line 281 references /compressed-token-program/ctoken/ctoken-transfer, but the correct path includes the program-guides/ directory segment. This link will not resolve.

Update the href to match the actual file location:

  <Card
    title="Learn how to transfer cTokens"
    icon="chevron-right"
    color="#0066ff"
-   href="/compressed-token-program/ctoken/ctoken-transfer"
+   href="/compressed-token-program/ctoken/program-guides/program-transfer-ctoken"
    horizontal
  />

Verify the correct file path exists:

#!/bin/bash
# Verify the transfer guide file exists
find . -name "*transfer*ctoken*.mdx" -path "*/program-guides/*" 2>/dev/null
🤖 Prompt for AI Agents
In compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx
around lines 277 to 283, the Card href incorrectly points to
/compressed-token-program/ctoken/ctoken-transfer (missing the program-guides
segment); update the href to include the program-guides path so it matches the
actual file location (e.g.
/compressed-token-program/ctoken/program-guides/ctoken-transfer), then save and
verify the target file exists (run the provided find command or check the docs
tree) to ensure the link resolves.

Comment on lines +1 to +8
export const RentCalculator = () => {
const [numEpochs, setNumEpochs] = useState(2);
const [lamportsPerWrite, setLamportsPerWrite] = useState(766);

const DATA_LEN = 260;
const BASE_RENT = 128;
const LAMPORTS_PER_BYTE_PER_EPOCH = 1;

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Find and read the rent-calculator.jsx file
fd -t f "rent-calculator.jsx" -x wc -l {}

Repository: Lightprotocol/docs-v2

Length of output: 139


🏁 Script executed:

# Read the full rent-calculator.jsx file
cat -n ./snippets/rent-calculator.jsx

Repository: Lightprotocol/docs-v2

Length of output: 5297


🏁 Script executed:

# Check if there's MDX config or special bundler setup
fd -t f "mdx.config\|next.config\|astro.config\|docusaurus.config\|tsconfig\|package.json" | head -20

Repository: Lightprotocol/docs-v2

Length of output: 47


🏁 Script executed:

# List project root files and directory structure
ls -la | head -30

Repository: Lightprotocol/docs-v2

Length of output: 1847


🏁 Script executed:

# Find package.json and check how snippets are used
find . -name "package.json" -type f

Repository: Lightprotocol/docs-v2

Length of output: 47


🏁 Script executed:

# Check the rent.mdx file and look for imports of rent-calculator
cat rent.mdx

Repository: Lightprotocol/docs-v2

Length of output: 946


🏁 Script executed:

# Double-check: look for any global React setup or context providers
rg -n "useState" snippets/ -A 2 -B 2

Repository: Lightprotocol/docs-v2

Length of output: 683


Import useState to avoid runtime errors.

This component uses useState on lines 2–3 without importing it, which will cause a ReferenceError: useState is not defined at runtime when the component is rendered.

Add the required import:

+import { useState } from 'react';
+
 export const RentCalculator = () => {
   const [numEpochs, setNumEpochs] = useState(2);
   const [lamportsPerWrite, setLamportsPerWrite] = useState(766);
📝 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
export const RentCalculator = () => {
const [numEpochs, setNumEpochs] = useState(2);
const [lamportsPerWrite, setLamportsPerWrite] = useState(766);
const DATA_LEN = 260;
const BASE_RENT = 128;
const LAMPORTS_PER_BYTE_PER_EPOCH = 1;
import { useState } from 'react';
export const RentCalculator = () => {
const [numEpochs, setNumEpochs] = useState(2);
const [lamportsPerWrite, setLamportsPerWrite] = useState(766);
const DATA_LEN = 260;
const BASE_RENT = 128;
const LAMPORTS_PER_BYTE_PER_EPOCH = 1;
🤖 Prompt for AI Agents
In snippets/rent-calculator.jsx around lines 1 to 8, the component uses useState
but does not import it; add the missing import statement (e.g., import React, {
useState } from 'react' or import { useState } from 'react' depending on project
conventions) at the top of the file so useState is defined and the component
won't throw a ReferenceError at runtime.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

♻️ Duplicate comments (2)
compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (2)

6-9: Remove unused imports.

Lines 7 and 8 import components that are never used in this file. Remove them to keep imports clean and reduce confusion about dependencies.

  import CTokenCreateAccountsList from '/snippets/ctoken-create-accounts-list.mdx';
- import CTokenProtocolPDAs from '/snippets/ctoken-protocol-pdas.mdx';
- import CompressibleVsSolanaRent from '/snippets/compressible-vs-solana-rent.mdx';
  import { CompressibleRentCalculator } from '/snippets/compressible-rent-calculator.jsx';

277-283: Fix broken internal link: missing "program-guides/" directory segment.

The href references an incorrect path that omits the program-guides/ directory segment. Update it to match the actual file location.

  <Card
    title="Learn how to transfer cTokens"
    icon="chevron-right"
    color="#0066ff"
-   href="/compressed-token-program/ctoken/ctoken-transfer"
+   href="/compressed-token-program/ctoken/program-guides/program-transfer-ctoken"
    horizontal
  />

Verify the target file exists:

#!/bin/bash
# Verify the transfer guide file exists at the corrected path
find . -path "*/compressed-token-program/ctoken/program-guides/program-transfer-ctoken.mdx" -type f
🧹 Nitpick comments (1)
snippets/cost-comparison-calculator.jsx (1)

5-8: Document the COMPRESSED_COST_PER_ACCOUNT constant.

The value 10,300 lamports appears to be a key assumption for compressed account costs, but its origin isn't explained. Adding a comment would help future maintainers understand where this number comes from.

 const ACCOUNT_STORAGE_OVERHEAD = 128;
 const LAMPORTS_PER_BYTE = 6960;
+// Base cost for creating + initial write to a compressed account
 const COMPRESSED_COST_PER_ACCOUNT = 10300;
 const LAMPORTS_PER_SOL = 1_000_000_000;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3153ca and 87829ed.

📒 Files selected for processing (6)
  • compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (1 hunks)
  • rent.mdx (1 hunks)
  • snippets/break-even-calculator.jsx (1 hunks)
  • snippets/compressible-rent-calculator.jsx (1 hunks)
  • snippets/cost-comparison-calculator.jsx (1 hunks)
  • snippets/solana-rent-calculator.jsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • snippets/solana-rent-calculator.jsx
🔇 Additional comments (2)
rent.mdx (1)

1-44: Documentation structure looks good!

The rent calculator documentation is well-organized with clear sections, helpful code examples, and embedded interactive calculators. The frontmatter is properly configured and the progression from Solana Rent → Compressible Rent → Cost Comparison → Break-Even Analysis is logical.

snippets/break-even-calculator.jsx (1)

14-22: Break-even calculation logic is correct.

The formula correctly accounts for the initial account creation cost (the 1 + in compressedCostPerAccount) and solves for the point where compressed accounts become more expensive than Solana accounts. The logic is sound.

Comment on lines +1 to +6
export const BreakEvenCalculator = () => {
const [dataLen, setDataLen] = useState(100);
const [numAccounts, setNumAccounts] = useState(1000);
const [numWrites, setNumWrites] = useState(10);
const [priorityFeeRate, setPriorityFeeRate] = useState(1000);
const [showPrioritySlider, setShowPrioritySlider] = useState(false);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing React and useState imports.

The component uses useState but doesn't import it or React, which will cause runtime errors.

Add the missing imports at the top of the file:

+import React, { useState } from 'react';
+
 export const BreakEvenCalculator = () => {
   const [dataLen, setDataLen] = useState(100);
   const [numAccounts, setNumAccounts] = useState(1000);
   const [numWrites, setNumWrites] = useState(10);
   const [priorityFeeRate, setPriorityFeeRate] = useState(1000);
   const [showPrioritySlider, setShowPrioritySlider] = useState(false);
📝 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
export const BreakEvenCalculator = () => {
const [dataLen, setDataLen] = useState(100);
const [numAccounts, setNumAccounts] = useState(1000);
const [numWrites, setNumWrites] = useState(10);
const [priorityFeeRate, setPriorityFeeRate] = useState(1000);
const [showPrioritySlider, setShowPrioritySlider] = useState(false);
import React, { useState } from 'react';
export const BreakEvenCalculator = () => {
const [dataLen, setDataLen] = useState(100);
const [numAccounts, setNumAccounts] = useState(1000);
const [numWrites, setNumWrites] = useState(10);
const [priorityFeeRate, setPriorityFeeRate] = useState(1000);
const [showPrioritySlider, setShowPrioritySlider] = useState(false);
🤖 Prompt for AI Agents
In snippets/break-even-calculator.jsx around lines 1 to 6, the component uses
useState but does not import React or useState; add the missing import at the
top of the file by importing React and the useState hook from 'react' (e.g.
import React, { useState } from 'react';) so the component can reference
useState without runtime errors.

Comment on lines +74 to +81
<input
type="range"
min="0"
max="550"
value={Math.min(dataLen, 550)}
onChange={(e) => setDataLen(Number.parseInt(e.target.value))}
className="w-full h-1.5 bg-black/[0.03] dark:bg-white/20 rounded-full appearance-none cursor-pointer backdrop-blur-sm"
/>
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

Range slider max doesn't match number input max.

This is part of a pattern throughout the component where range sliders have lower max values than their corresponding number inputs:

  • Line 77: slider max=550, input max=10000
  • Line 133: slider max=100000, input max=1000000
  • Line 156: slider max=500, input max=10000
  • Line 214: slider max=10000, input max=100000

When users enter values above the slider max in the number input, the slider position won't accurately reflect the value, creating UX confusion.

Consider either:

  1. Aligning slider max values with input max values
  2. Using logarithmic scales for sliders to cover wider ranges
  3. Removing the Math.min() constraints on slider values if intentionally allowing out-of-range values
🤖 Prompt for AI Agents
In snippets/break-even-calculator.jsx around lines 74 to 81, the range slider's
max (550) and the value clamp (Math.min(dataLen, 550)) do not match the
corresponding number input max (10000), causing the slider to misrepresent
larger values; fix by either setting the slider's max to the same max as the
number input (10000) and remove the Math.min clamp so the slider reflects the
full range, or implement a logarithmic mapping function that converts the number
input value to a slider position and vice versa (update both onChange handlers
and initial value mapping) so the slider can represent a much wider range while
keeping a reasonable visual scale.

Comment on lines +1 to +3
export const CompressibleRentCalculator = () => {
const [numEpochs, setNumEpochs] = useState(2);
const [lamportsPerWrite, setLamportsPerWrite] = useState(766);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing React and useState imports.

The component uses useState but doesn't import it or React, which will cause runtime errors.

Add the missing imports at the top of the file:

+import React, { useState } from 'react';
+
 export const CompressibleRentCalculator = () => {
   const [numEpochs, setNumEpochs] = useState(2);
   const [lamportsPerWrite, setLamportsPerWrite] = useState(766);
📝 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
export const CompressibleRentCalculator = () => {
const [numEpochs, setNumEpochs] = useState(2);
const [lamportsPerWrite, setLamportsPerWrite] = useState(766);
import React, { useState } from 'react';
export const CompressibleRentCalculator = () => {
const [numEpochs, setNumEpochs] = useState(2);
const [lamportsPerWrite, setLamportsPerWrite] = useState(766);
🤖 Prompt for AI Agents
In snippets/compressible-rent-calculator.jsx around lines 1 to 3, the component
uses useState but React and useState are not imported; add the missing import
statement to import React (if using JSX transform that requires it) and import
useState from 'react' at the top of the file so the component can reference
useState without runtime errors.

Comment on lines +67 to +75
<input
type="range"
min="0"
max="10000"
step="100"
value={Math.min(lamportsPerWrite, 10000)}
onChange={(e) => setLamportsPerWrite(Number.parseInt(e.target.value))}
className="w-full h-1.5 bg-black/[0.03] dark:bg-white/20 rounded-full appearance-none cursor-pointer backdrop-blur-sm"
/>
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

Range slider max doesn't match number input max.

Similar to the epochs slider, the number input allows up to 100,000 lamports (Line 61), but the range slider is capped at 10,000 (Line 70).

Align the slider max with the input max or document why they differ:

 <input
   type="range"
   min="0"
-  max="10000"
+  max="100000"
   step="100"
-  value={Math.min(lamportsPerWrite, 10000)}
+  value={lamportsPerWrite}
   onChange={(e) => setLamportsPerWrite(Number.parseInt(e.target.value))}
   className="w-full h-1.5 bg-black/[0.03] dark:bg-white/20 rounded-full appearance-none cursor-pointer backdrop-blur-sm"
 />
🤖 Prompt for AI Agents
In snippets/compressible-rent-calculator.jsx around lines 67 to 75, the range
input's max (10,000) and the value clamp Math.min(...) are inconsistent with the
number input's max (100,000) at line 61; change the range's max to 100000 and
update the Math.min clamp to Math.min(lamportsPerWrite, 100000) (or extract a
shared MAX_LAMPORTS constant used by both inputs) so both controls use the same
maximum and remain in sync.

Comment on lines +1 to +3
export const CostComparisonCalculator = () => {
const [numAccounts, setNumAccounts] = useState(10000);
const [dataLen, setDataLen] = useState(165);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing React and useState imports.

The component uses useState but doesn't import it or React, which will cause runtime errors.

Add the missing imports at the top of the file:

+import React, { useState } from 'react';
+
 export const CostComparisonCalculator = () => {
   const [numAccounts, setNumAccounts] = useState(10000);
   const [dataLen, setDataLen] = useState(165);
📝 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
export const CostComparisonCalculator = () => {
const [numAccounts, setNumAccounts] = useState(10000);
const [dataLen, setDataLen] = useState(165);
import React, { useState } from 'react';
export const CostComparisonCalculator = () => {
const [numAccounts, setNumAccounts] = useState(10000);
const [dataLen, setDataLen] = useState(165);
🤖 Prompt for AI Agents
In snippets/cost-comparison-calculator.jsx around lines 1 to 3, the component
uses useState but React and useState are not imported; add the missing import at
the top of the file such as: import React, { useState } from 'react'; (or at
minimum import { useState } from 'react') so the hook and React are available.

Comment on lines +52 to +60
<input
type="range"
min="5000"
max="500000"
step="5000"
value={Math.min(numAccounts, 500000)}
onChange={(e) => setNumAccounts(Number.parseInt(e.target.value))}
className="w-full h-1.5 bg-black/[0.03] dark:bg-white/20 rounded-full appearance-none cursor-pointer backdrop-blur-sm"
/>
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

Range slider max doesn't match number input max.

The number input allows up to 1,000,000 accounts (Line 46), but the range slider is capped at 500,000 (Line 55). Users entering values above 500,000 won't see the slider update correctly.

🤖 Prompt for AI Agents
In snippets/cost-comparison-calculator.jsx around lines 52 to 60, the range
input max is 500000 while the number input allows 1000000, causing the slider to
stop updating for values above 500000; update the range slider to use the same
maximum as the number input (1000000) or refactor both inputs to read from a
single MAX_NUM_ACCOUNTS constant so they stay in sync, and ensure value and
onChange logic continue to clamp/parse values consistently.

Comment on lines +78 to +85
<input
type="range"
min="0"
max="1000"
value={Math.min(dataLen, 1000)}
onChange={(e) => setDataLen(Number.parseInt(e.target.value))}
className="w-full h-1.5 bg-black/[0.03] dark:bg-white/20 rounded-full appearance-none cursor-pointer backdrop-blur-sm"
/>
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

Range slider max doesn't match number input max.

The number input allows up to 10,000 bytes (Line 70), but the range slider is capped at 1,000 (Line 81).

🤖 Prompt for AI Agents
In snippets/cost-comparison-calculator.jsx around lines 78 to 85, the range
input's max is incorrectly set to 1000 while the number input allows up to
10000; update the range slider to use max="10000", adjust the value binding to
Math.min(dataLen, 10000) (and keep parsing with Number.parseInt(e.target.value,
10)) so both controls share the same maximum and behave consistently.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (3)
snippets/compressible-rent-calculator.jsx (3)

1-3: Missing React and useState imports.

This issue was already flagged in a previous review and remains unresolved. The component will fail at runtime without the required imports.


44-51: Range slider max doesn't match number input max.

This UX inconsistency was already flagged. The slider's max of 48 doesn't align with the number input's max of 168, causing the slider to not reflect values above 48.


84-92: Range slider max doesn't match number input max.

This issue mirrors the hours slider problem and was previously flagged. The slider's max of 10,000 is inconsistent with the number input's max of 100,000.

🧹 Nitpick comments (1)
snippets/ctoken-create-accounts-list.mdx (1)

6-11: Add column headers to the table head.

The thead contains 3 empty th elements with no text content. Table headers improve accessibility and semantic clarity. Consider adding descriptive column names.

  <thead>
    <tr>
-     <th style={{textAlign: 'left'}}></th>
-     <th style={{textAlign: 'left'}}></th>
-     <th style={{textAlign: 'left'}}></th>
+     <th style={{textAlign: 'left'}}>Account</th>
+     <th style={{textAlign: 'left'}}>Type</th>
+     <th style={{textAlign: 'left'}}>Description</th>
    </tr>
  </thead>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87829ed and 4ad9127.

📒 Files selected for processing (3)
  • compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (1 hunks)
  • snippets/compressible-rent-calculator.jsx (1 hunks)
  • snippets/ctoken-create-accounts-list.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx

Comment on lines +2 to +5
<colgroup>
<col style={{width: '25%', textAlign: 'left'}} />
<col style={{width: '55%'}} />
</colgroup>
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

Fix colgroup column count mismatch.

The colgroup defines only 2 col elements but the table has 3 columns (visible in each tbody row). This structural mismatch may cause layout issues. The third column has no width constraint defined.

Add a third col element to account for the third column:

  <colgroup>
    <col style={{width: '25%', textAlign: 'left'}} />
    <col style={{width: '55%'}} />
+   <col style={{width: '20%'}} />
  </colgroup>
📝 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
<colgroup>
<col style={{width: '25%', textAlign: 'left'}} />
<col style={{width: '55%'}} />
</colgroup>
<colgroup>
<col style={{width: '25%', textAlign: 'left'}} />
<col style={{width: '55%'}} />
<col style={{width: '20%'}} />
</colgroup>
🤖 Prompt for AI Agents
In snippets/ctoken-create-accounts-list.mdx around lines 2 to 5, the colgroup
currently defines two <col> elements but the table contains three columns,
causing a column count mismatch; add a third <col> element (assigning an
appropriate width/style such as the remaining 20% or auto) to the colgroup so
all three table columns have corresponding column definitions and consistent
layout.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (3)
compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (2)

6-10: Remove unused imports.

Lines 7–8 import CTokenProtocolPDAs and CompressibleVsSolanaRent, but neither is referenced anywhere in the file. Remove these dead imports:

 import CTokenCreateAccountsList from '/snippets/ctoken-create-accounts-list.mdx';
-import CTokenProtocolPDAs from '/snippets/ctoken-protocol-pdas.mdx';
-import CompressibleVsSolanaRent from '/snippets/compressible-vs-solana-rent.mdx';
 import { CompressibleRentCalculator } from '/snippets/compressible-rent-calculator.jsx';

208-214: Fix broken internal navigation link on line 212.

The Card href points to a non-existent path /compressed-token-program/ctoken/ctoken-transfer that will result in a 404 error. The correct file is located at program-guides/program-transfer-ctoken.mdx:

<Card
  title="Learn how to transfer cTokens"
  icon="chevron-right"
  color="#0066ff"
-  href="/compressed-token-program/ctoken/ctoken-transfer"
+  href="/compressed-token-program/ctoken/program-guides/program-transfer-ctoken"
  horizontal
/>
docs.json (1)

508-516: Fix duplicate, incorrect, and non-existent Program Guides paths in docs.json.

The cToken Program Guides section (lines 508–516) contains paths that do not match actual .mdx files:

Duplicates and incorrect paths:

  • Lines 508–509: Both reference the same guide; "create-ctoken" is incorrect (no matching file)
  • Line 510: "mint-ctokens" → file is program-mint-to-cToken.mdx
  • Line 511: "create-ata" → file is program-create-cATA.mdx
  • Line 512: "ctoken-transfer" → file is program-transfer-ctoken.mdx
  • Line 513: "SPL-to-ctoken-transfer" → file is program-transfer-spl-ctoken.mdx
  • Line 516: "close-ctoken" → file is program-close-ctoken.mdx

Non-existent paths (remove):

  • Line 514: "ctoken-to-spl-decompress" — no corresponding file
  • Line 515: "compress-and-close" — no corresponding file

Apply this diff:

  {
    "group": "Program Guides",
    "pages": [
-     "compressed-token-program/ctoken/program-guides/create-ctoken",
      "compressed-token-program/ctoken/program-guides/program-create-ctoken",
-     "compressed-token-program/ctoken/program-guides/mint-ctokens",
-     "compressed-token-program/ctoken/program-guides/create-ata",
-     "compressed-token-program/ctoken/program-guides/ctoken-transfer",
-     "compressed-token-program/ctoken/program-guides/SPL-to-ctoken-transfer",
-     "compressed-token-program/ctoken/program-guides/ctoken-to-spl-decompress",
-     "compressed-token-program/ctoken/program-guides/compress-and-close",
-     "compressed-token-program/ctoken/program-guides/close-ctoken"
+     "compressed-token-program/ctoken/program-guides/program-mint-to-cToken",
+     "compressed-token-program/ctoken/program-guides/program-create-cATA",
+     "compressed-token-program/ctoken/program-guides/program-transfer-ctoken",
+     "compressed-token-program/ctoken/program-guides/program-transfer-spl-ctoken",
+     "compressed-token-program/ctoken/program-guides/program-close-ctoken"
    ]
  }
🧹 Nitpick comments (1)
snippets/ctoken-create-ata-accounts-list.mdx (1)

6-12: Add descriptive column headers to the table.

The table's header row (lines 7–11) contains three empty <th> tags with no text content, making the table structure unclear to readers. Based on the data rows, add appropriate headers for the three columns:

  <thead>
    <tr>
-     <th style={{textAlign: 'left'}}></th>
-     <th style={{textAlign: 'left'}}></th>
-     <th style={{textAlign: 'left'}}></th>
+     <th style={{textAlign: 'left'}}>Account</th>
+     <th style={{textAlign: 'left'}}>Constraints</th>
+     <th style={{textAlign: 'left'}}>Description</th>
    </tr>
  </thead>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ad9127 and aa99f22.

📒 Files selected for processing (5)
  • compressed-token-program/ctoken/program-guides/program-create-cATA.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (1 hunks)
  • docs.json (3 hunks)
  • snippets/ctoken-configure-rent.mdx (1 hunks)
  • snippets/ctoken-create-ata-accounts-list.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • compressed-token-program/ctoken/program-guides/program-create-cATA.mdx
🔇 Additional comments (2)
snippets/ctoken-configure-rent.mdx (2)

32-65: Account table layout is clear and well-documented.

The accounts table properly explains the three required accounts (Compressible Config, Rent Sponsor, System Program) with helpful Tooltip context. The column widths and styling are appropriate for the content.


3-13: I'll help you verify the Rust SDK API correctness for CompressibleParamsInfos::new(). Let me start by exploring the codebase to understand the project structure and locate relevant information.
<function_calls>

cd /tmp && git clone --depth 1 https://github.com/CodeRabbit/web3-code-snippets.git repo 2>&1 | head -20

</function_calls>

Now let me search for the CompressibleParamsInfos usage and Cargo.toml dependencies:
<function_calls>

cd /tmp/repo && find . -name "Cargo.toml" -type f | head -20

</function_calls>

Let me check the structure and find relevant files:
<function_calls>

cd /tmp/repo && ls -la && find . -name "ctoken" -o -name "Cargo" | head -20

</function_calls>

Let me check if there's a Cargo.toml in the root:
<function_calls>

cd /tmp/repo && cat Cargo.toml 2>/dev/null || echo "No root Cargo.toml found" && ls -la

</function_calls>

Let me look at the actual snippet file mentioned in the review:
<function_calls>

cd /tmp/repo && find . -name "ctoken-configure-rent" -type f

</function_calls>

<function_calls>

cd /tmp/repo && find . -path "snippets" -type f | head -20

</function_calls>

Let me check the directory structure more broadly:
<function_calls>

cd /tmp/repo && find . -type f -name "*.mdx" | head -10

</function_calls>

<function_calls>

cd /tmp/repo && ls -la snippets/ 2>/dev/null || echo "No snippets dir" && find . -maxdepth 3 -type d | head -30

</function_calls>

Now, let me search for CompressibleParamsInfos references in the codebase:
<function_calls>

cd /tmp/repo && rg "CompressibleParamsInfos" -A 5 -B 5

</function_calls>

Let me search more broadly:
<function_calls>

cd /tmp/repo && rg "light_compressed_token_sdk" -A 3 -B 3

</function_calls>

Let me check all files in the repo:
<function_calls>

cd /tmp/repo && find . -type f | head -50

</function_calls>

Since the codebase doesn't contain the SDK itself, let me search for the official Light Protocol documentation and SDK on the web:
<function_calls>

light_compressed_token_sdk CompressibleParamsInfos::new API signature documentation

</function_calls>

Let me try a more specific search:
<function_calls>

Light Protocol compressed token SDK CompressibleParamsInfos Rust

</function_calls>

Comment on lines +1 to +30
Use `CompressibleParamsInfos` to configure rent:

```rust
use light_compressed_token_sdk::ctoken::CompressibleParamsInfos;

let compressible_params = CompressibleParamsInfos::new(
data.pre_pay_num_epochs,
data.lamports_per_write,
compressible_config.clone(),
rent_sponsor.clone(),
system_program.clone(),
);
```

#### Rent Config

1. At creation set `pre_pay_num_epochs` to determine the number of epochs to fund the account with rent.
* This is set to 2 epochs (12,600 slots / 84 min or 766 lamports) by default.
2. Set `lamports_per_write` to determine the amount a transaction payer top-ups the account with rent.
* This is set to 766 lamports by default.
* Top-ups are made when the lamports balance falls below two epochs of rent.
3. The account is compressed when the lamports balance is at zero epochs.
4. When the account is written to, the account gets decompressed and the transaction payer tops up the accounts with `lamports_per_write` again.

You can calculate the parameters below based on the expected account activity.
<CompressibleRentCalculator />
<Info>
Learn the core concepts to the rent config [here](/compressed-token-program/rent-config).
You can customize the rent config based on expected account activity (must be 0 or ≥2).
</Info>
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

🏁 Script executed:

#!/bin/bash
# Initial exploration of repository structure
echo "=== Repository structure ==="
git ls-files | head -20

echo -e "\n=== Looking for MDX documentation files ==="
find . -name "*.mdx" -type f | head -15

echo -e "\n=== Looking for component files (JSX/TSX) ==="
find . -name "*.jsx" -o -name "*.tsx" | head -15

echo -e "\n=== Looking for docs configuration ==="
find . -name "docs.json" -o -name "docusaurus.config.js" -o -name "sidebars.js" | head -10

Repository: Lightprotocol/docs-v2

Length of output: 2338


🏁 Script executed:

#!/bin/bash
# Check if the file under review exists
echo "=== Checking if snippets/ctoken-configure-rent.mdx exists ==="
ls -la ./snippets/ctoken-configure-rent.mdx 2>/dev/null || echo "File not found"

echo -e "\n=== Content of compressible-rent-calculator.jsx ==="
cat -n ./snippets/compressible-rent-calculator.jsx

echo -e "\n=== Checking docs.json for rent-config routing ==="
grep -i "rent-config" ./docs.json || echo "No rent-config found in docs.json"

echo -e "\n=== Searching for rent-config documentation file ==="
find . -name "*.mdx" | xargs grep -l "rent-config" 2>/dev/null | head -10

echo -e "\n=== Searching for any 'rent' related MDX files ==="
find . -name "*rent*.mdx" -type f

Repository: Lightprotocol/docs-v2

Length of output: 8310


🏁 Script executed:

#!/bin/bash
# Read the actual file content
echo "=== Content of snippets/ctoken-configure-rent.mdx ==="
cat -n ./snippets/ctoken-configure-rent.mdx

echo -e "\n=== Checking docs.json structure (first 100 lines) ==="
head -100 ./docs.json

echo -e "\n=== Searching for 'compressed-token-program' in repository ==="
find . -type f \( -name "*.mdx" -o -name "*.json" \) | xargs grep -l "compressed-token-program" 2>/dev/null | head -10

echo -e "\n=== Content of rent.mdx ==="
wc -l ./rent.mdx
head -50 ./rent.mdx

Repository: Lightprotocol/docs-v2

Length of output: 9299


🏁 Script executed:

#!/bin/bash
# Explicitly search for rent-config file
echo "=== Searching for rent-config.mdx in compressed-token-program ==="
find ./compressed-token-program -name "*rent*" -type f

echo -e "\n=== List all MDX files in compressed-token-program ==="
find ./compressed-token-program -name "*.mdx" -type f | sort

echo -e "\n=== Checking if /compressed-token-program directory structure has any config/guide pages ==="
ls -la ./compressed-token-program/ 2>/dev/null || echo "Directory listing failed"

Repository: Lightprotocol/docs-v2

Length of output: 1756


The internal link in the file points to a non-existent page.

The reference to /compressed-token-program/rent-config on line 28 is broken. No rent-config.mdx file exists in the compressed-token-program/ directory or elsewhere in the documentation. The CompressibleRentCalculator component is correctly available and exported from ./snippets/compressible-rent-calculator.jsx, but the link should point to /rent instead, which is the actual rent configuration and calculator documentation page.

Update line 28 to:

Learn the core concepts to the rent config [here](/rent).
🤖 Prompt for AI Agents
snippets/ctoken-configure-rent.mdx lines 1-30: the internal link points to a
non-existent page (/compressed-token-program/rent-config); update the anchor to
the correct path by replacing the link target so it reads the core concepts are
at /rent (i.e., change the href in the markdown link from
/compressed-token-program/rent-config to /rent) and keep the surrounding text
unchanged.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (3)
snippets/compressible-rent-calculator.jsx (1)

1-5: Missing useState import will cause a runtime error.

The component uses useState but doesn't import it, which will fail at runtime.

+import { useState } from 'react';
+
 export const CompressibleRentCalculator = () => {
   const [hours, setHours] = useState(2);
snippets/compressible-vs-solana-rent.mdx (1)

26-31: Empty table row with mismatched column count.

This row contains 4 empty <td> elements, but the table only has 3 columns. The past review marked this as addressed, but the empty row remains and will cause rendering issues.

     <tr>
       <td>Prepaid rent</td>
       <td>388 × N epochs*</td>
       <td>Rent for N epochs</td>
     </tr>
-    <tr>
-      <td></td>
-      <td></td>
-      <td></td>
-      <td></td>
-    </tr>
     <tr>
       <td>Compression cost & incentive</td>
compressed-token-program/c-token-program.mdx (1)

57-57: Remove placeholder comment before merge.

The placeholder "add graphic of all tokens here" remains unaddressed despite being marked as fixed. Either add the referenced graphic or remove the comment entirely.

-_add graphic of all tokens here_
-
+
🧹 Nitpick comments (2)
snippets/compressible-rent-calculator.jsx (2)

36-49: Consider moving SliderMarkers outside the component.

SliderMarkers is recreated on every render. Since it only depends on props, moving it outside the component or wrapping with React.memo would prevent unnecessary recreation.

+const SliderMarkers = ({ max, step }) => {
+  const marks = [];
+  for (let i = step; i < max; i += step) {
+    const percent = (i / max) * 100;
+    marks.push(
+      <div
+        key={i}
+        className="absolute top-1/2 -translate-y-1/2 w-px h-2 bg-zinc-300 dark:bg-white/30"
+        style={{ left: `${percent}%` }}
+      />
+    );
+  }
+  return <>{marks}</>;
+};
+
 export const CompressibleRentCalculator = () => {
   // ... state hooks
-
-  const SliderMarkers = ({ max, step }) => {
-    // ... implementation
-  };

60-71: Add type="button" to prevent unintended form submission.

Buttons default to type="submit". If this component is placed inside a form, clicking these preset buttons could trigger form submission.

 <button
   key={h}
+  type="button"
   onClick={() => { setHours(h); setShowCustomHours(false); }}

Apply the same fix to all <button> elements in the component (lines 83-88, 116-126, 139-144).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa99f22 and b91e032.

📒 Files selected for processing (3)
  • compressed-token-program/c-token-program.mdx (1 hunks)
  • snippets/compressible-rent-calculator.jsx (1 hunks)
  • snippets/compressible-vs-solana-rent.mdx (1 hunks)
🔇 Additional comments (4)
snippets/compressible-rent-calculator.jsx (1)

7-21: Calculation logic is correct and consistent with documentation.

The constants and rent calculation formula align with the documented rent model (388 lamports per epoch for a 260-byte cToken account).

snippets/compressible-vs-solana-rent.mdx (3)

49-59: Clear explanation of Solana rent exemption calculation.

The minimum balance formula and example calculation are accurate, and the notes effectively highlight the key differences between traditional and compressible accounts.


62-95: Well-structured explanation of top-up mechanics.

The table clearly illustrates the three account states and their associated costs, with practical examples.


97-141: Closing mechanics are well-documented.

The two closing scenarios (Account Owner vs Compression Authority) are clearly explained with appropriate recipient breakdowns. The 11,000 lamport compression incentive is consistent with the calculator component.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
snippets/ctoken-configure-rent.mdx (2)

26-26: Fix the broken internal link.

The link to /compressed-token-program/rent-config on line 26 points to a non-existent page. Update it to reference the actual rent configuration documentation at /rent.

-Learn the [core concepts of the rent config here](/compressed-token-program/rent-config).
+Learn the [core concepts of the rent config here](/rent).

20-21: Clarify the relationship between time-based epochs and lamports values.

Lines 20–21 conflate distinct concepts by stating "two epochs of rent (766 lamports)". This phrasing suggests that "two epochs" and "766 lamports" are interchangeable, when they're actually separate measurements:

  • Duration: account activity is throttled when not topped up for a time period (~2 protocol rent epochs)
  • Amount: lamports_per_write defaults to 766 lamports as the top-up quantity

Rewrite to separate these concepts more clearly:

-* Top ups are made when the account's lamports balance is below two epochs of rent (766 lamports).
-* The account gets compressed when the account is not topped up for two epochs and the lamports balance is below two epochs of rent (766 lamports).
+* Top-ups are made when the account's lamports balance falls below the rent required for ~2 epochs (~766 lamports).
+* The account gets compressed when it is not topped up for ~2 epochs and the lamports balance is below the rent required for that period (~766 lamports).
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1614ee2 and 0e5c17e.

📒 Files selected for processing (3)
  • compressed-token-program/ctoken/program-guides/program-create-cATA.mdx (1 hunks)
  • compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx (1 hunks)
  • snippets/ctoken-configure-rent.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • compressed-token-program/ctoken/program-guides/program-create-ctoken.mdx
🧰 Additional context used
🪛 LanguageTool
snippets/ctoken-configure-rent.mdx

[grammar] ~20-~20: Use a hyphen to join words.
Context: ...write` to 766 lamports by default. * Top ups are made when the account's lamports...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (4)
compressed-token-program/ctoken/program-guides/program-create-cATA.mdx (4)

12-28: Key points section is well-structured and clear.

The key points effectively communicate the deterministic cATA address derivation, rent model, and auto-recompression behavior. Each point is actionable and concise.


30-99: Implementation guide clearly contrasts invoke vs invoke_signed patterns.

The step-by-step approach and tabs effectively show the distinction between external signer (invoke) and PDA signer (invoke_signed) flows. The inline code is clear and the note about address derivation is helpful.


100-213: Full code example is well-documented with proper error handling.

The two handler functions (process_create_ata2_invoke and process_create_ata2_invoke_signed) are clearly commented, with explicit account ordering documented above each function. Error handling for insufficient accounts is present, and the PDA validation in invoke_signed correctly verifies signer seeds. The CreateAta2Data struct is straightforward.

One minor observation: the comment at line 169 states "not signer - program signs", which is correct and clarifies the invoke_signed behavior.


215-223: Next Steps navigation is concise and contextually appropriate.

Links to the next relevant guide (cToken transfer) with clear visual and directional cues.

Comment on lines +6 to +10
import CTokenCreateATAAccountsList from '/snippets/ctoken-create-ata-accounts-list.mdx';
import CTokenProtocolPDAs from '/snippets/ctoken-protocol-pdas.mdx';
import CompressibleVsSolanaRent from '/snippets/compressible-vs-solana-rent.mdx';
import { CompressibleRentCalculator } from '/snippets/compressible-rent-calculator.jsx';
import CTokenConfigureRent from '/snippets/ctoken-configure-rent.mdx';
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

🏁 Script executed:

#!/bin/bash
# Verify snippet file existence
echo "=== Checking snippet file existence ==="
cd "compressed-token-program/ctoken/program-guides" 2>/dev/null || cd . 
find . -name "ctoken-create-ata-accounts-list.mdx" -o -name "ctoken-protocol-pdas.mdx" -o -name "compressible-vs-solana-rent.mdx" -o -name "compressible-rent-calculator.jsx" -o -name "ctoken-configure-rent.mdx" | head -20

echo ""
echo "=== Checking for snippet directory ==="
find . -type d -name "snippets" 2>/dev/null

echo ""
echo "=== Listing files in current directory ==="
ls -la | head -30

Repository: Lightprotocol/docs-v2

Length of output: 845


🏁 Script executed:

#!/bin/bash
# Get the full content of the file to analyze usage
echo "=== Full file content ==="
cat -n "compressed-token-program/ctoken/program-guides/program-create-cATA.mdx" 2>/dev/null || echo "File not found"

Repository: Lightprotocol/docs-v2

Length of output: 8476


🏁 Script executed:

#!/bin/bash
# Search for component usage in the specific file
file_path="compressed-token-program/ctoken/program-guides/program-create-cATA.mdx"
if [ -f "$file_path" ]; then
  echo "=== Usage check: CTokenProtocolPDAs ==="
  grep -n "CTokenProtocolPDAs" "$file_path" | head -10
  
  echo ""
  echo "=== Usage check: CompressibleVsSolanaRent ==="
  grep -n "CompressibleVsSolanaRent" "$file_path" | head -10
  
  echo ""
  echo "=== Usage check: CompressibleRentCalculator ==="
  grep -n "CompressibleRentCalculator" "$file_path" | head -10
  
  echo ""
  echo "=== Usage check: CTokenCreateATAAccountsList ==="
  grep -n "CTokenCreateATAAccountsList" "$file_path" | head -10
  
  echo ""
  echo "=== Usage check: CTokenConfigureRent ==="
  grep -n "CTokenConfigureRent" "$file_path" | head -10
else
  echo "File not found at: $file_path"
fi

Repository: Lightprotocol/docs-v2

Length of output: 765


Remove unused imports at lines 7, 8, and 9.

The imports for CTokenProtocolPDAs, CompressibleVsSolanaRent, and CompressibleRentCalculator are never rendered in this file. Remove these three lines to clean up the imports:

 import CTokenCreateATAAccountsList from '/snippets/ctoken-create-ata-accounts-list.mdx';
-import CTokenProtocolPDAs from '/snippets/ctoken-protocol-pdas.mdx';
-import CompressibleVsSolanaRent from '/snippets/compressible-vs-solana-rent.mdx';
-import { CompressibleRentCalculator } from '/snippets/compressible-rent-calculator.jsx';
 import CTokenConfigureRent from '/snippets/ctoken-configure-rent.mdx';
🤖 Prompt for AI Agents
In compressed-token-program/ctoken/program-guides/program-create-cATA.mdx around
lines 6 to 10, remove the three unused import statements on lines 7, 8, and 9
(CTokenProtocolPDAs, CompressibleVsSolanaRent, CompressibleRentCalculator) so
only the used imports remain (CTokenCreateATAAccountsList and
CTokenConfigureRent); update the import block by deleting those three lines and
save the file.

Comment on lines +16 to +17
1. cToken accounts hold token balances like SPL Token accounts.
2. Fund the account with rent for 24h (~0.000030 SOL) when creating the account, instead of the full rent-exemption.
Copy link
Contributor

Choose a reason for hiding this comment

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

Something in between is missing.

  1. ok
  2. cToken accounts are compressible, that means Solana account rent exemption is sponsored by Light protocol and the cToken account pays rent similar to the initial Solana account rent.
  3. At cToken account creation you can fund rent for example for 24h ...
  4. Once the cToken account funds are insufficient to pay rent it is compressed and closed. It can be decompressed again with the same state when it was compressed.
  5. To keep the cToken account funded when it is used you can configure a top up amount. Top up means that every time the cToken account is written to the top up amount is transferred to the cToken account to keep it sufficiently funded for rent payments.

@@ -0,0 +1,68 @@
Use `CompressibleParamsInfos` to configure rent:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Use `CompressibleParamsInfos` to configure rent:
Use `CompressibleParamsInfos` to configure the initial rent payment:

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
snippets/ctoken-configure-rent.mdx (1)

26-26: Broken internal link still present — /compressed-token-program/rent-config does not exist.

This link was flagged in the previous review but appears not to have been resolved. The rent-config page does not exist in the documentation structure. Update the link to point to /rent instead.

-Learn the [core concepts of the rent config here](/compressed-token-program/rent-config).
+Learn the [core concepts of the rent config here](/rent).
#!/bin/bash
# Verify the correct rent documentation page exists
echo "=== Checking for rent-related MDX files ==="
find . -name "*rent*.mdx" -type f

echo -e "\n=== Verifying /rent page exists in docs structure ==="
rg -i '"/rent"' docs.json | head -5

echo -e "\n=== Checking if rent-config page exists anywhere ==="
find . -name "*rent-config*" -type f

[/request_verification]

🧹 Nitpick comments (1)
snippets/ctoken-configure-rent.mdx (1)

3-13: Good use of Rust code example for SDK integration.

The code snippet clearly demonstrates initializing CompressibleParamsInfos with the required parameters. Inline comments would enhance readability for developers unfamiliar with the SDK structure.

Consider adding brief inline comments to clarify each parameter:

 let compressible_params = CompressibleParamsInfos::new(
-    data.pre_pay_num_epochs,
-    data.lamports_per_write,
-    compressible_config.clone(),
-    rent_sponsor.clone(),
-    system_program.clone(),
+    data.pre_pay_num_epochs,           // epochs to prepay rent at account creation
+    data.lamports_per_write,           // lamports per write for top-ups
+    compressible_config.clone(),       // protocol PDA storing rent config
+    rent_sponsor.clone(),              // CToken program PDA fronting rent
+    system_program.clone(),            // Solana System Program
 );
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e5c17e and 4232ac2.

📒 Files selected for processing (1)
  • snippets/ctoken-configure-rent.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
snippets/ctoken-configure-rent.mdx

[grammar] ~20-~20: Use a hyphen to join words.
Context: ...write` to 766 lamports by default. * Top ups are made when the account's lamports...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (2)
snippets/ctoken-configure-rent.mdx (2)

29-33: Accordion component references CompressibleRentCalculator — verify this component is exported and functional.

Ensure the imported component <CompressibleRentCalculator /> is properly exported from the snippet system and renders without errors.


18-19: Verify rent configuration descriptions—values are accurate but language is misleading.

The numeric values in the documentation are mathematically sound:

  • ~35 epochs for 24 hours: Correct. With 2 epochs = 84 minutes, 24 hours ÷ 84 min/epoch ≈ 34.3 epochs.
  • 766 lamports for 2 epochs: Correct. Based on 388 lamports per epoch (128 base + 260 data = 388), 2 epochs × 388 = 776 lamports ≈ 766.

However, two clarifications are needed:

  1. "~1.5h of rent (2 epochs)" is slightly inaccurate. Since 2 epochs = 84 minutes, this equals ~1.4 hours, not 1.5 hours.

  2. "Set to...by default" is misleading. The example code shows these as fully configurable parameters (pre_pay_num_epochs: 2, lamports_per_write: 1), not hardcoded SDK defaults. Consider clarifying these are recommended values or configuration examples rather than "defaults."

tilo-14 added 3 commits December 9, 2025 02:26
- Rename token standard from c-token to light-token throughout blog post
- Update SDK builders: CreateAssociatedTokenAccount → CreateAssociatedCTokenAccount
- Standardize CPI type suffix: *Infos → *Cpi pattern across examples
- Add examples table with GitHub repository links to README
- Update card title from "c-Mints & c-Tokens" to "C-Tokens" in welcome
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

♻️ Duplicate comments (3)
c-token-program/ctoken/close-ctoken-account.mdx (1)

6-8: Remove unused import ClientCustomRentConfig.

The import at line 8 is not used anywhere in the file. Remove it to keep the imports clean.

 import CloseAccountInfosAccountsList from '/snippets/accounts-list/close-account-infos-accounts-list.mdx';
 import CTokenClientPrerequisites from '/snippets/ctoken-guides/ctoken-client-prerequisites.mdx';
-import ClientCustomRentConfig from '/snippets/ctoken-guides/client-custom-rent-config.mdx';
c-token-program/README.mdx (1)

7-8: Remove unused imports GuidesTable and AdvancedGuidesTable.

These components are imported but never rendered in the document. Only CMintGuidesTable (line 105) and CTokenGuidesTable (line 108) are used. Remove the unused imports to keep the file clean.

-import GuidesTable from '/snippets/overview-tables/compressed-tokens-guides-table.mdx';
-import AdvancedGuidesTable from '/snippets/overview-tables/compressed-tokens-advanced-guides-table.mdx';
 import SetupEnvironment from '/snippets/setup/setup-environment-tabs.mdx';
blog/c-token.mdx (1)

91-94: Clarify contradictory statement about extension status.

Line 93 is logically contradictory: "Extensions are under development and are currently implemented" cannot both be true. Clarify the actual status—either they are under development, or they are already implemented.

 ### Extensions
 
-Extensions are under development and are currently implemented.
+Extensions are currently under development.
 Additional extensions can be requested.
🧹 Nitpick comments (1)
blog/c-token.mdx (1)

10-10: Simplify wordy phrases for conciseness.

Consider tightening these phrases for better readability:

  • Line 10: "on a daily basis" → "daily"
  • Line 19: "at a fraction of the cost" → "at lower cost" or "much cheaper"

This improves readability without losing meaning.

Also applies to: 19-19

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0456eed and 2280856.

📒 Files selected for processing (7)
  • blog/c-token.mdx (1 hunks)
  • c-token-program/README.mdx (1 hunks)
  • c-token-program/ctoken/close-ctoken-account.mdx (1 hunks)
  • c-token-program/ctoken/create-cata.mdx (1 hunks)
  • c-token-program/ctoken/create-ctoken.mdx (1 hunks)
  • c-token-program/ctoken/transfer-interface.mdx (1 hunks)
  • welcome.mdx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • welcome.mdx
  • c-token-program/ctoken/transfer-interface.mdx
🧰 Additional context used
🪛 LanguageTool
blog/c-token.mdx

[style] ~10-~10: ‘on a daily basis’ might be wordy. Consider a shorter alternative.
Context: ...t around XXX token accounts are created on a daily basis. Many are created and rarely accessed. ...

(EN_WORDINESS_PREMIUM_ON_A_DAILY_BASIS)


[style] ~19-~19: ‘at a fraction of’ might be wordy. Consider a shorter alternative.
Context: ...on, you can create mints and tokens 1. at a fraction of the cost, 2. with improved performance,...

(EN_WORDINESS_PREMIUM_AT_A_FRACTION_OF)


[grammar] ~82-~82: Ensure spelling is correct
Context: ...cleVisualizer /> The token accounts is initalized and funded with initial rent. When rent...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (11)
c-token-program/ctoken/close-ctoken-account.mdx (1)

334-340: Verify internal navigation link target.

The Next Steps card at line 338 links to /c-token-program/README. Please confirm this path exists and is correctly registered in your docs navigation configuration (docs.json).

c-token-program/README.mdx (3)

127-127: The href points to an existing file.

The file c-token-program/ctoken/create-ctoken.mdx exists in the repository and the path is correct.


9-18: No action needed. All snippet imports and their paths are correct; the referenced files exist in the repository.


44-44: Both internal links resolve correctly. The /compressed-tokens path points to an existing overview page and /learn/c-token-program points to a valid documentation page covering c-Token Program core concepts. No changes needed.

c-token-program/ctoken/create-cata.mdx (3)

1-4: Confirm filename matches PR objectives.

The file is named create-cata.mdx, but PR objectives list create-ata.mdx. This appears to be a typo in the filename.

Please confirm the intended filename. If it should be create-ata.mdx, rename the file accordingly.


6-12: All imported snippet files are present and paths are correct.

Verification confirms all seven snippet files exist in the repository with correct import paths.


249-249: GitHub source code reference is accurate.

The link correctly references the Lightprotocol/light-protocol repository with the "main" branch. This is the current default branch for the repository.

blog/c-token.mdx (2)

6-8: All import paths are correct and resolve to existing files in the repository. No action needed.


118-123: Verify toolkit link paths exist in the documentation structure.

The links in lines 118-123 reference toolkit pages under /c-token-program/c-token-toolkits/. Confirm these paths exist and match the actual directory structure created in this PR.

c-token-program/ctoken/create-ctoken.mdx (2)

37-176: Rust code examples are well-structured and demonstrate the SDK patterns correctly.

The client-side example (lines 37–46) properly uses the SDK builder pattern, and the full test code (lines 75–114) includes appropriate setup steps, account verification, and a reusable create_compressed_mint helper. Error handling is sound.


207-236: CPI patterns correctly demonstrate both invoke and invoke_signed scenarios.

Both patterns properly construct CreateCTokenAccountCpi with the required accounts and rent configuration. The account ordering, signer derivation (line 325), and PDA verification (lines 328–330) follow best practices for secure CPI calls.


<RentLifecycleVisualizer />

The token accounts is initalized and funded with initial rent.
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

Fix spelling error: "initalized" → "initialized".

Line 82 contains a misspelling. The word should be "initialized" (with three 'i's).

-The token accounts is initalized and funded with initial rent.
+The token accounts is initialized and funded with initial rent.
📝 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
The token accounts is initalized and funded with initial rent.
The token accounts is initialized and funded with initial rent.
🧰 Tools
🪛 LanguageTool

[grammar] ~82-~82: Ensure spelling is correct
Context: ...cleVisualizer /> The token accounts is initalized and funded with initial rent. When rent...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
In blog/c-token.mdx around line 82, the sentence contains a misspelling:
"initalized" should be corrected to "initialized"; update the text so it reads
"The token accounts is initialized and funded with initial rent." and save the
file.

- Rename c-token to light-token throughout blog and FAQ
- Update SDK types: CreateCTokenAccount → CreateAssociatedTokenAccount
- Replace CloseAccount → CloseCTokenAccount
- Update CPI types: *Infos → *Cpi suffix
- Standardize terminology and improve clarity
- Add examples table to README

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (3)
blog/c-token.mdx (3)

70-70: Add or remove incomplete link reference.

Line 70 contains "You can view the source code here." without an actual link. This is a broken reference that should be completed or removed.

Replace with an actual link:

-You can view the source code here.
+You can view the source code [here](https://github.com/light-protocol/light-token).

Or remove the reference if the link is unavailable.


10-10: Remove placeholder "XXX" before publishing.

The daily token account count is still a placeholder that must be replaced with an actual statistic or removed entirely.

-At the moment around XXX token accounts are created on a daily basis.
+At the moment, around {actual_number} token accounts are created daily.

Alternatively, if the statistic is unavailable, rephrase to avoid the placeholder:

-At the moment around XXX token accounts are created on a daily basis.
+Many token accounts are created daily and rarely accessed, locking up SOL due to rent-exemption.

92-95: Clarify contradictory statement about extension status.

The text states extensions "are under development and are currently implemented," which is logically contradictory. Based on the "Coming soon:" section below, extensions are under development and not yet available.

-Extensions are under development and are currently implemented. 
-Additional extensions can be requested.
+Extensions are under development. 
+Additional extensions can be requested.
🧹 Nitpick comments (1)
c-token-program/ctoken-faq.mdx (1)

21-21: Consider versioning time-sensitive mainnet ETA.

Line 21 states "Mainnet ETA: End of Q1 2026," which will become stale. Consider moving this to a centralized configuration file or adding a deprecation/note mechanism so it can be easily updated without editing the FAQ file directly.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2280856 and 08dc64d.

📒 Files selected for processing (2)
  • blog/c-token.mdx (1 hunks)
  • c-token-program/ctoken-faq.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
blog/c-token.mdx

[style] ~10-~10: ‘on a daily basis’ might be wordy. Consider a shorter alternative.
Context: ...t around XXX token accounts are created on a daily basis. Many are created and rarely accessed. ...

(EN_WORDINESS_PREMIUM_ON_A_DAILY_BASIS)


[style] ~20-~20: ‘at a fraction of’ might be wordy. Consider a shorter alternative.
Context: ...on, you can create mints and tokens 1. at a fraction of the cost, 2. with improved performance,...

(EN_WORDINESS_PREMIUM_AT_A_FRACTION_OF)


[grammar] ~83-~83: Ensure spelling is correct
Context: ...cleVisualizer /> The token accounts is initalized and funded with initial rent. When rent...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (5)
blog/c-token.mdx (2)

26-29: Verify table data accuracy.

The creation costs table shows mint and token account costs in lamports. Confirm these figures are accurate and current, as rent requirements may change.


83-83: Fix spelling error: "initalized" → "initialized".

The word should be spelled with three i's.

-The token accounts is initalized and funded with initial rent.
+The token accounts is initialized and funded with initial rent.

Note: There's also a minor subject-verb agreement issue ("accounts is" should be "accounts are"), which you may want to address simultaneously.

c-token-program/ctoken-faq.mdx (3)

5-7: No issues found. All imported files exist and import paths are correctly configured:

  • compressible-rent-explained.mdx and compressible-vs-solana-rent.mdx are two separate, legitimate snippet files
  • code-compare.jsx and rent-lifecycle-visualizer.jsx both exist in the snippets/jsx directory

106-106: Fix broken internal navigation links in FAQ cards.

Lines 106 and 109 reference anchors (#toolkits and #cookbook) that do not exist in the target documentation (/c-token-program). These links will result in page navigation to the document root without anchoring to the intended sections. Either add the corresponding sections with matching IDs to the c-token-program documentation or update the href values to reference valid anchor points.


48-112: The components AccordionGroup, Accordion, CardGroup, and Card are built-in Mintlify components available globally in this documentation project and do not require explicit imports.

Your tokens are preserved as a compressed token account and
are automatically decompressed when you interact with it again.

You can view the source code here.
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

Add or remove incomplete link reference.

Line 90 contains the same "You can view the source code here." reference without an actual link. This should be completed or removed.

-You can view the source code here.
+You can view the source code [here](https://github.com/light-protocol/light-token-program).
📝 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
You can view the source code here.
You can view the source code [here](https://github.com/light-protocol/light-token-program).
🤖 Prompt for AI Agents
In blog/c-token.mdx around line 90, the sentence "You can view the source code
here." is present without a link; either add the correct URL or remove the
sentence. Update the line to include a proper markdown link pointing to the
source code repository/file (or delete the line if no link is intended), and
ensure the link is valid and uses the same formatting style as surrounding links
in the document.

Comment on lines +115 to +131
## Integrate with Your Application

We have dedicated toolkits for specific use cases:

- [Payments](/c-token-program/c-token-toolkits/for-payments)
- [Wallets](/c-token-program/c-token-toolkits/for-wallets)
- [Aggregators](/c-token-program/c-token-toolkits/for-aggregators)
- [DEXs](/c-token-program/c-token-toolkits/for-dexs)
- [Launchpads](/c-token-program/c-token-toolkits/for-launchpads)
- [Trading Apps](/c-token-program/c-token-toolkits/for-trading-apps)

Get in touch on telegram for help!

## What's next?

For now, light-token is live on Devnet. Mainnet is anticipated for end of Q1 2026.

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

Add Telegram link or provide alternative contact method.

Line 126 references "Get in touch on telegram for help!" but doesn't provide a clickable link. Add the Telegram channel URL or provide an alternative contact method.

-Get in touch on telegram for help!
+Get in touch on [Telegram](https://t.me/light_protocol) for help!
📝 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
## Integrate with Your Application
We have dedicated toolkits for specific use cases:
- [Payments](/c-token-program/c-token-toolkits/for-payments)
- [Wallets](/c-token-program/c-token-toolkits/for-wallets)
- [Aggregators](/c-token-program/c-token-toolkits/for-aggregators)
- [DEXs](/c-token-program/c-token-toolkits/for-dexs)
- [Launchpads](/c-token-program/c-token-toolkits/for-launchpads)
- [Trading Apps](/c-token-program/c-token-toolkits/for-trading-apps)
Get in touch on telegram for help!
## What's next?
For now, light-token is live on Devnet. Mainnet is anticipated for end of Q1 2026.
## Integrate with Your Application
We have dedicated toolkits for specific use cases:
- [Payments](/c-token-program/c-token-toolkits/for-payments)
- [Wallets](/c-token-program/c-token-toolkits/for-wallets)
- [Aggregators](/c-token-program/c-token-toolkits/for-aggregators)
- [DEXs](/c-token-program/c-token-toolkits/for-dexs)
- [Launchpads](/c-token-program/c-token-toolkits/for-launchpads)
- [Trading Apps](/c-token-program/c-token-toolkits/for-trading-apps)
Get in touch on [Telegram](https://t.me/light_protocol) for help!
## What's next?
For now, light-token is live on Devnet. Mainnet is anticipated for end of Q1 2026.
🤖 Prompt for AI Agents
In blog/c-token.mdx around lines 115 to 131, the text "Get in touch on telegram
for help!" lacks a clickable contact link; update the copy to include either the
official Telegram channel URL (e.g. t.me/YourChannelName) or an alternative
contact (support email or support page URL), making sure the link is a full URL
so it renders as clickable in the site and includes clear context like "Join our
Telegram" or "Contact support at".

- Add for-streaming-mints.mdx guide for launchpads
- Add for-streaming-tokens.mdx guide for token streaming
- Update blog title for clarity
- Update docs.json navigation structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

♻️ Duplicate comments (5)
blog/c-token.mdx (4)

90-90: Add actual link or remove incomplete reference.

Line 90 contains the same incomplete reference: "You can view the source code here." without a clickable link. This was also flagged as "Addressed" in a past review but remains unresolved.

Replace with an actual link to the source code or remove the sentence.


126-126: Add Telegram link or alternative contact method.

Line 126 references "Get in touch on telegram for help!" without a clickable link. This was flagged in a past review as "Addressed," but the link is still missing.

Add the official Telegram channel URL or provide an alternative contact:

-Get in touch on telegram for help!
+Get in touch on [Telegram](https://t.me/your_channel) for help!

Or use an alternative contact method (email, support page, etc.).


92-96: Clarify contradictory statement about extension status.

Line 94 states "Extensions are under development and are currently implemented," which is contradictory. Extensions cannot be both in development and already implemented. This issue was flagged in a past review as "Addressed," but the contradiction persists.

Clarify the actual status with one of the following options:

- Extensions are under development and are currently implemented.
+ Extensions are currently under development.

or

- Extensions are under development and are currently implemented.
+ Extensions are currently implemented. Additional extensions can be requested.

83-83: Fix misspelling: "initalized" → "initialized".

Line 83 contains a spelling error. This was flagged in a past review as "Addressed," but the misspelling persists.

Apply this diff to correct it:

-The token accounts is initalized and funded with initial rent.
+The token accounts is initialized and funded with initial rent.
docs.json (1)

14-17: Update banner href to use correct Mintlify routing path.

Per Mintlify routing, README.mdx files are served as index routes at their folder path. Line 15's href should be /c-token-program, not /c-token-program/README.

  "banner": {
    "content": "c-Token is live on Devnet. <a href=\"/c-token-program/README\" style=\"color:#FFFFFF; text-decoration: underline;\">Start testing and create mints or tokens</a> without rent-exemption!",
+   "content": "c-Token is live on Devnet. <a href=\"/c-token-program\" style=\"color:#FFFFFF; text-decoration: underline;\">Start testing and create mints or tokens</a> without rent-exemption!",
    "dismissible": false
  },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08dc64d and 95fe3b9.

📒 Files selected for processing (4)
  • blog/c-token.mdx (1 hunks)
  • c-token-program/c-token-toolkits/for-streaming-mints.mdx (1 hunks)
  • c-token-program/c-token-toolkits/for-streaming-tokens.mdx (1 hunks)
  • docs.json (5 hunks)
🧰 Additional context used
🪛 LanguageTool
blog/c-token.mdx

[style] ~10-~10: ‘on a daily basis’ might be wordy. Consider a shorter alternative.
Context: ...t around XXX token accounts are created on a daily basis. Many are created and rarely accessed. ...

(EN_WORDINESS_PREMIUM_ON_A_DAILY_BASIS)


[style] ~20-~20: ‘at a fraction of’ might be wordy. Consider a shorter alternative.
Context: ...on, you can create mints and tokens 1. at a fraction of the cost, 2. with improved performance,...

(EN_WORDINESS_PREMIUM_AT_A_FRACTION_OF)


[grammar] ~83-~83: Ensure spelling is correct
Context: ...cleVisualizer /> The token accounts is initalized and funded with initial rent. When rent...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

c-token-program/c-token-toolkits/for-streaming-tokens.mdx

[grammar] ~10-~10: Use a hyphen to join words.
Context: ...t prepend an idempotent decompress "warm up" instruction. ```rust import { creat...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (4)
blog/c-token.mdx (1)

6-8: All imported components exist and can be resolved correctly. The imports on lines 6-8 reference valid files in the snippets directory.

c-token-program/c-token-toolkits/for-streaming-mints.mdx (3)

39-41: Verify hardcoded program IDs and discriminator values.

Three constants are hardcoded without inline comments explaining their origin or how to derive them. Confirm these are correct and stable across environments (mainnet, devnet). Consider adding a brief comment explaining where these values come from.

  • LIGHT_SYSTEM_PROGRAM: "SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7"
  • CTOKEN_PROGRAM_ID: "cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m"
  • COMPRESSED_MINT_DISCRIMINATOR: [0, 0, 0, 0, 0, 0, 0, 1]

101-105: Clarify or define missing helper functions.

The process_transaction function calls extract_account_keys and extract_instructions (lines 102–105) without definitions. While this is acceptable as a high-level guide, consider either:

  1. Briefly explaining what these helpers do inline, or
  2. Adding a note that they are implementation-specific helpers the reader must provide.

Additionally, the types Message and TransactionStatusMeta used in the function signature are not explicitly imported in the shown code. Confirm these are available from a Helius or Solana SDK import.


194-242: Data layouts are well-documented.

The struct definitions for CompressedMint, BaseMint, CompressedMintMetadata, TokenMetadata, and AdditionalMetadata are clear and helpful for understanding the on-chain data structure. The byte-size annotations (e.g., "82 bytes" for BaseMint) add useful context.

blog/c-token.mdx Outdated
import CompressibleRentExplained from '/snippets/compressible-rent-explained.mdx';
import { RentLifecycleVisualizer } from '/snippets/jsx/rent-lifecycle-visualizer.jsx';

At the moment around XXX token accounts are created on a daily basis.
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

Replace "XXX" placeholder with actual statistic or remove.

Line 10 still contains the "XXX" placeholder for daily token account creation count. This was flagged in a past review as "Addressed," but the placeholder persists.

Either:

  1. Replace "XXX" with the actual daily statistic (sourced and verified), or
  2. Remove or rephrase to avoid placeholder text (e.g., "Many token accounts are created daily and rarely accessed, still locking up SOL due to rent-exemption.")
🧰 Tools
🪛 LanguageTool

[style] ~10-~10: ‘on a daily basis’ might be wordy. Consider a shorter alternative.
Context: ...t around XXX token accounts are created on a daily basis. Many are created and rarely accessed. ...

(EN_WORDINESS_PREMIUM_ON_A_DAILY_BASIS)

🤖 Prompt for AI Agents
In blog/c-token.mdx around line 10, the sentence still contains the placeholder
"XXX" for the number of token accounts created daily; replace the placeholder
with a verified statistic (include a source citation or footnote in the post) or
remove/rephrase the sentence to avoid a placeholder (for example: "Many token
accounts are created daily and rarely accessed, still locking up SOL due to
rent-exemption."). Ensure the chosen option is applied in-line and the copy
reads naturally without "XXX."

- Light-token mint accounts are compressed accounts and rent-free.
- Tokens created from light-token mints are light-tokens.

You can view the source code here.
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

Add actual link or remove incomplete reference.

Line 70 contains "You can view the source code here." without a clickable link. This was flagged in a past review as "Addressed," but the incomplete reference persists.

Either:

  1. Replace with an actual Markdown link to the source code repository (e.g., [here](https://github.com/light-protocol/light-token-program)), or
  2. Remove the sentence entirely.
🤖 Prompt for AI Agents
In blog/c-token.mdx around line 70, the sentence "You can view the source code
here." is an incomplete reference; either replace it with a proper Markdown link
to the repo (for example:
[here](https://github.com/light-protocol/light-token-program)) or remove the
sentence entirely. Update the line so it contains a full clickable Markdown link
to the source or delete the line if the link is not needed.

Comment on lines +19 to +29
```toml Cargo.toml
[dependencies]
helius-laserstream = "0.1"
tokio = { version = "1", features = ["full"] }
futures = "0.3"
light-event = "0.2"
light-compressed-account = "0.7"
light-ctoken-interface = "0.1"
borsh = "0.10"
bs58 = "0.5"
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

helius-laserstream crate crates.io latest version

💡 Result:

The latest published version appears to be 0.0.7 (released Jul 17, 2025). [1][2]

Sources:
[1] lib.rs crate page for helius-laserstream (shows v0.0.7).
[2] docs.rs / helius_laserstream (crate documentation).


🌐 Web query:

light-event crate crates.io latest version

💡 Result:

The latest version is 0.2.1 (published 2025-12-07). [1]

Sources:
[1] light-event versions (docs.rs).


🌐 Web query:

light-compressed-account crate crates.io latest version

💡 Result:

The latest published version on crates.io appears to be 0.6.0. [1] Note: the GitHub repository has tags/releases up to v0.6.2 (Oct 31, 2025), which may not yet be published to crates.io. [2]

Sources:

  • docs.rs crate page for light-compressed-account 0.6.0. [1]
  • Lightprotocol GitHub releases (light-compressed-account v0.6.2). [2]

🌐 Web query:

light-ctoken-interface crate crates.io latest version

💡 Result:

The latest published version is 0.1.1. [1][2]

Sources:
[1] docs.rs — light-ctoken-interface 0.1.1.
[2] docs.rs — light-ctoken-interface (crate index / API).


Update dependency versions to match current crates.io releases.

The Cargo.toml contains incorrect version numbers that would prevent successful build:

  • helius-laserstream = "0.1" → should be "0.0.7" (latest published version)
  • light-compressed-account = "0.7" → should be "0.6.0" (latest crates.io version; 0.6.2 exists on GitHub but not yet published)
  • light-event = "0.2" and light-ctoken-interface = "0.1" are compatible with their latest patch versions (0.2.1 and 0.1.1 respectively).

Update the dependency versions to ensure code compiles correctly.

🤖 Prompt for AI Agents
In c-token-program/c-token-toolkits/for-streaming-mints.mdx around lines 19 to
29, the Cargo.toml dependency versions are outdated/incorrect and will fail to
build; update the listed versions as follows: change helius-laserstream to
"0.0.7", change light-compressed-account to "0.6.0", and pin light-event and
light-ctoken-interface to their latest patch releases (0.2.1 and 0.1.1
respectively) so the example matches current crates.io releases and compiles.

When a market becomes inactive, its token accounts and related PDAs will be compressed - their state is committed and effectively frozen until a client decompresses it.
While compressed, pure on-chain lookups will return uninitialized.

Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm up" instruction.
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

Hyphenate compound adjective "warm-up".

Use a hyphen when "warm up" modifies the noun "instruction."

-Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm up" instruction.
+Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm-up" instruction.
📝 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
Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm up" instruction.
Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm-up" instruction.
🧰 Tools
🪛 LanguageTool

[grammar] ~10-~10: Use a hyphen to join words.
Context: ...t prepend an idempotent decompress "warm up" instruction. ```rust import { creat...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
In c-token-program/c-token-toolkits/for-streaming-tokens.mdx around line 10, the
phrase "warm up instruction" should be hyphenated when used as a compound
adjective; change it to "warm-up instruction" so the compound modifier is
grammatically correct.

- Reorganize blog opening for clarity
- Add complete streaming-mints guide with Laserstream setup
- Add streaming-tokens guide with compression handling
- Remove empty aggregators stub

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (8)
c-token-program/c-token-toolkits/for-streaming-tokens.mdx (1)

10-10: Hyphenate compound adjective "warm-up".

Use a hyphen when "warm up" modifies the noun "instruction."

-Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm up" instruction.
+Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm-up" instruction.
c-token-program/c-token-toolkits/for-streaming-mints.mdx (1)

19-29: Update dependency versions to match current crates.io releases. ``

This issue was flagged in a previous review and remains unresolved. The Cargo.toml contains incorrect version numbers that would prevent successful builds. Based on the prior analysis:

  • helius-laserstream = "0.1" → should be "0.0.7" (latest published)
  • light-compressed-account = "0.7" → should be "0.6.0" (latest on crates.io)
  • light-event = "0.2" and light-ctoken-interface = "0.1" should be pinned to latest patches (0.2.1 and 0.1.1)

Apply this diff:

 [dependencies]
-helius-laserstream = "0.1"
+helius-laserstream = "0.0.7"
 tokio = { version = "1", features = ["full"] }
 futures = "0.3"
-light-event = "0.2"
-light-compressed-account = "0.7"
-light-ctoken-interface = "0.1"
+light-event = "0.2.1"
+light-compressed-account = "0.6.0"
+light-ctoken-interface = "0.1.1"
 borsh = "0.10"
 bs58 = "0.5"
blog/c-token.mdx (6)

18-20: Replace XXX placeholder with actual statistic or rephrase.

Line 18 still contains the "XXX" placeholder for the daily token account creation count. This must be resolved before publication. Either:

  1. Replace "XXX" with a verified statistic (include source), or
  2. Remove/rephrase to avoid the placeholder (e.g., "Many token accounts are created and rarely accessed...")

Additionally, consider shortening the verbose phrasing on lines 13 and 18 ("at a fraction of the cost" → "at lower cost"; "on a daily basis" → "daily").


72-72: Add actual link or remove incomplete reference.

Line 72 contains "You can view the source code here." without a clickable link. Replace with a proper Markdown link to the repository or remove the sentence entirely.

-You can view the source code here.
+You can view the source code [here](https://github.com/light-protocol/light-token-program).

(Adjust the URL to match the correct repository.)


85-85: Fix spelling error: "initalized" → "initialized".

Line 85 contains a misspelling. The word should be "initialized" (with three 'i's, not two).

-The token accounts is initalized and funded with initial rent.
+The token accounts is initialized and funded with initial rent.

92-92: Add actual link or remove incomplete reference.

Line 92 contains the same incomplete link: "You can view the source code here." without a clickable link. Replace with a proper Markdown link or remove the sentence.

-You can view the source code here.
+You can view the source code [here](https://github.com/light-protocol/light-token-program).

(Ensure the URL matches the correct source code repository.)


96-96: Clarify contradictory statement about extension status.

Line 96 states "Extensions are under development and are currently implemented," which is contradictory. Extensions cannot be both in development and already implemented. Clarify the actual status:

-Extensions are under development and are currently implemented. Additional extensions can be requested.
+Extensions are currently under development. Additional extensions can be requested.

128-128: Add Telegram link or provide alternative contact method.

Line 128 references "Get in touch on telegram for help!" but doesn't provide a clickable link. Add the Telegram channel URL or provide an alternative contact method (email, support page, etc.).

-Get in touch on telegram for help!
+Get in touch on [Telegram](https://t.me/light_protocol) for help!

(Verify and use the correct Telegram channel URL.)

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 95fe3b9 and 4bccc50.

📒 Files selected for processing (3)
  • blog/c-token.mdx (1 hunks)
  • c-token-program/c-token-toolkits/for-streaming-mints.mdx (1 hunks)
  • c-token-program/c-token-toolkits/for-streaming-tokens.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
blog/c-token.mdx

[style] ~13-~13: ‘at a fraction of’ might be wordy. Consider a shorter alternative.
Context: ...on, you can create mints and tokens 1. at a fraction of the cost, 2. with improved performance,...

(EN_WORDINESS_PREMIUM_AT_A_FRACTION_OF)


[style] ~18-~18: ‘on a daily basis’ might be wordy. Consider a shorter alternative.
Context: ...unts over 20k mint accounts are created on a daily basis. Many are created and rarely accessed. ...

(EN_WORDINESS_PREMIUM_ON_A_DAILY_BASIS)


[grammar] ~85-~85: Ensure spelling is correct
Context: ...cleVisualizer /> The token accounts is initalized and funded with initial rent. When rent...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

c-token-program/c-token-toolkits/for-streaming-tokens.mdx

[grammar] ~10-~10: Use a hyphen to join words.
Context: ...t prepend an idempotent decompress "warm up" instruction. ```rust import { creat...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (2)
c-token-program/c-token-toolkits/for-streaming-mints.mdx (2)

31-192: Code examples and workflow are well-structured.

The Rust code samples demonstrate sound patterns for event parsing, mint extraction with discriminator validation, and metadata handling. The multi-step progression from connection through metadata extraction is clear and educational.


194-251: Documentation structure and type definitions are clear.

The data layout section provides helpful reference documentation for the types used in the workflow steps. The navigation card at the end appropriately links to related content.

Comment on lines +12 to +24
```rust
import { createLoadAtaInstructions } from "@lightprotocol/compressed-token/unified";

const warmupIxs = await createLoadAtaInstructions(
rpc,
tokenAccount,
owner,
mint,
payer
);

new Transaction().add(...warmupIxs, tradeIx);
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix code fence language identifier.

The code block contains TypeScript/JavaScript syntax (import statement, await, const) but is marked with a rust language identifier, which will cause incorrect syntax highlighting. Change it to typescript or javascript.

-```rust
+```typescript
 import { createLoadAtaInstructions } from "@lightprotocol/compressed-token/unified";
 
 const warmupIxs = await createLoadAtaInstructions(
   rpc,
   tokenAccount,
   owner,
   mint,
   payer
 );
 
 new Transaction().add(...warmupIxs, tradeIx);
-```
+```
🤖 Prompt for AI Agents
In c-token-program/c-token-toolkits/for-streaming-tokens.mdx around lines 12 to
24, the fenced code block is marked as "rust" but contains TypeScript/JavaScript
code; update the opening fence to use "typescript" (or "javascript") instead of
"rust" and leave the closing ``` unchanged so syntax highlighting matches the
code.

tilo-14 and others added 2 commits December 11, 2025 07:17
- Add full wallets toolkit with API examples and comparisons
- Remove nested Steps from payments guide
- Update docs.json: remove aggregators entry

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update all guides: README, mint, token, extensions, transfer
- Rebrand toolkit guides: wallets, payments, streaming, trading
- Update terminology in snippets and account lists
- Add TypeScript client examples for mint creation
- Standardize light-token/light-mint naming

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (13)
c-token-program/cmint/README.mdx (3)

6-6: Unused import—render the component or remove it.

The SolanaRentCalculator component is imported but never rendered in the file. Either render it (e.g., after the rent comparison table to illustrate cost differences) or remove the unused import.


21-23: Empty Accordion—add content or remove.

The Accordion titled "Setup" contains no content. Either populate it with setup instructions (e.g., prerequisites, installation, environment variables) or remove the empty element.


26-37: Replace placeholder text with actual guide content.

Lines 30 and 35 contain incomplete placeholders ("table for" and "add github link") that must be addressed before merging:

  • Line 30 (Guides): Replace with a CardGroup, table, or list of cMint guides (e.g., create-cmint, update-metadata) with titles, descriptions, and links.
  • Line 35 (Examples): Replace with a proper Examples section including a link to the Light Protocol GitHub repository with a brief description and usage instructions. Note: Use "GitHub" (capitalized) per style guidelines.
c-token-program/c-token-toolkits/for-streaming-tokens.mdx (2)

10-10: Hyphenate compound adjective "warm-up".

This was previously flagged. Use a hyphen when "warm up" modifies the noun "instruction."

-Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm up" instruction.
+Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm-up" instruction.

12-24: Fix code fence language identifier.

This was previously flagged. The code block contains TypeScript/JavaScript syntax (import statement, await, const) but is marked with a rust language identifier, causing incorrect syntax highlighting. Change it to typescript.

-```rust
+```typescript
 import { createLoadAtaInstructions } from "@lightprotocol/compressed-token/unified";
 
 const warmupIxs = await createLoadAtaInstructions(
   rpc,
   tokenAccount,
   owner,
   mint,
   payer
 );
 
 new Transaction().add(...warmupIxs, tradeIx);
-```
+```
c-token-program/c-token-toolkits/for-streaming-mints.mdx (1)

19-29: Update dependency versions to match current crates.io releases.

This was previously flagged. The Cargo.toml contains incorrect version numbers that will prevent successful compilation:

  • helius-laserstream = "0.1" → should be "0.0.7"
  • light-compressed-account = "0.7" → should be "0.6.0"
  • light-event = "0.2" → should be "0.2.1" (latest patch)
  • light-ctoken-interface = "0.1" → should be "0.1.1" (latest patch)
 [dependencies]
-helius-laserstream = "0.1"
+helius-laserstream = "0.0.7"
 tokio = { version = "1", features = ["full"] }
 futures = "0.3"
-light-event = "0.2"
-light-compressed-account = "0.7"
-light-ctoken-interface = "0.1"
+light-event = "0.2.1"
+light-compressed-account = "0.6.0"
+light-ctoken-interface = "0.1.1"
 borsh = "0.10"
 bs58 = "0.5"
c-token-program/cmint/create-cmint.mdx (1)

113-113: Fix typo in comment (flagged in previous review).

Line 113 contains a typo: "c-int" should be "c-Mint".

-    // Create c-int with metadata
+    // Create c-Mint with metadata
c-token-program/cmint/mint-ctokens.mdx (2)

10-10: Remove unused import.

ClientCustomRentConfig is imported on line 10 but is never referenced in the document. Remove this import to keep the file clean.

-import ClientCustomRentConfig from '/snippets/ctoken-guides/client-custom-rent-config.mdx';

65-65: Fix double period at end of line.

Line 65 ends with a double period .. after the Tooltip closing tag. Replace with a single period for correct punctuation.

-2. Get light-mint account infos and prove it exists <Tooltip tip="light-mints are compressed accounts. Compressed accounts are stored in state Merkle trees. Only the root hash is stored on chain - every transaction that accesses the light-mint includes a validity proof to verify the compressed state.">with a validity proof</Tooltip>..
+2. Get light-mint account infos and prove it exists <Tooltip tip="light-mints are compressed accounts. Compressed accounts are stored in state Merkle trees. Only the root hash is stored on chain - every transaction that accesses the light-mint includes a validity proof to verify the compressed state.">with a validity proof</Tooltip>.
c-token-program/c-token-toolkits/for-payments.mdx (2)

206-223: Fix undefined transferIx and missing Transaction import in Send Payments Action tab.

The code snippet at line 222 attempts to add both createAtaIx and transferIx to a transaction, but transferIx is never defined or imported. Additionally, there is no Transaction import from @solana/web3.js.

To fix, either:

  1. Show how to construct transferIx (e.g., via createTransferInterfaceInstruction()) and add the Transaction import, or
  2. Replace the incomplete snippet with guidance like // Add your transfer instruction here to clarify the example is conceptual.

Option 1: Provide complete instruction-building example

 import {
   getAssociatedTokenAddressInterface,
+  createAssociatedTokenAccountInterfaceIdempotentInstruction,
+  createTransferInterfaceInstruction,
 } from "@lightprotocol/compressed-token/unified";
 import { CTOKEN_PROGRAM_ID } from "@lightprotocol/stateless.js";
+import { Transaction } from "@solana/web3.js";
 
 const destinationAta = getAssociatedTokenAddressInterface(mint, recipient);
 const createAtaIx = createAssociatedTokenAccountInterfaceIdempotentInstruction(
   payer.publicKey,
   destinationAta,
   recipient,
   mint,
   CTOKEN_PROGRAM_ID
 );
 
-new Transaction().add(createAtaIx, transferIx);
+const transferIx = createTransferInterfaceInstruction(
+  sourceAta,
+  destinationAta,
+  owner.publicKey,
+  amount
+);
+
+new Transaction().add(createAtaIx, transferIx);

Option 2: Simplify to a conceptual note

 new Transaction().add(createAtaIx, transferIx);
+// Note: Construct and add your transfer instruction to complete the transaction.

246-260: Fix undefined transferIx and missing Transaction import in Send Payments SPL compare.

The SPL comparison snippet at line 260 has the same issue: it calls new Transaction().add(createAtaIx, transferIx) but never defines transferIx or imports Transaction. Additionally, the preceding SPL code at lines 233–241 uses the high-level transfer() function, not instruction-level calls, making the subsequent instruction pattern inconsistent.

Clarify the example by either showing the complete instruction-level SPL pattern with proper imports, or simplifying to a conceptual note:

+import { Transaction } from "@solana/web3.js";
 import {
   getAssociatedTokenAddressSync,
   createAssociatedTokenAccountIdempotentInstruction,
 } from "@solana/spl-token";
 
 const destinationAta = getAssociatedTokenAddressSync(mint, recipient);
 const createAtaIx = createAssociatedTokenAccountIdempotentInstruction(
   payer.publicKey,
   destinationAta,
   recipient,
   mint
 );
 
-new Transaction().add(createAtaIx, transferIx);
+// Construct and add your SPL transfer instruction to complete the transaction.
c-token-program/README.mdx (1)

7-8: Remove unused imports.

Lines 7–8 import GuidesTable and AdvancedGuidesTable, but these components are never rendered in the document. Only CMintGuidesTable and CTokenGuidesTable are used. Remove these two import lines to keep the file clean.

-import GuidesTable from '/snippets/overview-tables/compressed-tokens-guides-table.mdx';
-import AdvancedGuidesTable from '/snippets/overview-tables/compressed-tokens-advanced-guides-table.mdx';
 import SetupEnvironment from '/snippets/setup/setup-environment-tabs.mdx';
snippets/compressible-rent-explained.mdx (1)

5-5: Hyphenate compound adjective: "on chain" → "on-chain".

Line 5 uses "on chain" as a compound adjective modifying "state"; per English grammar rules, this should be hyphenated as "on-chain" when preceding the noun.

- Compressed state is stored in leaves of Merkle trees (≃ disk). light-token accounts are Solana accounts that store state on chain (≃ RAM).
+ Compressed state is stored in leaves of Merkle trees (≃ disk). light-token accounts are Solana accounts that store state on-chain (≃ RAM).
🧹 Nitpick comments (2)
c-token-program/cmint/create-cmint.mdx (1)

65-65: Minor style improvement: add hyphen for compound adjective.

The static analysis tool suggests using a hyphen to join "128 byte" when used as a compound adjective before "zero-knowledge proofs." Consider updating to "128-byte zero-knowledge proofs" for better readability.

-2. Fetch a <Tooltip tip="Validity proofs are 128 byte zero-knowledge proofs (ZKP). Your RPC generates the validity proof for you.">validity proof</Tooltip> from your RPC that proves the address does not exist yet.
+2. Fetch a <Tooltip tip="Validity proofs are 128-byte zero-knowledge proofs (ZKP). Your RPC generates the validity proof for you.">validity proof</Tooltip> from your RPC that proves the address does not exist yet.
c-token-program/c-token-toolkits/for-payments.mdx (1)

7-7: Remove unused import.

CodeCompare is imported but never used in this file. Remove the unused import to keep the code clean.

-import { CodeCompare } from '/snippets/jsx/code-compare.jsx';
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2592bbf and 5855a47.

📒 Files selected for processing (33)
  • c-token-program/README.mdx (1 hunks)
  • c-token-program/c-token-toolkits/for-launchpads.mdx (1 hunks)
  • c-token-program/c-token-toolkits/for-payments.mdx (1 hunks)
  • c-token-program/c-token-toolkits/for-streaming-mints.mdx (1 hunks)
  • c-token-program/c-token-toolkits/for-streaming-tokens.mdx (1 hunks)
  • c-token-program/c-token-toolkits/for-trading-apps.mdx (1 hunks)
  • c-token-program/c-token-toolkits/for-wallets.mdx (1 hunks)
  • c-token-program/cmint/README.mdx (1 hunks)
  • c-token-program/cmint/create-cmint.mdx (1 hunks)
  • c-token-program/cmint/mint-ctokens.mdx (1 hunks)
  • c-token-program/ctoken-faq.mdx (1 hunks)
  • c-token-program/ctoken/close-ctoken-account.mdx (1 hunks)
  • c-token-program/ctoken/create-cata.mdx (1 hunks)
  • c-token-program/ctoken/create-ctoken.mdx (1 hunks)
  • c-token-program/ctoken/extensions.mdx (1 hunks)
  • c-token-program/ctoken/transfer-interface.mdx (1 hunks)
  • snippets/accounts-list/close-account-infos-accounts-list.mdx (1 hunks)
  • snippets/accounts-list/cmint-to-ctoken-accounts-list.mdx (1 hunks)
  • snippets/accounts-list/ctoken-create-accounts-list-client.mdx (1 hunks)
  • snippets/accounts-list/ctoken-create-accounts-list.mdx (1 hunks)
  • snippets/accounts-list/ctoken-create-ata-accounts-list.mdx (1 hunks)
  • snippets/accounts-list/transfer-interface-accounts-list-ctoken-1.mdx (1 hunks)
  • snippets/accounts-list/transfer-interface-accounts-list-spl-2.mdx (1 hunks)
  • snippets/compressible-rent-explained.mdx (1 hunks)
  • snippets/ctoken-configure-rent.mdx (1 hunks)
  • snippets/ctoken-guides/cata-intro.mdx (1 hunks)
  • snippets/ctoken-guides/close-intro.mdx (1 hunks)
  • snippets/ctoken-guides/ctoken-intro.mdx (1 hunks)
  • snippets/ctoken-guides/ctoken-ts-client-prerequisites.mdx (1 hunks)
  • snippets/ctoken-guides/transfer-interface-intro.mdx (1 hunks)
  • snippets/overview-tables/cmint-guides-table.mdx (1 hunks)
  • snippets/overview-tables/ctoken-guides-table.mdx (1 hunks)
  • snippets/overview-tables/integrate-ctoken-guides-table.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (21)
  • c-token-program/ctoken/close-ctoken-account.mdx
  • c-token-program/c-token-toolkits/for-wallets.mdx
  • c-token-program/ctoken/extensions.mdx
  • c-token-program/ctoken/create-ctoken.mdx
  • snippets/overview-tables/cmint-guides-table.mdx
  • c-token-program/ctoken-faq.mdx
  • snippets/accounts-list/close-account-infos-accounts-list.mdx
  • snippets/accounts-list/transfer-interface-accounts-list-spl-2.mdx
  • c-token-program/ctoken/create-cata.mdx
  • snippets/ctoken-guides/transfer-interface-intro.mdx
  • c-token-program/c-token-toolkits/for-launchpads.mdx
  • c-token-program/ctoken/transfer-interface.mdx
  • snippets/accounts-list/cmint-to-ctoken-accounts-list.mdx
  • snippets/ctoken-guides/ctoken-intro.mdx
  • snippets/overview-tables/ctoken-guides-table.mdx
  • snippets/accounts-list/ctoken-create-accounts-list.mdx
  • snippets/accounts-list/transfer-interface-accounts-list-ctoken-1.mdx
  • snippets/accounts-list/ctoken-create-ata-accounts-list.mdx
  • snippets/accounts-list/ctoken-create-accounts-list-client.mdx
  • snippets/overview-tables/integrate-ctoken-guides-table.mdx
  • snippets/ctoken-guides/close-intro.mdx
🧰 Additional context used
🪛 LanguageTool
c-token-program/c-token-toolkits/for-streaming-tokens.mdx

[grammar] ~10-~10: Use a hyphen to join words.
Context: ...t prepend an idempotent decompress "warm up" instruction. ```rust import { creat...

(QB_NEW_EN_HYPHEN)

c-token-program/cmint/create-cmint.mdx

[grammar] ~65-~65: Use a hyphen to join words.
Context: ...mint signer and address tree 2. Fetch a <Tooltip tip="Validity proofs are 128 byte zero-knowledge proofs (ZKP). Your R...

(QB_NEW_EN_HYPHEN)

c-token-program/cmint/README.mdx

[uncategorized] ~35-~35: The official name of this software platform is spelled with a capital “H”.
Context: ...e for ### Examples add github link # Next Steps Fo...

(GITHUB)

snippets/compressible-rent-explained.mdx

[grammar] ~5-~5: Use a hyphen to join words.
Context: ...nsor. 4. Transfers to inactive accounts <Tooltip tip="Compressed state is stored in leaves of Merkle trees (≃ disk). light-token accounts are Solana accounts that store state on chain (≃ RAM). Load means to load state ...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (11)
snippets/ctoken-guides/ctoken-ts-client-prerequisites.mdx (1)

1-14: > Likely an incorrect or invalid review comment.

c-token-program/cmint/create-cmint.mdx (4)

379-642: Code examples are well-structured and properly documented.

The full code example demonstrates three distinct patterns for creating compressed mints:

  • process_create_cmint() using invoke() with external signer
  • process_create_cmint_invoke_signed() with PDA mint signer
  • process_create_cmint_with_pda_authority() with both PDA signers

Inline comments clearly document account ordering and use cases. Structure aligns well with the step-by-step guide above.


654-654: No action needed — link target exists. The file c-token-program/cmint/mint-ctokens.mdx exists and the link is valid.


6-9: All four snippet imports are correctly resolved and exist in the repository.


15-15: Internal link is valid.

The file c-token-program/README.mdx exists and contains the core concepts documentation for the light-token Program (titled "Overview" with description detailing the light-token standard). The link is correct.

c-token-program/c-token-toolkits/for-trading-apps.mdx (1)

1-5: > Likely an incorrect or invalid review comment.

c-token-program/cmint/mint-ctokens.mdx (3)

61-277: Well-structured Rust Client documentation with comprehensive examples.

The Rust Client tab now contains detailed, well-commented code examples including prerequisites, step-by-step instructions, and a helper function create_compressed_mint. The examples clearly demonstrate both the SDK builder pattern and direct account handling. Account index comments (e.g., lines 427–440) make the code maintainable.


279-569: Program Guide section is clear and well-organized.

The Program Guide provides good separation of concerns: parameter configuration, system accounts with accordion reference, and dual invoke patterns (external signer vs. PDA authority). The account list accordion and full code example with both invoke() and invoke_signed() handlers cover the main use cases. Documentation of account ordering (lines 427–440, 495–508) is thorough.


571-580: Verify Next Steps navigation link.

The card on line 577 links to /c-token-program/ctoken/transfer-interface. Ensure this route exists in the documentation structure to avoid broken internal links.

snippets/ctoken-configure-rent.mdx (1)

1-41: LGTM!

The Rust code block and account table are well-structured and accurate. The Tooltip components correctly describe the CompressibleParamsInfos parameters and their roles in the program.

snippets/ctoken-guides/cata-intro.mdx (1)

1-11: LGTM!

Clear and well-structured introduction to light-ATAs. The three bullet points concisely explain the key concepts, and the accordion properly gates the detailed rent explanation while the default config snippet follows logically. All imports are used correctly.

Comment on lines +126 to +176
<Tab title="Instruction">
```typescript
import {
createAssociatedTokenAccountInterfaceIdempotentInstruction,
createLoadAtaInstructions,
getAssociatedTokenAddressInterface,
} from "@lightprotocol/compressed-token/unified";
import { CTOKEN_PROGRAM_ID } from "@lightprotocol/stateless.js";

const ata = getAssociatedTokenAddressInterface(mint, recipient);

const tx = new Transaction().add(
createAssociatedTokenAccountInterfaceIdempotentInstruction(
payer.publicKey,
ata,
recipient,
mint,
CTOKEN_PROGRAM_ID
),
...(await createLoadAtaInstructions(
rpc,
ata,
recipient,
mint,
payer.publicKey
))
);
```

<Accordion title="Compare to SPL">

```typescript
import {
createAssociatedTokenAccountInstruction,
getAssociatedTokenAddressSync,
} from "@solana/spl-token";

const ata = getAssociatedTokenAddressSync(mint, recipient);

const tx = new Transaction().add(
createAssociatedTokenAccountInstruction(
payer.publicKey,
ata,
recipient,
mint
)
);
```

</Accordion>
</Tab>
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

Add missing Transaction import in Receive Payments Instruction tab.

Line 137 instantiates new Transaction(), but the code block lacks an import for Transaction from @solana/web3.js.

 import {
   createAssociatedTokenAccountInterfaceIdempotentInstruction,
   createLoadAtaInstructions,
   getAssociatedTokenAddressInterface,
 } from "@lightprotocol/compressed-token/unified";
 import { CTOKEN_PROGRAM_ID } from "@lightprotocol/stateless.js";
+import { Transaction } from "@solana/web3.js";
🤖 Prompt for AI Agents
In c-token-program/c-token-toolkits/for-payments.mdx around lines 126 to 176,
the "Instruction" code block uses new Transaction() but doesn't import
Transaction; update the top import list of that code block to include the
Transaction symbol from @solana/web3.js (i.e., add a named import for
Transaction alongside the existing imports) so the example compiles and clearly
shows all required imports.

- Move all c-token-program docs to light-token/
- Update all internal links to new structure
- Fix 38 broken links across 19 files
- Update navigation paths in docs.json
- Rename learn/c-token-program.mdx to learn/light-token.mdx

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

♻️ Duplicate comments (17)
light-token/toolkits/for-streaming-tokens.mdx (2)

10-10: Hyphenate compound adjective "warm-up".

Use a hyphen when "warm up" modifies the noun "instruction."

-Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm up" instruction.
+Your indexer should keep tracking, quoting, and routing markets even if the on-chain account shows `is_initialized: false`, `is_compressed: true`. To trade a cold market, the first client must prepend an idempotent decompress "warm-up" instruction.

12-24: Fix code fence language identifier.

The code block contains TypeScript/JavaScript syntax (import statement, await, const) but is marked with a rust language identifier, which will cause incorrect syntax highlighting. Change it to typescript.

-```rust
+```typescript
 import { createLoadAtaInstructions } from "@lightprotocol/compressed-token/unified";
 
 const warmupIxs = await createLoadAtaInstructions(
   rpc,
   tokenAccount,
   owner,
   mint,
   payer
 );
 
 new Transaction().add(...warmupIxs, tradeIx);

</blockquote></details>
<details>
<summary>learn/light-token.mdx (2)</summary><blockquote>

`87-87`: **Add missing comma in `CompressedMint` struct after `metadata` field.**

```diff
  pub struct CompressedMint {
      // SPL mint layout
      pub base: BaseMint,
      // c-Mint state used by the Compressed Token Program
-     pub metadata: CompressedMintMetadata
+     pub metadata: CompressedMintMetadata,
      // Field for Token Metadata extension
      pub extensions: Option<Vec<ExtensionStruct>>,
  }

282-282: Hyphenate compound adjective: "top ups" → "top-ups".

Per standard English grammar, "top-ups" should be hyphenated when used as a modifier or noun.

-We recommend to use default values, but you can customize prepaid rent and top ups:
+We recommend to use default values, but you can customize prepaid rent and top-ups:
snippets/overview-tables/ctoken-guides-table.mdx (1)

1-6: Add missing table header row.

The markdown table is missing a proper header row with column titles. Line 1 shows empty cells | | | instead of headers like | Guide | Description |. This will cause incorrect table rendering.

Add a proper header row before the current separator:

+| Guide | Description |
 |  |  |
 | :---- | :---------- |
light-token/cookbook/create-mint.mdx (1)

112-112: Fix typo in code comment.

The comment reads "Create c-int" which should be "Create c-Mint".

-    // Create c-int with metadata
+    // Create c-Mint with metadata
light-token/cookbook/transfer-interface.mdx (1)

8-8: Remove unused import.

The import TransferInterfaceIntro on line 8 is not used anywhere in the file and should be removed.

 import TransferInterfaceAccountsListCtoken1 from '/snippets/accounts-list/transfer-interface-accounts-list-ctoken-1.mdx';
 import TransferInterfaceAccountsListSpl2 from '/snippets/accounts-list/transfer-interface-accounts-list-spl-2.mdx';
-import TransferInterfaceIntro from '/snippets/ctoken-guides/transfer-interface-intro.mdx';
 import CTokenClientPrerequisites from '/snippets/ctoken-guides/ctoken-client-prerequisites.mdx';
light-token/toolkits/for-payments.mdx (3)

127-152: Add missing Transaction import in Instruction tab.

The code block on line 137 instantiates new Transaction(), but the imports don't include Transaction from @solana/web3.js.

 import {
   createAssociatedTokenAccountInterfaceIdempotentInstruction,
   createLoadAtaInstructions,
   getAssociatedTokenAddressInterface,
 } from "@lightprotocol/compressed-token/unified";
 import { CTOKEN_PROGRAM_ID } from "@lightprotocol/stateless.js";
+import { Transaction } from "@solana/web3.js";

214-223: Define missing transferIx variable.

The code on line 222 calls new Transaction().add(createAtaIx, transferIx) but transferIx is never defined. Either construct the instruction or remove this line.

Consider showing how to construct transferIx using SDK functions:

 const createAtaIx = createAssociatedTokenAccountInterfaceIdempotentInstruction(
   payer.publicKey,
   destinationAta,
   recipient,
   mint,
   CTOKEN_PROGRAM_ID
 );

-new Transaction().add(createAtaIx, transferIx);
+const transferIx = createTransferInterfaceInstruction(
+  sourceAta,
+  destinationAta,
+  owner.publicKey,
+  amount
+);
+new Transaction().add(createAtaIx, transferIx);

Or remove the line and add a comment explaining where the transfer instruction should be added.


247-261: Define missing transferIx in SPL comparison code.

The SPL comparison code on line 260 similarly calls new Transaction().add(createAtaIx, transferIx) but transferIx is never defined in this block.

blog/c-token.mdx (6)

18-18: Replace XXX placeholder with actual statistic or remove.

Line 18 contains the placeholder "XXX" for daily token account creation count. Replace with a verified statistic (including source) or rephrase to avoid placeholder text.

-At the moment around XXX token accounts over 20k mint accounts are created on a daily basis.
+At the moment around [VERIFIED_NUMBER] token accounts over 20k mint accounts are created on a daily basis.
+<!-- Replace [VERIFIED_NUMBER] with actual statistic from [source] -->

Or remove the specific count:

-At the moment around XXX token accounts over 20k mint accounts are created on a daily basis.
+Many token accounts and mint accounts are created daily without being fully utilized.

72-72: Add actual link or remove incomplete reference.

Line 72 contains "You can view the source code here." without a clickable link. Either add a proper Markdown link to the source code repository or remove the sentence.

-You can view the source code here.
+You can view the source code [here](https://github.com/Lightprotocol/light-protocol).

Or remove the sentence if the link is not available.


85-85: Fix spelling error.

The word "initalized" on line 85 should be "initialized" (with three 'i's).

-The token accounts is initalized and funded with initial rent.
+The token accounts is initialized and funded with initial rent.

92-92: Add actual link or remove incomplete reference.

Line 92 contains "You can view the source code here." without a clickable link. This repeats the same pattern as line 72. Either add a proper Markdown link or remove the sentence.

-You can view the source code here.
+You can view the source code [here](https://github.com/Lightprotocol/light-protocol).

94-98: Clarify contradictory statement about extensions.

The text states extensions "are under development and are currently implemented," which is contradictory. Extensions cannot be both in development and already fully implemented.

Clarify the actual status:

 ### Extensions
 
-Extensions are under development and are currently implemented. 
-Additional extensions can be requested.
+Extensions are currently under development. Additional extensions can be requested.

127-127: Add Telegram link or provide alternative contact method.

Line 127 references "Get in touch on telegram for help!" but doesn't provide a clickable link. Add the Telegram channel URL or alternative contact method.

-Get in touch on telegram for help!
+Get in touch on [Telegram](https://t.me/your_channel) for help!

Or provide an alternative contact method (Discord, email, support page).

light-token/cookbook/mint-tokens.mdx (1)

10-10: Remove unused import (previously flagged).

The import of ClientCustomRentConfig (line 10) is not used in this document and was flagged in previous reviews. Please remove this unused import to keep the file clean.

#!/bin/bash
# Verify the import is unused
grep -n "ClientCustomRentConfig" light-token/cookbook/mint-tokens.mdx | grep -v "^[0-9]*:import"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5855a47 and c7ec4cf.

📒 Files selected for processing (25)
  • blog/c-token.mdx (1 hunks)
  • compressed-tokens/README.mdx (1 hunks)
  • docs.json (5 hunks)
  • learn/light-token.mdx (1 hunks)
  • light-token/README.mdx (1 hunks)
  • light-token/cookbook/close-token-account.mdx (1 hunks)
  • light-token/cookbook/create-ata.mdx (1 hunks)
  • light-token/cookbook/create-mint.mdx (1 hunks)
  • light-token/cookbook/create-token-account.mdx (1 hunks)
  • light-token/cookbook/extensions.mdx (1 hunks)
  • light-token/cookbook/mint-tokens.mdx (1 hunks)
  • light-token/cookbook/transfer-interface.mdx (1 hunks)
  • light-token/faq.mdx (1 hunks)
  • light-token/toolkits/for-dexs.mdx (1 hunks)
  • light-token/toolkits/for-launchpads.mdx (1 hunks)
  • light-token/toolkits/for-payments.mdx (1 hunks)
  • light-token/toolkits/for-streaming-mints.mdx (1 hunks)
  • light-token/toolkits/for-streaming-tokens.mdx (1 hunks)
  • light-token/toolkits/for-trading-apps.mdx (1 hunks)
  • light-token/toolkits/for-wallets.mdx (1 hunks)
  • snippets/ctoken-guides/transfer-interface-intro.mdx (1 hunks)
  • snippets/overview-tables/cmint-guides-table.mdx (1 hunks)
  • snippets/overview-tables/ctoken-guides-table.mdx (1 hunks)
  • snippets/overview-tables/integrate-ctoken-guides-table.mdx (1 hunks)
  • welcome.mdx (3 hunks)
✅ Files skipped from review due to trivial changes (9)
  • light-token/toolkits/for-launchpads.mdx
  • light-token/cookbook/extensions.mdx
  • light-token/toolkits/for-wallets.mdx
  • light-token/toolkits/for-dexs.mdx
  • light-token/faq.mdx
  • light-token/toolkits/for-trading-apps.mdx
  • light-token/toolkits/for-streaming-mints.mdx
  • light-token/cookbook/close-token-account.mdx
  • light-token/README.mdx
🚧 Files skipped from review as they are similar to previous changes (3)
  • snippets/ctoken-guides/transfer-interface-intro.mdx
  • compressed-tokens/README.mdx
  • snippets/overview-tables/integrate-ctoken-guides-table.mdx
🧰 Additional context used
🪛 LanguageTool
light-token/toolkits/for-streaming-tokens.mdx

[grammar] ~10-~10: Use a hyphen to join words.
Context: ...t prepend an idempotent decompress "warm up" instruction. ```rust import { creat...

(QB_NEW_EN_HYPHEN)

blog/c-token.mdx

[style] ~13-~13: ‘at a fraction of’ might be wordy. Consider a shorter alternative.
Context: ...on, you can create mints and tokens 1. at a fraction of the cost, 2. with improved performance,...

(EN_WORDINESS_PREMIUM_AT_A_FRACTION_OF)


[style] ~18-~18: ‘on a daily basis’ might be wordy. Consider a shorter alternative.
Context: ...unts over 20k mint accounts are created on a daily basis. Many are created and rarely accessed. ...

(EN_WORDINESS_PREMIUM_ON_A_DAILY_BASIS)


[grammar] ~85-~85: Ensure spelling is correct
Context: ...cleVisualizer /> The token accounts is initalized and funded with initial rent. When rent...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

learn/light-token.mdx

[grammar] ~282-~282: Use a hyphen to join words.
Context: ...t you can customize prepaid rent and top ups: # ...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (12)
learn/light-token.mdx (1)

345-345: The card link destination path is valid and correctly configured.

The href /light-token/cookbook/create-token-account maps to an existing and properly structured file at light-token/cookbook/create-token-account.mdx with appropriate metadata (title: "Create Light-Token Account"). The path aligns with the light-token documentation structure and requires no changes.

welcome.mdx (1)

1-254: LGTM!

The restructuring effectively prioritizes the Light-Token Standard as the primary feature while maintaining clear pathways to Compressed PDAs and Tokens. The new creation cost comparison table and reorganized feature cards provide better user guidance. Links and references are consistent throughout.

light-token/toolkits/for-payments.mdx (1)

56-56: Replace placeholder text.

Line 56 contains placeholder content "ADD mint for light-token accounts EXAMPLE" that should be removed or replaced with actual documentation.

-ADD mint for light-token accounts EXAMPLE
-
-
-The example transfers SPL tokens to light-token accounts and light-tokens between light-token accounts:
+The example transfers SPL tokens to light-token accounts and light-tokens between light-token accounts:

Likely an incorrect or invalid review comment.

light-token/cookbook/create-ata.mdx (3)

50-101: TypeScript and Rust client examples are well-structured.

The step-by-step approach with both "Action" and "Instruction" tabs in the TypeScript section (lines 47-104) provides clear alternatives for developers. The idempotent instruction pattern with createLoadAtaInstructions is a good best practice to showcase.


142-254: Rust client test example is comprehensive.

The Rust test function (lines 155-192) properly demonstrates account creation, verification, and assertion checks. The helper function create_compressed_mint (lines 193-253) includes necessary details like validity proof fetching and address derivation—good reference material.


285-327: CPI invoke/invoke_signed patterns are correctly documented.

Lines 284–327 clearly show both invoke() and invoke_signed() approaches with proper account ordering and PDA derivation. The inline account comments (lines 352–359) help developers understand the expected structure.

light-token/cookbook/mint-tokens.mdx (2)

59-274: Rust Client tab demonstrates proper compressed account handling.

The Rust client example (lines 59–274) shows all critical steps: mint creation, account derivation, validity proof generation, and instruction building. The create_compressed_mint helper (lines 211–271) properly includes tree queries and proof handling. The test assertions (lines 206–209) validate state correctly.


397-565: Full code example properly structures CPI invocation with account validation.

The handler functions process_mint_to_ctoken (lines 439–486) and process_mint_to_ctoken_invoke_signed (lines 507–564) demonstrate:

  • Correct account index mapping with detailed comments
  • Proper PDA derivation and validation in invoke_signed variant
  • System account struct construction
  • Both invoke patterns clearly shown

Good reference implementation with helpful comments.

docs.json (4)

62-104: Compressed Tokens section paths corrected from previous issues.

The reorganized structure correctly uses "compressed-tokens/guides/" and "compressed-tokens/advanced-guides/" prefixes. The "Implementation Guides" grouping (lines 81–103) with nested Integration and Examples subgroups provides good UX organization.


455-466: Blog tab added with minimal but valid structure.

The new Blog tab (lines 455–466) references blog/README and blog/c-token, both of which exist as blog/README.mdx and blog/c-token.mdx.


536-541: Redirect destination exists and is properly configured.

The redirect from /landing to /welcome is valid JSON and the destination page exists at welcome.mdx.


31-60: Light-Token Standard (Beta) section properly structured.

The new Light-Token section (lines 31–60) includes cookbook and toolkits with a clean, organized hierarchy. All 15 referenced documentation files exist: 2 root-level pages (README, faq), 6 cookbook pages (create-mint, create-ata, create-token-account, mint-tokens, transfer-interface, close-token-account), and 7 toolkit pages (for-payments, for-wallets, for-dexs, for-launchpads, for-trading-apps, for-streaming-mints, for-streaming-tokens). The toolkits subsection correctly uses "expanded": true for default visibility.

Comment on lines +7 to +14
import CTokenCreateATAAccountsList from '/snippets/accounts-list/ctoken-create-ata-accounts-list.mdx';
import CompressibleVsSolanaRent from '/snippets/compressible-vs-solana-rent.mdx';
import CTokenConfigureRent from '/snippets/ctoken-configure-rent.mdx';
import CAtaIntro from '/snippets/ctoken-guides/cata-intro.mdx';
import CompressibleRentExplained from '/snippets/compressible-rent-explained.mdx';
import CTokenClientPrerequisites from '/snippets/ctoken-guides/ctoken-client-prerequisites.mdx';
import CTokenTsClientPrerequisites from '/snippets/ctoken-guides/ctoken-ts-client-prerequisites.mdx';
import ClientCustomRentConfig from '/snippets/ctoken-guides/client-custom-rent-config.mdx';
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

🏁 Script executed:

grep -n "ClientCustomRentConfig" light-token/cookbook/create-ata.mdx

Repository: Lightprotocol/docs-v2

Length of output: 159


Remove unused import on line 14.

The import ClientCustomRentConfig is not used anywhere in this file. Remove it to keep the file clean.

🤖 Prompt for AI Agents
In light-token/cookbook/create-ata.mdx around lines 7 to 14, the import
ClientCustomRentConfig on line 14 is unused; remove that import line to clean up
unused imports and avoid lint warnings, leaving the other imports intact.

@@ -0,0 +1,656 @@
---
title: Create Mint Account wih Token Metadata
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

Fix typo in frontmatter title.

The page title contains a typo: "wih" should be "with".

-title: Create Mint Account wih Token Metadata
+title: Create Mint Account with Token Metadata
📝 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
title: Create Mint Account wih Token Metadata
title: Create Mint Account with Token Metadata
🤖 Prompt for AI Agents
light-token/cookbook/create-mint.mdx around line 2: fix the typo in the
frontmatter title by replacing "Create Mint Account wih Token Metadata" with
"Create Mint Account with Token Metadata" so the word "with" is spelled
correctly in the page title.

Comment on lines +1 to +5
| | |
| :---- | :---------- |
| [Create light-mint](/light-token/cookbook/create-mint) | Program and client guide to create light-mints with token metadata |
| [Mint light-tokens](/light-token/cookbook/mint-tokens) | Mint light-tokens to light-mint accounts |
| [Update Metadata](/light-token/cookbook/update-metadata) | Update token metadata fields and authority |
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Add missing table header row.

The markdown table is missing a proper header row with column titles. Line 1 shows empty cells | | | instead of headers like | Guide | Description |. This will cause incorrect table rendering.

Add a proper header row before the current separator:

+| Guide | Description |
 |  |  |
 | :---- | :---------- |
📝 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
| | |
| :---- | :---------- |
| [Create light-mint](/light-token/cookbook/create-mint) | Program and client guide to create light-mints with token metadata |
| [Mint light-tokens](/light-token/cookbook/mint-tokens) | Mint light-tokens to light-mint accounts |
| [Update Metadata](/light-token/cookbook/update-metadata) | Update token metadata fields and authority |
| Guide | Description |
| :---- | :---------- |
| [Create light-mint](/light-token/cookbook/create-mint) | Program and client guide to create light-mints with token metadata |
| [Mint light-tokens](/light-token/cookbook/mint-tokens) | Mint light-tokens to light-mint accounts |
| [Update Metadata](/light-token/cookbook/update-metadata) | Update token metadata fields and authority |
🤖 Prompt for AI Agents
In snippets/overview-tables/cmint-guides-table.mdx around lines 1 to 5, the
markdown table is missing a header row (line 1 has empty cells), which breaks
rendering; insert a header row such as "Guide | Description" immediately before
the existing separator row so the table becomes "| Guide | Description |"
followed by the existing "| :---- | :---------- |" and the three content rows.

- Add light-token/toolkits/README with toolkit cards
- Add toolkit-card.jsx component for consistent styling
- Update guide titles and descriptions for clarity
- Flatten cookbook navigation structure in docs.json
- Improve light-token README description

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
light-token/toolkits/README.mdx (2)

1-5: Add a description to improve SEO and navigation.

The description field is empty. Adding a brief description will improve search engine optimization and help users understand the page content from navigation tooltips.

Apply this diff:

 ---
 title: Overview to Toolkits
 sidebarTitle: Overview
-description:
+description: Explore Light Token toolkits for payments, wallets, DEXs, launchpads, trading apps, and streaming applications.
 ---

18-41: Use the ToolkitCard component instead of inline styled markup.

The inline styled card duplicates content from the table and bypasses the reusable ToolkitCard component (added in snippets/jsx/toolkit-card.jsx). Using the component improves maintainability and consistency.

Replace the inline styled card with the ToolkitCard component:

+import { ToolkitCard } from '/snippets/jsx/toolkit-card.jsx';
+
-<a href="/light-token/toolkits/for-payments" style={{ textDecoration: 'none', color: 'inherit', display: 'block' }}>
-  <div style={{
-    display: 'flex',
-    border: '1px solid rgba(128,128,128,0.2)',
-    borderRadius: '8px',
-    overflow: 'hidden',
-    marginBottom: '1rem'
-  }}>
-    <div style={{ flex: 1, padding: '1.5rem', borderRight: '1px solid rgba(128,128,128,0.2)' }}>
-      <div style={{ fontSize: '1.25rem', fontWeight: 600, marginBottom: '0.5rem' }}>Stablecoin Payments</div>
-      <div style={{ opacity: 0.8 }}>Integrate light-token APIs with familiar SPL patterns.</div>
-    </div>
-    <div style={{ flex: 1, padding: '1.5rem' }}>
-      <div style={{ fontSize: '0.875rem', fontWeight: 600, marginBottom: '0.75rem', opacity: 0.7 }}>What's inside</div>
-      <ul style={{ margin: 0, paddingLeft: '1.25rem', fontSize: '0.875rem' }}>
-        <li>Receive Payments</li>
-        <li>Send Payments</li>
-        <li>Show Balance</li>
-        <li>Transaction History</li>
-        <li>Unwrap to SPL</li>
-      </ul>
-    </div>
-  </div>
-</a>
+<ToolkitCard
+  title="Stablecoin Payments"
+  description="Integrate light-token APIs with familiar SPL patterns."
+  href="/light-token/toolkits/for-payments"
+  items={[
+    "Receive Payments",
+    "Send Payments",
+    "Show Balance",
+    "Transaction History",
+    "Unwrap to SPL"
+  ]}
+/>
snippets/jsx/toolkit-card.jsx (1)

1-21: Consider adding prop validation.

The component accepts four props but has no validation. Adding PropTypes (or migrating to TypeScript) would catch incorrect usage at development time and serve as inline documentation.

Add PropTypes at the end of the file:

import PropTypes from 'prop-types';

export const ToolkitCard = ({ title, description, href, items }) => {
  // ... existing code
};

ToolkitCard.propTypes = {
  title: PropTypes.string.isRequired,
  description: PropTypes.string.isRequired,
  href: PropTypes.string.isRequired,
  items: PropTypes.arrayOf(PropTypes.string).isRequired
};
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7ec4cf and 9d38fbd.

📒 Files selected for processing (4)
  • docs.json (5 hunks)
  • light-token/README.mdx (1 hunks)
  • light-token/toolkits/README.mdx (1 hunks)
  • snippets/jsx/toolkit-card.jsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • light-token/README.mdx
🔇 Additional comments (1)
docs.json (1)

14-17: Add explicit Devnet safety warnings to the light-token/README.mdx.

The banner link path resolves correctly to /light-token/README, but the target document lacks critical safety information. Add warnings at the top of the README to explicitly state:

  • Devnet tokens have NO REAL VALUE and cannot transfer to Mainnet
  • Devnet ledger resets may result in loss of test tokens
  • These tokens are for testing and development only
  • Include progression guidance (develop on localnet → test on devnet → deploy to mainnet)

Comment on lines +14 to +17
"banner": {
"content": "Light Token is live on Devnet. <a href=\"/light-token/README\" style=\"color:#FFFFFF; text-decoration: underline;\">Start testing and create mints or tokens</a> without rent-exemption!",
"dismissible": false
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix banner href to use correct index route path.

The banner href points to /light-token/README, but in Mintlify's routing convention, README.mdx files serve as index routes at the folder path. The correct href should be /light-token.

Apply this diff:

   "banner": {
-    "content": "Light Token is live on Devnet. <a href=\"/light-token/README\" style=\"color:#FFFFFF; text-decoration: underline;\">Start testing and create mints or tokens</a> without rent-exemption!",
+    "content": "Light Token is live on Devnet. <a href=\"/light-token\" style=\"color:#FFFFFF; text-decoration: underline;\">Start testing and create mints or tokens</a> without rent-exemption!",
     "dismissible": false
   },
📝 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
"banner": {
"content": "Light Token is live on Devnet. <a href=\"/light-token/README\" style=\"color:#FFFFFF; text-decoration: underline;\">Start testing and create mints or tokens</a> without rent-exemption!",
"dismissible": false
},
"banner": {
"content": "Light Token is live on Devnet. <a href=\"/light-token\" style=\"color:#FFFFFF; text-decoration: underline;\">Start testing and create mints or tokens</a> without rent-exemption!",
"dismissible": false
},
🤖 Prompt for AI Agents
In docs.json around lines 14 to 17, the banner's href currently points to
"/light-token/README" which is incorrect for Mintlify (README.mdx acts as the
folder index); update the banner.content string to replace the link target with
"/light-token" (i.e., change the anchor href to "/light-token") so the link
routes to the folder index, preserving the rest of the content and inline
styles.

tilo-14 and others added 3 commits December 11, 2025 17:09
- Update banner: Light Token → Light-Token Standard
- Add toolkits/README to navigation structure
- Refine light-token README description

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update cookbook examples for create-mint, mint-tokens, create-ata, etc.
- Improve code examples with better error handling
- Update navigation structure in docs.json
- Remove deprecated home.mdx
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 13

♻️ Duplicate comments (20)
light-token/cookbook/transfer-interface.mdx (1)

8-8: Remove unused imports.

The imports TransferInterfaceIntro (line 8) and ClientCustomRentConfig (line 11) are not used anywhere in the document. Remove them to keep imports clean.

 import TransferInterfaceAccountsListCtoken1 from '/snippets/accounts-list/transfer-interface-accounts-list-light-token-1.mdx';
 import TransferInterfaceAccountsListSpl2 from '/snippets/accounts-list/transfer-interface-accounts-list-spl-2.mdx';
-import TransferInterfaceIntro from '/snippets/light-token-guides/transfer-interface-intro.mdx';
 import CTokenClientPrerequisites from '/snippets/light-token-guides/light-token-client-prerequisites.mdx';
 import CTokenTsClientPrerequisites from '/snippets/light-token-guides/light-token-ts-client-prerequisites.mdx';
-import ClientCustomRentConfig from '/snippets/light-token-guides/client-custom-rent-config.mdx';

Also applies to: 11-11

snippets/jsx/code-compare.jsx (2)

1-12: Add missing React hook imports.

useState, useEffect, and useRef are used but not imported, causing a runtime error.

+import React, { useEffect, useRef, useState } from "react";
+
 export const CodeCompare = ({
   firstCode = "",
   secondCode = "",

138-147: Add missing dependencies to useEffect or memoize handlers.

handleMouseMove and handleMouseUp are referenced in the effect but missing from the dependency array. This can cause stale closures. Wrap handlers with useCallback or add them to deps.

light-token/cookbook/create-mint.mdx (1)

2-2: Fix typo in frontmatter title. The page title contains a typo: "wih" should be "with".

-title: Create Mint Account wih Token Metadata
+title: Create Mint Account with Token Metadata

Also applies to: 2-2

blog/c-token.mdx (6)

18-18: Remove "XXX" placeholder for token account statistics. This placeholder for daily account creation count needs either a verified statistic or should be removed/rephrased to avoid placeholder text.

Either replace "XXX" with a verified statistic (include source) or rephrase the sentence to avoid the placeholder (e.g., "Many token accounts are created daily and rarely accessed, still locking up SOL due to rent-exemption.").

Also applies to: 18-18


72-72: Complete the incomplete reference with an actual link. The sentence "You can view the source code here." lacks a clickable link.

Replace with a proper Markdown link to the repository or remove the sentence entirely. For example: You can view the source code [here](https://github.com/Lightprotocol/light-token-program).

Also applies to: 72-72


85-85: Fix spelling error: "initalized" → "initialized". The word should be spelled with three 'i's.

-The token accounts is initalized and funded with initial rent.
+The token accounts is initialized and funded with initial rent.

Also applies to: 85-85


92-92: Complete the second incomplete reference with an actual link. Like line 72, this sentence "You can view the source code here." lacks a clickable link.

Replace with a proper Markdown link or remove the sentence entirely.

Also applies to: 92-92


96-96: Clarify contradictory statement about extensions. The text states extensions "are under development and are currently implemented," which is contradictory.

Clarify the status: either "are under development" or "are currently implemented". For example: Extensions are currently under development. Additional extensions can be requested.

Also applies to: 96-96


127-127: Add clickable Telegram link or provide alternative contact method. The text references "Get in touch on telegram for help!" but doesn't provide a clickable link.

Add the Telegram channel URL (e.g., [Telegram](https://t.me/light_protocol)) or provide an alternative contact method with a proper link.

Also applies to: 127-127

compressed-tokens/README.mdx (2)

10-10: Remove unused import. The TokenAccountCompressedVsSpl component imported on line 10 is never used in this file.

-import { TokenAccountCompressedVsSpl } from '/snippets/jsx/token-account-compressed-vs-spl.jsx';

Also applies to: 10-10


12-14: Fix table formatting issues. The table has a misleading header ("Creation") that doesn't match the content (account types and costs), and line 14 contains a stray tab character before the lamport value.

-| Creation      | Solana    | Compressed         |
-| :------------- | :--------------------- | :---------------------- |
-| **Token Account** | 	~2,000,000 lamports          | **5,000** lamports     |
+| Account Type | Solana Cost | Compressed Cost |
+| :--- | :--- | :--- |
+| **Token Account** | ~2,000,000 lamports | **5,000** lamports |
light-token/cookbook/create-ata.mdx (1)

14-14: Remove unused import. The ClientCustomRentConfig component is imported but never used in this document.

-import ClientCustomRentConfig from '/snippets/light-token-guides/client-custom-rent-config.mdx';

Also applies to: 14-14

light-token/cookbook/mint-tokens.mdx (1)

10-10: Remove unused import. The ClientCustomRentConfig component is imported but never used in this document.

-import ClientCustomRentConfig from '/snippets/light-token-guides/client-custom-rent-config.mdx';

Also applies to: 10-10

docs.json (1)

14-17: Fix banner href to use correct index route path.

The banner href points to /light-token/README, but Mintlify's routing convention treats README.mdx files as folder-level index routes. The correct href should be /light-token.

Apply this diff:

  "banner": {
-   "content": "The Light-Token Standard is live on Devnet. <a href=\"/light-token/README\" style=\"color:#FFFFFF; text-decoration: underline;\">Start testing and create mints or tokens</a>!",
+   "content": "The Light-Token Standard is live on Devnet. <a href=\"/light-token\" style=\"color:#FFFFFF; text-decoration: underline;\">Start testing and create mints or tokens</a>!",
    "dismissible": false
  },
snippets/jsx/light-token-vs-spl-calculator.jsx (1)

18-21: Reconcile slider and input min values for accounts.

The slider minimum is set to 5000, but handleAccountsChange and the numeric input allow values as low as 1. When users enter values between 1-4999, the slider cannot reflect those values, creating inconsistent UX.

This issue was previously flagged. Either align the slider min to 1 or enforce 5000 across all inputs:

Option 1: Lower slider min to match input

               <input
                 type="range"
-                min="5000"
+                min="1"
                 max={ACCOUNTS_MAX}
-                step="5000"
+                step="1000"

Option 2: Raise validation and input min to match slider

   const handleAccountsChange = (value) => {
-    const num = Math.max(1, Math.min(1000000, Number.parseInt(value) || 1));
+    const num = Math.max(5000, Math.min(1000000, Number.parseInt(value) || 5000));
     setNumAccounts(num);
   };
                 <input
                   type="number"
-                  min="1"
+                  min="5000"

Also applies to: 74-75, 99-103

snippets/light-token-guides/client-custom-rent-config.mdx (2)

8-8: Fix grammar: hyphenate "top-ups".

Line 8 should use the hyphenated form "top-ups" instead of "top ups".

Apply this diff:

-2. Set the lamports per write a transaction payer will pay for top ups
+2. Set the lamports per write a transaction payer will pay for top-ups

11-26: Verify that SDK exports are publicly available.

The code references light_compressed_token_sdk::ctoken module exports (CompressibleParams, CreateCTokenAccount, ctoken_v1_config_pda, ctoken_v1_rent_sponsor_pda) that may not be part of the public API. Ensure these symbols are available in the SDK version users will be using.

Run the following script to check the SDK documentation:

#!/bin/bash
# Check if the SDK exports these symbols
rg -n 'pub.*ctoken_v1_config_pda|pub.*ctoken_v1_rent_sponsor_pda|pub.*CompressibleParams|pub.*CreateCTokenAccount' --type rust
snippets/jsx/compressible-rent-calculator.jsx (2)

1-6: Add missing React import.

The component uses useState without importing it, which will cause a runtime error.

Apply this diff:

+import React, { useState } from 'react';
+
 export const CompressibleRentCalculator = () => {
   const [hours, setHours] = useState(24);

15-16: Reconcile slider and input max values.

HOURS_MAX is 36 but handleHoursChange (lines 23-26) and the numeric input (lines 75-76) allow values up to 168. Similarly, LAMPORTS_MAX is 6400 but validation allows up to 100000 (lines 28-31, 131-132). When users enter values above the slider max, the slider cannot reflect those values, creating inconsistent UX.

Apply this diff to align all limits:

-  const HOURS_MAX = 36;
-  const LAMPORTS_MAX = 6400;
+  const HOURS_MAX = 168;
+  const LAMPORTS_MAX = 100000;

Then update slider steps for usability:

               <input
                 type="range"
                 min="0"
                 max={LAMPORTS_MAX}
-                step="100"
+                step="1000"

Also applies to: 23-26, 28-31, 100-103, 156-160

🧹 Nitpick comments (3)
snippets/jsx/code-compare.jsx (3)

45-50: Add error handling for clipboard API.

navigator.clipboard.writeText can fail (e.g., permissions denied, unsupported browser). Wrap in try-catch to avoid unhandled promise rejection.

 const handleCopy = () => {
   const visibleCode = sliderPercent > 50 ? firstCode : secondCode;
-  navigator.clipboard.writeText(visibleCode);
-  setCopied(true);
-  setTimeout(() => setCopied(false), 2000);
+  navigator.clipboard.writeText(visibleCode)
+    .then(() => {
+      setCopied(true);
+      setTimeout(() => setCopied(false), 2000);
+    })
+    .catch(() => {
+      // Silently fail or show error feedback
+    });
 };

70-77: Consider calling preventDefault() on touch events.

Without e.preventDefault(), touch interactions may also trigger page scrolling, leading to a janky UX when users drag the slider on mobile.

 const handleTouchMove = (e) => {
   if (!containerRef.current) return;
+  e.preventDefault();
   setHasInteracted(true);

149-161: Move icon components outside CodeCompare to avoid re-creation on each render.

CopyIcon and CheckIcon are stateless and don't depend on props or state. Defining them inside the component causes new function references every render, which can hurt performance and trigger unnecessary child re-renders.

+const CopyIcon = () => (
+  <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
+    <rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
+    <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
+  </svg>
+);
+
+const CheckIcon = () => (
+  <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
+    <polyline points="20 6 9 17 4 12"/>
+  </svg>
+);
+
 export const CodeCompare = ({

Then remove the definitions from inside the component body.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 998a84a and 66e24eb.

📒 Files selected for processing (36)
  • blog/c-token.mdx (1 hunks)
  • compressed-tokens/README.mdx (1 hunks)
  • docs.json (4 hunks)
  • learn/light-token-standard.mdx (1 hunks)
  • light-token/README.mdx (1 hunks)
  • light-token/cookbook/close-token-account.mdx (1 hunks)
  • light-token/cookbook/create-ata.mdx (1 hunks)
  • light-token/cookbook/create-mint.mdx (1 hunks)
  • light-token/cookbook/create-token-account.mdx (1 hunks)
  • light-token/cookbook/mint-tokens.mdx (1 hunks)
  • light-token/cookbook/transfer-interface.mdx (1 hunks)
  • light-token/faq.mdx (1 hunks)
  • rent.mdx (1 hunks)
  • resources/addresses-and-urls.mdx (3 hunks)
  • snippets/accounts-list/light-mint-system-accounts-list.mdx (1 hunks)
  • snippets/accounts-list/light-mint-to-light-token-accounts-list.mdx (1 hunks)
  • snippets/accounts-list/light-token-create-accounts-list-client.mdx (1 hunks)
  • snippets/accounts-list/light-token-create-accounts-list.mdx (1 hunks)
  • snippets/accounts-list/light-token-create-ata-accounts-list.mdx (1 hunks)
  • snippets/accounts-list/transfer-interface-accounts-list-light-token-1.mdx (1 hunks)
  • snippets/compressible-vs-solana-rent.mdx (1 hunks)
  • snippets/jsx/code-compare.jsx (1 hunks)
  • snippets/jsx/compressible-rent-calculator.jsx (1 hunks)
  • snippets/jsx/light-token-vs-spl-calculator.jsx (1 hunks)
  • snippets/jsx/token22-extensions-table.jsx (1 hunks)
  • snippets/light-token-configure-rent.mdx (1 hunks)
  • snippets/light-token-guides/cata-intro.mdx (1 hunks)
  • snippets/light-token-guides/client-custom-rent-config.mdx (1 hunks)
  • snippets/light-token-guides/close-intro.mdx (1 hunks)
  • snippets/light-token-guides/light-token-client-prerequisites.mdx (1 hunks)
  • snippets/light-token-guides/light-token-intro.mdx (1 hunks)
  • snippets/light-token-guides/light-token-ts-client-prerequisites.mdx (1 hunks)
  • snippets/light-token-guides/transfer-interface-intro.mdx (1 hunks)
  • snippets/overview-tables/integrate-light-token-guides-table.mdx (1 hunks)
  • snippets/overview-tables/light-mint-guides-table.mdx (1 hunks)
  • snippets/overview-tables/light-token-guides-table.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (9)
  • snippets/accounts-list/light-token-create-ata-accounts-list.mdx
  • snippets/accounts-list/light-token-create-accounts-list.mdx
  • snippets/accounts-list/light-mint-to-light-token-accounts-list.mdx
  • snippets/light-token-guides/close-intro.mdx
  • snippets/accounts-list/transfer-interface-accounts-list-light-token-1.mdx
  • snippets/light-token-guides/transfer-interface-intro.mdx
  • snippets/accounts-list/light-mint-system-accounts-list.mdx
  • snippets/light-token-guides/light-token-ts-client-prerequisites.mdx
  • snippets/overview-tables/light-token-guides-table.mdx
🚧 Files skipped from review as they are similar to previous changes (7)
  • snippets/compressible-vs-solana-rent.mdx
  • light-token/faq.mdx
  • light-token/cookbook/close-token-account.mdx
  • light-token/cookbook/create-token-account.mdx
  • rent.mdx
  • light-token/README.mdx
  • snippets/jsx/token22-extensions-table.jsx
🧰 Additional context used
🧬 Code graph analysis (2)
snippets/jsx/light-token-vs-spl-calculator.jsx (2)
snippets/jsx/compressible-rent-calculator.jsx (3)
  • DATA_LEN (8-8)
  • LAMPORTS_PER_SOL (13-13)
  • SliderMarkers (36-49)
snippets/jsx/rent-lifecycle-visualizer.jsx (1)
  • lamports (3-3)
snippets/jsx/code-compare.jsx (1)
snippets/jsx/rent-lifecycle-visualizer.jsx (1)
  • containerRef (8-8)
🪛 Biome (2.1.2)
snippets/jsx/code-compare.jsx

[error] 210-210: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)


[error] 224-224: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)

🪛 LanguageTool
light-token/cookbook/create-mint.mdx

[grammar] ~64-~64: Use a hyphen to join words.
Context: ...mint signer and address tree 2. Fetch a <Tooltip tip="Validity proofs are 128 byte zero-knowledge proofs (ZKP). Your R...

(QB_NEW_EN_HYPHEN)

snippets/light-token-guides/client-custom-rent-config.mdx

[grammar] ~8-~8: Use a hyphen to join words.
Context: ...ite a transaction payer will pay for top ups ```rust use light_compressed_token_...

(QB_NEW_EN_HYPHEN)

learn/light-token-standard.mdx

[grammar] ~282-~282: Use a hyphen to join words.
Context: ...t you can customize prepaid rent and top ups: # ...

(QB_NEW_EN_HYPHEN)

blog/c-token.mdx

[style] ~13-~13: ‘at a fraction of’ might be wordy. Consider a shorter alternative.
Context: ...on, you can create mints and tokens 1. at a fraction of the cost, 2. with improved performance,...

(EN_WORDINESS_PREMIUM_AT_A_FRACTION_OF)


[style] ~18-~18: ‘on a daily basis’ might be wordy. Consider a shorter alternative.
Context: ...unts over 20k mint accounts are created on a daily basis. Many are created and rarely accessed. ...

(EN_WORDINESS_PREMIUM_ON_A_DAILY_BASIS)


[grammar] ~85-~85: Ensure spelling is correct
Context: ...cleVisualizer /> The token accounts is initalized and funded with initial rent. When rent...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (15)
snippets/light-token-guides/light-token-client-prerequisites.mdx (3)

1-2: Verify MDX import paths resolve in this build setup (/snippets/...).
If the site uses a different alias (e.g. @/ or relative imports), these absolute-root imports will fail at build time.


4-11: Ensure Accordion is in scope for MDX (or explicitly import it).
This snippet uses <Accordion> without an import; that’s fine only if the MDX runtime injects it globally (via MDXProvider/components mapping).


4-11: Composition looks clean and reusable.
Nice separation: this file is just wiring prerequisite snippets into collapsible sections.

light-token/cookbook/transfer-interface.mdx (1)

670-677: Next Steps link is correctly fixed.

The self-referencing link issue from the previous review has been resolved. The Card now points to /light-token/cookbook/close-token-account instead of the current page, properly guiding readers to related documentation.

snippets/jsx/code-compare.jsx (2)

14-43: Syntax highlighting safely escapes input before processing.

The highlightCode function correctly HTML-escapes the input (&, <, >) before applying regex-based highlighting. This mitigates the XSS risk flagged by static analysis on dangerouslySetInnerHTML, since user-supplied code cannot inject arbitrary HTML.


171-286: JSX structure and accessibility look good.

The component now correctly returns a single root via Fragment, includes proper ARIA slider attributes, and supports keyboard navigation. The layered <pre> blocks with clipPath clipping is a clever approach for the comparison effect.

snippets/overview-tables/light-mint-guides-table.mdx (1)

1-4: LGTM! The table structure is clean and links correctly reference the new light-token cookbook guides.

snippets/overview-tables/integrate-light-token-guides-table.mdx (1)

1-6: LGTM! The table clearly categorizes integration toolkits with appropriate descriptions.

resources/addresses-and-urls.mdx (1)

6-6: No action required. The relocated import path /snippets/accounts-list/compressed-pdas-system-accounts-list.mdx exists, and the navigation link href has been correctly updated from /compressed-tokens/overview to /compressed-tokens, which points to the valid directory structure containing the compressed-tokens documentation.

docs.json (2)

522-527: Redirects configuration looks good.

The new redirects section properly maps /landing to /welcome, which is well-formed and follows Mintlify conventions.


19-103: All path references in the navigation structure are valid and resolve correctly to existing .mdx files. No action needed.

snippets/jsx/light-token-vs-spl-calculator.jsx (1)

50-138: LGTM: Well-structured UI implementation.

The UI rendering logic is clean and well-organized with proper state management for presets, custom input toggle, and slider interactions. The three result cards effectively display the cost comparison.

snippets/light-token-guides/light-token-intro.mdx (1)

1-11: LGTM!

The MDX structure is clean, imports are correctly referenced, and the accordion pattern for presenting compressible rent information is well-organized.

snippets/light-token-configure-rent.mdx (1)

1-9: LGTM!

The Rust code snippet correctly demonstrates the construction of CompressibleParamsInfos with clear parameter names and proper .clone() usage.

snippets/light-token-guides/cata-intro.mdx (1)

1-11: LGTM!

The light-ATA documentation is clear and well-structured. The three key points about associated light-token accounts are presented logically, and the accordion pattern for rent explanation is consistent with other documentation files.

Comment on lines +6 to +10
import CompressibleVsSolanaRent from '/snippets/compressible-vs-solana-rent.mdx';
import { CompressibleRentCalculator } from '/snippets/jsx/compressible-rent-calculator.jsx';
import { RentLifecycleVisualizer } from '/snippets/jsx/rent-lifecycle-visualizer.jsx';
import CompressibleRentExplained from '/snippets/compressible-rent-explained.mdx';
import CompressibleDefaultRentConfig from '/snippets/compressible-default-rent-config.mdx';
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

Remove unused component imports.

Lines 6 and 10 import CompressibleVsSolanaRent and CompressibleDefaultRentConfig which are never rendered in the document. Remove these imports to keep the file clean.

Apply this diff:

-import CompressibleVsSolanaRent from '/snippets/compressible-vs-solana-rent.mdx';
 import { CompressibleRentCalculator } from '/snippets/jsx/compressible-rent-calculator.jsx';
 import { RentLifecycleVisualizer } from '/snippets/jsx/rent-lifecycle-visualizer.jsx';
 import CompressibleRentExplained from '/snippets/compressible-rent-explained.mdx';
-import CompressibleDefaultRentConfig from '/snippets/compressible-default-rent-config.mdx';
📝 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
import CompressibleVsSolanaRent from '/snippets/compressible-vs-solana-rent.mdx';
import { CompressibleRentCalculator } from '/snippets/jsx/compressible-rent-calculator.jsx';
import { RentLifecycleVisualizer } from '/snippets/jsx/rent-lifecycle-visualizer.jsx';
import CompressibleRentExplained from '/snippets/compressible-rent-explained.mdx';
import CompressibleDefaultRentConfig from '/snippets/compressible-default-rent-config.mdx';
import { CompressibleRentCalculator } from '/snippets/jsx/compressible-rent-calculator.jsx';
import { RentLifecycleVisualizer } from '/snippets/jsx/rent-lifecycle-visualizer.jsx';
import CompressibleRentExplained from '/snippets/compressible-rent-explained.mdx';
🤖 Prompt for AI Agents
In learn/light-token-standard.mdx around lines 6 to 10, two imported components
(CompressibleVsSolanaRent on line 6 and CompressibleDefaultRentConfig on line
10) are never used; remove those two import statements from the top of the file
so only the imported modules that are actually rendered remain (keep the
remaining imports for CompressibleRentCalculator, RentLifecycleVisualizer, and
CompressibleRentExplained).

Comment on lines +82 to +91
```rust
pub struct CompressedMint {
// SPL mint layout
pub base: BaseMint,
// light-mint state used by the Compressed Token Program
pub metadata: CompressedMintMetadata
// Field for Token Metadata extension
pub extensions: Option<Vec<ExtensionStruct>>,
}
```
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

Add missing comma in CompressedMint struct.

Line 87 is missing a trailing comma after the metadata field, breaking formatting consistency.

Apply this diff:

 pub struct CompressedMint {
     // SPL mint layout
     pub base: BaseMint,
     // light-mint state used by the Compressed Token Program
-    pub metadata: CompressedMintMetadata
+    pub metadata: CompressedMintMetadata,
     // Field for Token Metadata extension
     pub extensions: Option<Vec<ExtensionStruct>>,
 }
📝 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
```rust
pub struct CompressedMint {
// SPL mint layout
pub base: BaseMint,
// light-mint state used by the Compressed Token Program
pub metadata: CompressedMintMetadata
// Field for Token Metadata extension
pub extensions: Option<Vec<ExtensionStruct>>,
}
```
🤖 Prompt for AI Agents
In learn/light-token-standard.mdx around lines 82 to 91, the CompressedMint Rust
struct is missing a trailing comma after the `metadata: CompressedMintMetadata`
field; add a comma at the end of that line so the struct fields are consistently
comma-separated (i.e., change `pub metadata: CompressedMintMetadata` to `pub
metadata: CompressedMintMetadata,`) and ensure the code block formatting remains
valid.

<CompressibleRentExplained />
<RentLifecycleVisualizer />

We recommend to use default values, but you can customize prepaid rent and top ups:
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

Hyphenate compound adjective: "top ups" → "top-ups".

Per standard English grammar, "top-ups" should be hyphenated when used as a noun. This aligns with the static analysis tool hint.

Apply this diff:

-We recommend to use default values, but you can customize prepaid rent and top ups:
+We recommend to use default values, but you can customize prepaid rent and top-ups:
📝 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
We recommend to use default values, but you can customize prepaid rent and top ups:
We recommend to use default values, but you can customize prepaid rent and top-ups:
🧰 Tools
🪛 LanguageTool

[grammar] ~282-~282: Use a hyphen to join words.
Context: ...t you can customize prepaid rent and top ups: # ...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
In learn/light-token-standard.mdx around line 282, the phrase "top ups" should
be hyphenated as "top-ups"; update the sentence to read "We recommend to use
default values, but you can customize prepaid rent and top-ups:" ensuring the
compound noun is hyphenated.


The example creates a light-mint with token metadata.
1. Derive the mint address from the mint signer and address tree
2. Fetch a <Tooltip tip="Validity proofs are 128 byte zero-knowledge proofs (ZKP). Your RPC generates the validity proof for you.">validity proof</Tooltip> from your RPC that proves the address does not exist yet.
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

Add hyphen in compound adjective. The phrase "128 byte zero-knowledge proofs" should use a hyphen to join "128-byte" as a compound adjective modifying "proofs".

-2. Fetch a <Tooltip tip="Validity proofs are 128 byte zero-knowledge proofs (ZKP). Your RPC generates the validity proof for you.">validity proof</Tooltip> from your RPC that proves the address does not exist yet.
+2. Fetch a <Tooltip tip="Validity proofs are 128-byte zero-knowledge proofs (ZKP). Your RPC generates the validity proof for you.">validity proof</Tooltip> from your RPC that proves the address does not exist yet.

Also applies to: 64-64

🧰 Tools
🪛 LanguageTool

[grammar] ~64-~64: Use a hyphen to join words.
Context: ...mint signer and address tree 2. Fetch a <Tooltip tip="Validity proofs are 128 byte zero-knowledge proofs (ZKP). Your R...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
In light-token/cookbook/create-mint.mdx around line 64, the phrase "128 byte
zero-knowledge proofs" lacks a hyphen for the compound adjective; change it to
"128-byte zero-knowledge proofs" (and update any identical occurrences at the
same lines) so the numeric modifier correctly hyphenates the compound adjective.

Comment on lines +66 to +68
<td>6</td>
<td style={{textAlign: 'left'}}><strong><Tooltip tip="cTokenpN6n8uj2gwJJszLDaeMpJt6aVqGbPWLJbvTFg2" cta="Program ID" href="https://solscan.io/account/cTokenpN6n8uj2gwJJszLDaeMpJt6aVqGbPWLJbvTFg2">light-token Program</Tooltip></strong></td>
<td>-</td>
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

🌐 Web query:

Light Protocol light-token program ID Solana

💡 Result:

The Light Protocol compressed token (light-token / compressed token) program ID is:
cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m. [1][2]

Sources:
[1] Light Protocol Devnet Addresses (docs).
[2] Lightprotocol GitHub (light-compressed-token references).


Update the "light-token Program" ID to the correct address.

The Program ID shown (cTokenpN6n8uj2gwJJszLDaeMpJt6aVqGbPWLJbvTFg2) does not match Light Protocol's actual light-token program ID (cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m). This mismatch will mislead users who copy the program ID. Replace it with the correct address or clarify which program this ID actually represents.

🤖 Prompt for AI Agents
In snippets/accounts-list/light-token-create-accounts-list-client.mdx around
lines 66 to 68, the displayed Program ID for "light-token Program" is incorrect
(cTokenpN6n8uj2gwJJszLDaeMpJt6aVqGbPWLJbvTFg2); replace it with the correct
Light Protocol light-token program ID
(cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m) so users copying the value get the
right address, and ensure the Tooltip/cta/href reflect the updated ID (update
the href link to point to the correct Solscan account URL for the new program ID
if present).

Comment on lines +163 to +169
const ExternalIcon = () => (
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>
<polyline points="15 3 21 3 21 9"/>
<line x1="10" y1="14" x2="21" y2="3"/>
</svg>
);
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

Remove unused ExternalIcon component.

ExternalIcon is defined but never used in the JSX, constituting dead code.

-  const ExternalIcon = () => (
-    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
-      <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>
-      <polyline points="15 3 21 3 21 9"/>
-      <line x1="10" y1="14" x2="21" y2="3"/>
-    </svg>
-  );
📝 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
const ExternalIcon = () => (
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>
<polyline points="15 3 21 3 21 9"/>
<line x1="10" y1="14" x2="21" y2="3"/>
</svg>
);
🤖 Prompt for AI Agents
In snippets/jsx/code-compare.jsx around lines 163 to 169, the ExternalIcon
component is defined but never used; remove the dead code by deleting the
ExternalIcon component declaration (the SVG function) from the file, and run a
quick search to ensure no other references exist before committing.

Comment on lines +1 to +3
export const CTokenVsSplCalculator = () => {
const [numAccounts, setNumAccounts] = useState(100000);
const [showCustomAccounts, setShowCustomAccounts] = useState(false);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Add missing React imports.

The component uses useState but doesn't import it. This will cause a ReferenceError at runtime.

Add the required import at the top of the file:

+import { useState } from 'react';
+
 export const CTokenVsSplCalculator = () => {
   const [numAccounts, setNumAccounts] = useState(100000);
   const [showCustomAccounts, setShowCustomAccounts] = useState(false);
📝 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
export const CTokenVsSplCalculator = () => {
const [numAccounts, setNumAccounts] = useState(100000);
const [showCustomAccounts, setShowCustomAccounts] = useState(false);
import { useState } from 'react';
export const CTokenVsSplCalculator = () => {
const [numAccounts, setNumAccounts] = useState(100000);
const [showCustomAccounts, setShowCustomAccounts] = useState(false);
🤖 Prompt for AI Agents
In snippets/jsx/light-token-vs-spl-calculator.jsx around lines 1 to 3 the
component uses useState but there is no React import; add the missing import
statement at the top of the file (for example: import React, { useState } from
'react') so useState is defined and the component can run without a
ReferenceError.

Comment on lines +30 to +34
<td style={{textAlign: 'left'}}><strong><Tooltip tip="light-token program PDA that manages rent for compressible accounts.">Rent Sponsor</Tooltip></strong></td>
<td>
- light-token program PDA that fronts rent exemption at creation.<br/>
- Claims rent when account compresses.
</td>
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

🏁 Script executed:

#!/bin/bash
# Search for program name references across documentation
rg -n --type mdx -C 2 'light-token program|CToken program|compressed token program' snippets/

Repository: Lightprotocol/docs-v2

Length of output: 92


🏁 Script executed:

#!/bin/bash
# First, find .mdx files in snippets directory
echo "=== Looking for .mdx files ==="
fd -e mdx . snippets/ | head -20

# Search for the terminology in all files
echo -e "\n=== Searching for 'light-token program' ==="
rg -n 'light-token program' snippets/

echo -e "\n=== Searching for 'CToken program' ==="
rg -n 'CToken program' snippets/

echo -e "\n=== Searching for 'compressed token program' ==="
rg -n 'compressed token program' snippets/

Repository: Lightprotocol/docs-v2

Length of output: 3242


Use consistent terminology for the program name.

This file refers to "light-token program PDA" (lines 30, 32), while snippets/light-token-guides/client-custom-rent-config.mdx (lines 56, 58) uses "CToken program PDA" for the same Rent Sponsor entity. The term "light-token program" is used consistently throughout other documentation files. Update the terminology in client-custom-rent-config.mdx to match the rest of the documentation.

🤖 Prompt for AI Agents
In snippets/light-token-configure-rent.mdx around lines 30-34 and in
snippets/light-token-guides/client-custom-rent-config.mdx around lines 56-58,
the Rent Sponsor description uses inconsistent program names; change any
occurrences of "CToken program PDA" to "light-token program PDA" (matching the
rest of docs), update corresponding tooltip/title text to use "light-token"
exactly, and run a quick search-and-replace in the two files to ensure all
references and tooltips use the same "light-token program PDA" terminology.

Comment on lines +56 to +60
<td style={{textAlign: 'left'}}><strong><Tooltip tip="CToken program PDA that manages rent for compressible accounts.">Rent Sponsor</Tooltip></strong></td>
<td>
- CToken program PDA that fronts rent exemption at creation.<br/>
- Claims rent when account compresses.
</td>
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

Use consistent terminology for the program name.

This file refers to "CToken program PDA" (line 56), while snippets/light-token-configure-rent.mdx line 30 refers to the same Rent Sponsor entity as "light-token program PDA". Align terminology across all documentation files.

🤖 Prompt for AI Agents
In snippets/light-token-guides/client-custom-rent-config.mdx around lines 56 to
60 the term "CToken program PDA" is used while other docs call the same entity
"light-token program PDA"; update the phrasing to match the canonical term
("light-token program PDA") in the Rent Sponsor tooltip and any adjacent text so
terminology is consistent across documentation.

tilo-14 and others added 2 commits December 12, 2025 09:12
Remove TypeScript client tabs and unused imports from cookbook guides.
Rust client examples remain as the primary reference implementation.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (4)
light-token/cookbook/create-ata.mdx (1)

7-13: Remove unused MDX import (ClientCustomRentConfig). It’s imported but never rendered in this page.

 import CTokenClientPrerequisites from '/snippets/light-token-guides/light-token-client-prerequisites.mdx';
-import ClientCustomRentConfig from '/snippets/light-token-guides/client-custom-rent-config.mdx';
light-token/cookbook/create-mint.mdx (2)

1-5: Fix typo in frontmatter title (“wih” → “with”).

-title: Create Mint Account wih Token Metadata
+title: Create Mint Account with Token Metadata

24-27: Hyphenate compound adjective in Tooltip (“128-byte”). Improves grammar/readability.

-2. Fetch a <Tooltip tip="Validity proofs are 128 byte zero-knowledge proofs (ZKP). Your RPC generates the validity proof for you.">validity proof</Tooltip> from your RPC that proves the address does not exist yet. 
+2. Fetch a <Tooltip tip="Validity proofs are 128-byte zero-knowledge proofs (ZKP). Your RPC generates the validity proof for you.">validity proof</Tooltip> from your RPC that proves the address does not exist yet.
light-token/cookbook/transfer-interface.mdx (1)

6-10: Remove unused TransferInterfaceIntro import (or render it).
TransferInterfaceIntro (Line 8) is imported but never used in the document.

 import TransferInterfaceAccountsListCtoken1 from '/snippets/accounts-list/transfer-interface-accounts-list-light-token-1.mdx';
 import TransferInterfaceAccountsListSpl2 from '/snippets/accounts-list/transfer-interface-accounts-list-spl-2.mdx';
-import TransferInterfaceIntro from '/snippets/light-token-guides/transfer-interface-intro.mdx';
 import CTokenClientPrerequisites from '/snippets/light-token-guides/light-token-client-prerequisites.mdx';
 import ClientCustomRentConfig from '/snippets/light-token-guides/client-custom-rent-config.mdx';

(Alternatively, add <TransferInterfaceIntro /> near the top if the intro is intended.)

🧹 Nitpick comments (1)
light-token/cookbook/transfer-interface.mdx (1)

357-361: Wording nit: “CPI the light-token Program” → “CPI into the light-token program”.
Small readability/grammar improvement for a docs page.

-### CPI the light-token Program
+### CPI into the light-token program
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66e24eb and 1069f43.

📒 Files selected for processing (6)
  • light-token/README.mdx (1 hunks)
  • light-token/cookbook/create-ata.mdx (1 hunks)
  • light-token/cookbook/create-mint.mdx (1 hunks)
  • light-token/cookbook/create-token-account.mdx (1 hunks)
  • light-token/cookbook/mint-tokens.mdx (1 hunks)
  • light-token/cookbook/transfer-interface.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • light-token/cookbook/mint-tokens.mdx
  • light-token/cookbook/create-token-account.mdx
  • light-token/README.mdx
🧰 Additional context used
🪛 LanguageTool
light-token/cookbook/create-mint.mdx

[grammar] ~26-~26: Use a hyphen to join words.
Context: ...mint signer and address tree 2. Fetch a <Tooltip tip="Validity proofs are 128 byte zero-knowledge proofs (ZKP). Your R...

(QB_NEW_EN_HYPHEN)

Comment on lines +15 to +19
1. Associated light-token accounts are Solana accounts that hold token balances of light, SPL, or Token 2022 mints.
2. The address for light-ATAs is deterministically derived with the owner's address, compressed token program ID, and mint address.
2. Associated light-token accounts implement a default rent config:
1. At account creation, you pay ~17,208 lamports <Tooltip tip="24 h = 16 epochs, where 1 rent-epoch ≈ 1.5h ≈ 13,500 slots at 400ms per slot">for 24h of rent</Tooltip> <br/>and <Tooltip tip="Covers transaction cost to compress accounts (10,000) and protocol incentive (1,000). Transaction cost might vary.">compression incentive</Tooltip> (the rent-exemption is sponsored by the protocol)
2. Transfers keep the account funded <Tooltip tip="2 epochs = 3h">with rent for 3h</Tooltip> via top-ups. The transaction payer tops up 776 lamports when the account's rent is below 3h.
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

Fix duplicated list numbering (“2.” appears twice). This renders oddly and is easy to miss when scanning.

 2. The address for light-ATAs is deterministically derived with the owner's address, compressed token program ID, and mint address.
-2. Associated light-token accounts implement a default rent config:
+3. Associated light-token accounts implement a default rent config:
📝 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
1. Associated light-token accounts are Solana accounts that hold token balances of light, SPL, or Token 2022 mints.
2. The address for light-ATAs is deterministically derived with the owner's address, compressed token program ID, and mint address.
2. Associated light-token accounts implement a default rent config:
1. At account creation, you pay ~17,208 lamports <Tooltip tip="24 h = 16 epochs, where 1 rent-epoch ≈ 1.5h ≈ 13,500 slots at 400ms per slot">for 24h of rent</Tooltip> <br/>and <Tooltip tip="Covers transaction cost to compress accounts (10,000) and protocol incentive (1,000). Transaction cost might vary.">compression incentive</Tooltip> (the rent-exemption is sponsored by the protocol)
2. Transfers keep the account funded <Tooltip tip="2 epochs = 3h">with rent for 3h</Tooltip> via top-ups. The transaction payer tops up 776 lamports when the account's rent is below 3h.
1. Associated light-token accounts are Solana accounts that hold token balances of light, SPL, or Token 2022 mints.
2. The address for light-ATAs is deterministically derived with the owner's address, compressed token program ID, and mint address.
3. Associated light-token accounts implement a default rent config:
1. At account creation, you pay ~17,208 lamports <Tooltip tip="24 h = 16 epochs, where 1 rent-epoch ≈ 1.5h ≈ 13,500 slots at 400ms per slot">for 24h of rent</Tooltip> <br/>and <Tooltip tip="Covers transaction cost to compress accounts (10,000) and protocol incentive (1,000). Transaction cost might vary.">compression incentive</Tooltip> (the rent-exemption is sponsored by the protocol)
2. Transfers keep the account funded <Tooltip tip="2 epochs = 3h">with rent for 3h</Tooltip> via top-ups. The transaction payer tops up 776 lamports when the account's rent is below 3h.
🤖 Prompt for AI Agents
In light-token/cookbook/create-ata.mdx around lines 15 to 19 the ordered list
numbering is duplicated (two items labeled "2."), which breaks the sequence;
update the second "2." to "3." so the top-level list reads 1., 2., 3. and keep
the nested sub-items unchanged, or convert the outer list to automatic numbering
(use "1." for all outer items) so markdown renders correct sequential numbering.

Comment on lines +7 to +10
import CMintSystemAccountsList from '/snippets/accounts-list/light-mint-system-accounts-list.mdx';
import CTokenClientPrerequisites from '/snippets/light-token-guides/light-token-client-prerequisites.mdx';
import ClientCustomRentConfig from '/snippets/light-token-guides/client-custom-rent-config.mdx';

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

Remove unused MDX import (ClientCustomRentConfig) or render it. As written, it’s unused.

 import CMintSystemAccountsList from '/snippets/accounts-list/light-mint-system-accounts-list.mdx';
 import CTokenClientPrerequisites from '/snippets/light-token-guides/light-token-client-prerequisites.mdx';
-import ClientCustomRentConfig from '/snippets/light-token-guides/client-custom-rent-config.mdx';
📝 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
import CMintSystemAccountsList from '/snippets/accounts-list/light-mint-system-accounts-list.mdx';
import CTokenClientPrerequisites from '/snippets/light-token-guides/light-token-client-prerequisites.mdx';
import ClientCustomRentConfig from '/snippets/light-token-guides/client-custom-rent-config.mdx';
import CMintSystemAccountsList from '/snippets/accounts-list/light-mint-system-accounts-list.mdx';
import CTokenClientPrerequisites from '/snippets/light-token-guides/light-token-client-prerequisites.mdx';
🤖 Prompt for AI Agents
In light-token/cookbook/create-mint.mdx around lines 7 to 10, the imported MDX
module ClientCustomRentConfig is not used; either remove that import or add a
render of the component where appropriate. If the snippet is unnecessary, delete
the import line; if the content should appear in the document, insert the
ClientCustomRentConfig component at the intended location in the MDX content
(e.g., alongside the other snippet components) and ensure its path and naming
match existing imports.

Comment on lines +60 to +71
<Steps>
<Step>
### Prerequisites

<CTokenClientPrerequisites />

</Step>

<Step>
### Transfer Interface
</Step>
</Steps>
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

Avoid an empty Step (“Transfer Interface”) in the Rust Client flow.
As written, the second <Step> has only a heading and no content; either add the actual instructions/snippet callout there or remove the step wrapper to prevent a blank step in rendered docs.

 <Steps>
 <Step>
 ### Prerequisites

 <CTokenClientPrerequisites />

 </Step>

-<Step>
-### Transfer Interface 
-</Step>
 </Steps>
📝 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
<Steps>
<Step>
### Prerequisites
<CTokenClientPrerequisites />
</Step>
<Step>
### Transfer Interface
</Step>
</Steps>
<Steps>
<Step>
### Prerequisites
<CTokenClientPrerequisites />
</Step>
</Steps>
🤖 Prompt for AI Agents
In light-token/cookbook/transfer-interface.mdx around lines 60 to 71, the second
<Step> block contains only a heading "### Transfer Interface" and no body, which
results in a blank step in the rendered Rust Client flow; either add the
intended instructions/code snippet (e.g., the Rust client transfer interface
details or a <Callout> with example usage) directly under that heading, or
remove the entire <Step> wrapper so the heading does not render as an empty
step—make sure the surrounding Steps XML remains valid after the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants