Skip to content

Commit e646e8f

Browse files
author
tilo-14
committed
update cost
1 parent 72abd30 commit e646e8f

29 files changed

Lines changed: 114 additions & 115 deletions

faq.mdx

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ import {
1313
splCreateAtaCode,
1414
lightCreateAtaCode,
1515
} from "/snippets/code-samples/code-compare-snippets.jsx";
16+
import RentSponsorshipCost from "/snippets/cost-tables/rent-sponsorship-cost.mdx";
17+
import TokenCreationCost from "/snippets/cost-tables/token-creation-cost.mdx";
18+
import CuPerformance from "/snippets/cost-tables/cu-performance.mdx";
19+
import LightPdaCost from "/snippets/cost-tables/light-pda-cost.mdx";
20+
import CompressedPdaCost from "/snippets/cost-tables/compressed-pda-cost.mdx";
1621

1722
## Rent Sponsorship
1823

@@ -21,11 +26,7 @@ import {
2126
Rent sponsorship is a built-in feature of the Light SDK’s that sponsors rent-exemption for all account types to reduce creation cost: mints, token accounts, and PDAs.
2227
This is dealt with under the hood in a way that doesn’t disrupt the UX of what your users are used to with SPL-token.
2328

24-
| Account Creation Cost | Light | Standard Solana |
25-
| :----------------------- | :------------------- | :---------------------- |
26-
| **Mint account** | **~0.00001 SOL** | ~0.0015 SOL |
27-
| **Associated token account** | **~0.00001 SOL** | ~0.0029 SOL |
28-
| **PDA (100-byte)** | **~0.0000115 SOL** | ~0.0016 SOL |
29+
<RentSponsorshipCost />
2930

3031
<RentSponsorshipExplained />
3132

@@ -59,18 +60,11 @@ Light token is a high-performance token standard that is functionally equivalent
5960

6061
**Creation Cost**
6162

62-
| | Light-Token | SPL-Token |
63-
| :---------------- | ---------------: | ----------: |
64-
| **Mint Account** | **0.00001 SOL** | 0.0015 SOL |
65-
| **Token Account** | **0.00001 SOL** | 0.0029 SOL |
63+
<TokenCreationCost />
6664

6765
**CU Performance**
6866

69-
| | Light-Token | SPL-Token |
70-
| :----------------------- | ----------: | --------: |
71-
| **ATA Creation** | **4,348** | 14,194 |
72-
| **Transfer** | **312** | 4,645 |
73-
| **Transfer** (rent-free) | **1,885** | 4,645 |
67+
<CuPerformance />
7468

7569
</Accordion>
7670

@@ -217,19 +211,15 @@ Additional extensions can be requested.
217211

218212
A standard Solana PDA with sponsored rent-exemption. Seeds, bump derivation, and `invoke_signed` work the same way. Your instruction handlers for reads, updates, and closes don't change.
219213

220-
| | Regular PDA | Light-PDA |
221-
| :----------------- | ------------: | ------------: |
222-
| **100-byte account** | ~0.0016 SOL | ~0.0000115 SOL |
214+
<LightPdaCost />
223215

224216
</Accordion>
225217

226218
<Accordion title="What is a compressed PDA?">
227219

228220
A compressed account with a derived address. Programs invoke the Light System program instead of the System program to create and update compressed accounts. Compressed PDAs are always compressed and require a validity proof for every read and write.
229221

230-
| | Regular PDA | Compressed PDA |
231-
| :----------------- | ------------: | -------------: |
232-
| **100-byte account** | ~0.0016 SOL | ~0.000015 SOL |
222+
<CompressedPdaCost />
233223

234224
</Accordion>
235225

home.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { Footer } from "/snippets/jsx/footer.jsx";
99
import { HeroCubeGrid } from "/snippets/jsx/hero-cube-grid.jsx";
1010
import { LiquidGlassPill } from "/snippets/jsx/liquid-glass-pill.jsx";
1111
import { PartnerLogos } from "/snippets/jsx/partner-logos.jsx";
12+
import TokenCreationCost from "/snippets/cost-tables/token-creation-cost.mdx";
13+
import PdaCostCombined from "/snippets/cost-tables/pda-cost-combined.mdx";
1214

1315
{/* Hero with animation - styles in style.css (no flash) */}
1416

@@ -30,10 +32,7 @@ stablecoin payments, our APIs help you scale.
3032

3133
## Token APIs
3234

33-
| Creation Cost | Light Token Program | SPL / Token 2022 |
34-
|:--------|:------|:---------------|
35-
| Mint Account | 0.00001 SOL | 0.0015 SOL |
36-
| Token Account | 0.00001 SOL | 0.0029 SOL |
35+
<TokenCreationCost />
3736

3837
<Card
3938
title="Light Token Program"
@@ -79,9 +78,7 @@ stablecoin payments, our APIs help you scale.
7978

8079
## PDA Accounts
8180

82-
| Creation Cost | Light / Compressed | Solana default |
83-
|:--------|:------|:---------------|
84-
| 100-byte PDA | ~0.000015 SOL | 0.0016 SOL |
81+
<PdaCostCombined />
8582

8683
<CardGroup cols={2}>
8784
<Card title="Light PDA (New)" icon="expand" href="/pda/light-pda/overview">

learn/light-token-standard.mdx

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ keywords: ["light token standard on solana", "token 2022 on solana", "token exte
66
---
77

88
import CompressibleVsSolanaRent from "/snippets/compressible-vs-solana-rent.mdx";
9+
import MintAccountCost from "/snippets/cost-tables/mint-account-cost.mdx";
10+
import TokenAccountCost from "/snippets/cost-tables/token-account-cost.mdx";
11+
import CuPerformance from "/snippets/cost-tables/cu-performance.mdx";
912
import { CompressibleRentCalculator } from "/snippets/jsx/compressible-rent-calculator.jsx";
1013
import { RentLifecycleVisualizer } from "/snippets/jsx/rent-lifecycle-visualizer.jsx";
1114
import CompressibleRentExplained from "/snippets/compressible-rent-explained.mdx";
@@ -61,9 +64,7 @@ Light-mints **uniquely represent a token on Solana and store its global metadata
6164
1. Tokens created from light-mints are light-tokens.
6265
2. Token metadata (name, symbol, URI) is stored as an extension in the struct.
6366

64-
| | Light-Token | SPL-Token |
65-
| :--------------- | --------------: | ---------: |
66-
| **Mint Account** | **0.00001 SOL** | 0.0015 SOL |
67+
<MintAccountCost />
6768

6869
<Tabs>
6970
<Tab title="Diagram">
@@ -76,11 +77,12 @@ Light-mints **uniquely represent a token on Solana and store its global metadata
7677
</Tab>
7778
<Tab title="Source Code">
7879
```rust
79-
pub struct CompressedMint {
80+
pub struct Mint {
8081
pub base: BaseMint,
81-
pub metadata: CompressedMintMetadata,
82-
/// Reserved bytes for Token 2022 layout compatibility (padding to reach byte 165)
83-
pub reserved: [u8; 49],
82+
pub metadata: MintMetadata,
83+
/// Reserved bytes (16 bytes) for T22 layout compatibility.
84+
/// Positions account_type at offset 165: 82 (BaseMint) + 67 (metadata) + 16 (reserved) = 165.
85+
pub reserved: [u8; 16],
8486
/// Account type discriminator at byte 165 (1 = Mint, 2 = Account)
8587
pub account_type: u8,
8688
/// Compression info embedded directly in the mint
@@ -93,7 +95,7 @@ Light-mints **uniquely represent a token on Solana and store its global metadata
9395

9496
<Info>
9597
Find the [source code of light-mints
96-
here](https://github.com/Lightprotocol/light-protocol/blob/bda52c305fad28b1b72093911f878d37fb190656/program-libs/token-interface/src/state/mint/compressed_mint.rs#L19).
98+
here](https://github.com/Lightprotocol/light-protocol/blob/main/program-libs/token-interface/src/state/mint/compressed_mint.rs#L20).
9799
</Info>
98100

99101
The `metadata` field is used by the Light Token Program to store the internal state of a light-mint.
@@ -185,17 +187,11 @@ A light-token account holds token balances like SPL Token accounts:
185187
- Each wallet can own multiple light-token accounts for the same light-mint.
186188
- A light-token account can only have one owner and hold units of one light-mint.
187189

188-
| | Light-Token | SPL-Token |
189-
| :---------------- | ---------------: | ---------: |
190-
| **Token Account** | **~0.00001 SOL** | ~0.0029 SOL |
190+
<TokenAccountCost />
191191

192192
Additionally Light Token is more compute-efficient than SPL on hot paths:
193193

194-
| | Light-Token | SPL-Token |
195-
| :----------------------- | ----------: | --------: |
196-
| **ATA Creation** | **4,348** | 14,194 |
197-
| **Transfer** | **312** | 4,645 |
198-
| **Transfer** (rent-free) | **1,885** | 4,645 |
194+
<CuPerformance />
199195

200196
<Tabs>
201197
<Tab title="Diagram">
@@ -208,25 +204,26 @@ Additionally Light Token is more compute-efficient than SPL on hot paths:
208204
</Tab>
209205
<Tab title="Source Code">
210206
```rust
211-
/// Token account structure (with extensions).
207+
/// Ctoken account structure (same as SPL Token Account but with extensions).
212208
pub struct Token {
213209
pub mint: Pubkey,
214210
pub owner: Pubkey,
215211
pub amount: u64,
216-
pub delegate: Option<Pubkey>, // instruction not implemented yet
217-
pub state: u8,
212+
pub delegate: Option<Pubkey>,
213+
pub state: AccountState,
218214
pub is_native: Option<u64>,
219-
pub delegated_amount: u64, // instruction not implemented yet
215+
pub delegated_amount: u64,
220216
pub close_authority: Option<Pubkey>,
221-
pub extensions: Option<Vec<ExtensionStruct>>, // Optional extensions e.g. compressible
217+
pub account_type: u8,
218+
pub extensions: Option<Vec<ExtensionStruct>>,
222219
}
223220
```
224221
</Tab>
225222
</Tabs>
226223

227224
<Info>
228225
Find the [source code of light-tokens
229-
here](https://github.com/Lightprotocol/light-protocol/blob/bda52c305fad28b1b72093911f878d37fb190656/program-libs/token-interface/src/state/token/token_struct.rs#L34).
226+
here](https://github.com/Lightprotocol/light-protocol/blob/main/program-libs/token-interface/src/state/token/token_struct.rs#L34).
230227
</Info>
231228

232229
Light token accounts replicate the field layout and serialization format of [SPL Token accounts](https://solana.com/docs/tokens#token-account). The struct is serialized with Borsh to match the on-chain format of SPL tokens.
@@ -259,7 +256,7 @@ Here is how light-tokens and SPL tokens compare:
259256
</tr>
260257
<tr>
261258
<td>delegate</td>
262-
<td style={{ textAlign: "center" }}>unimplemented</td>
259+
<td style={{ textAlign: "center" }}></td>
263260
<td style={{ textAlign: "center" }}>✓</td>
264261
</tr>
265262
<tr>
@@ -274,7 +271,7 @@ Here is how light-tokens and SPL tokens compare:
274271
</tr>
275272
<tr>
276273
<td>delegated_amount</td>
277-
<td style={{ textAlign: "center" }}>unimplemented</td>
274+
<td style={{ textAlign: "center" }}></td>
278275
<td style={{ textAlign: "center" }}>✓</td>
279276
</tr>
280277
<tr>
@@ -309,7 +306,7 @@ let seeds = [
309306

310307
<Info>
311308
Find the [source code to associated light-token accounts
312-
here](https://github.com/Lightprotocol/light-protocol/blob/main/programs/compressed-token/program/src/create_associated_token_account.rs).
309+
here](https://github.com/Lightprotocol/light-protocol/blob/main/programs/compressed-token/program/src/ctoken/create_ata.rs).
313310
</Info>
314311

315312
# Compressed Token Account
@@ -326,7 +323,7 @@ Under the hood, compressed token accounts store token balance, owner, and other
326323
<Frame>
327324
<img
328325
src="/images/compressed-token-explainer.png"
329-
alt="Diagram showing compressed token account structure with three components: Hash (identifier for compressed token account in purple box), Account (struct containing Data bytes, Executable flag, Lamports balance, and Address set to None), and AccountData (containing Mint, Owner, Amount, and Extensions fields marked as unimplemented)"
326+
alt="Diagram showing compressed token account structure with three components: Hash (identifier for compressed token account in purple box), Account (struct containing Data bytes, Executable flag, Lamports balance, and Address set to None), and AccountData (containing Mint, Owner, Amount, and Extensions fields)"
330327
/>
331328
</Frame>
332329
</Tab>
@@ -338,8 +335,8 @@ Under the hood, compressed token accounts store token balance, owner, and other
338335
pub amount: u64,
339336
pub delegate: Option<Pubkey>,
340337
pub state: u8,
341-
/// Placeholder for TokenExtension tlv data (unimplemented)
342-
pub tlv: Option<Vec<u8>>,
338+
/// Extensions for the compressed token account
339+
pub tlv: Option<Vec<ExtensionStruct>>,
343340
}
344341
```
345342
</Tab>

light-token/payments/overview.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
import SupportFooter from "/snippets/support-footer.mdx";
2222
import RentSponsorship from "/snippets/rent-sponsorship-explained.mdx";
2323
import AgentSkillPayments from "/snippets/setup/agent-skill-payments.mdx";
24+
import PaymentCostUsd from "/snippets/cost-tables/payment-cost-usd.mdx";
2425

2526

2627
Payment flows on Solana include five core concepts:
@@ -32,14 +33,10 @@ Payment flows on Solana include five core concepts:
3233

3334
Our token API's optimize the account creation cost component. You typically create an account (1) when onboarding a new user, and (2) when the recipient does not hold the transferred token yet.
3435

35-
| | Light | SPL / Token 2022 |
36-
| :--- | :--- | :--- |
37-
| **Transfer** | *~\$0.001* | *~\$0.001* |
38-
| **Create Token Account** | **~\$0.001** (0.00001 SOL) | **~\$0.30** (0.0029 SOL) |
39-
| **Transfer + Create Token Account** | **~\$0.001** (0.00001 SOL) | **~\$0.30** (0.0029 SOL) |
36+
<PaymentCostUsd />
4037

41-
While transfer cost is identical, you can expect ~\$0.30 total when creating a new token account using SPL/Token 2022.
42-
With Light Token, the total cost will be around \$0.001, regardless of whether a new account is created. Your users use the same stablecoins, just stored more efficiently.
38+
While transfer cost is identical, you can expect ~\$0.29 total when creating a new token account using SPL/Token 2022.
39+
With Light Token, the total cost will be around \$0.002, regardless of whether a new account is created. Your users use the same stablecoins, just stored more efficiently.
4340

4441
<Accordion title="How the cost reduction works">
4542
The token standard pays rent-exemption cost for you. To prevent griefing, “rent” is paid over time to keep an account in memory. This is dealt with under the hood in a way that doesn’t disrupt the UX of what your users are used to with SPL-token.

light-token/wallets/gasless-transactions.mdx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import RustInstructionCode from "/snippets/code-snippets/light-token/gasless-tra
1010
import RentSponsorshipExplained from "/snippets/rent-sponsorship-explained.mdx";
1111
import GaslessTransactionsAiPrompt from "/snippets/ai-prompts/wallets/gasless-transactions.mdx";
1212
import SupportFooter from "/snippets/support-footer.mdx";
13+
import PaymentCostUsd from "/snippets/cost-tables/payment-cost-usd.mdx";
1314

1415
---
1516

@@ -32,16 +33,12 @@ Set your application as the payer so users never interact with SOL.
3233

3334
In total, your sponsor covers three costs:
3435

35-
| | Light | SPL / Token 2022 |
36-
| :--- | :--- | :--- |
37-
| **Transfer** | *~\$0.001* | *~\$0.001* |
38-
| **Create Token Account** | **~\$0.001** (0.00001 SOL) | **~\$0.30** (0.0029 SOL) |
39-
| **Transfer + Create Token Account** | **~\$0.001** (0.00001 SOL) | **~\$0.30** (0.0029 SOL) |
36+
<PaymentCostUsd />
4037

4138
<Accordion title="Technical Cost Breakdown">
4239
| | | |
4340
|:-----|:-------|:----|
44-
| **Account creation** | 11,000 lamports | Initial bump on virtual rent balance. Rent-exemption is sponsored. |
41+
| **Account creation** | 17,400 lamports | Initial bump on virtual rent balance. Rent-exemption is sponsored. |
4542
| **Rent top-ups** | ~766 lamports per write | Fee payer bumps the virtual rent balance on each write to keep accounts active. Set `payer` parameter on any Light Token instruction. |
4643
| **Transaction fees**<br/>+ Priority Fee | 5,000 lamports<br/>+ Priority Fee per tx | Standard Solana fee payer. Set `feePayer` on the transaction. |
4744

light-token/wallets/overview.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ import ToolkitsSetup from "/snippets/setup/toolkits-setup.mdx";
1010
import AgentSkillPayments from "/snippets/setup/agent-skill-payments.mdx";
1111
import WalletsAiPrompt from "/snippets/ai-prompts/toolkits/wallets.mdx";
1212
import SupportFooter from "/snippets/support-footer.mdx";
13+
import TokenAccountCost from "/snippets/cost-tables/token-account-cost.mdx";
1314

1415
1. The Light-token API matches the SPL-token API almost entirely, and extends their functionality to include the light token program in addition to the SPL-token and Token-2022 programs.
1516
2. Your users hold and receive tokens of the same mints, just stored more efficiently.
1617

17-
| Creation Cost | SPL | Light-token |
18-
| :---------------- | :------------------ | :------------------- |
19-
| **Token Account** | ~2,000,000 lamports | ~**11,000** lamports |
18+
<TokenAccountCost />
2019

2120
### What you will implement
2221

light-token/wallets/privy.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ import BalancesReact from "/snippets/code-snippets/privy/balances/react.mdx";
2222
import TransactionHistoryNodejs from "/snippets/code-snippets/privy/transaction-history/nodejs.mdx";
2323
import TransactionHistoryReact from "/snippets/code-snippets/privy/transaction-history/react.mdx";
2424
import PrivyAiPrompt from "/snippets/ai-prompts/wallets/privy.mdx";
25+
import TokenAccountCost from "/snippets/cost-tables/token-account-cost.mdx";
2526

26-
| Creation Cost | SPL | light-token |
27-
| :---------------- | :------------------ | :------------------- |
28-
| **Token Account** | ~2,000,000 lamports | ~**11,000** lamports |
27+
<TokenAccountCost />
2928

3029
Privy handles user authentication and wallet management. You build transactions with light-token and Privy signs them:
3130

light-token/wallets/wallet-adapter.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ import BalancesReact from "/snippets/code-snippets/wallet-adapter/balances/react
1616
import TransactionHistoryReact from "/snippets/code-snippets/wallet-adapter/transaction-history/react.mdx";
1717
import WalletAdapterAiPrompt from "/snippets/ai-prompts/wallets/wallet-adapter.mdx";
1818
import SupportFooter from "/snippets/support-footer.mdx";
19+
import TokenAccountCost from "/snippets/cost-tables/token-account-cost.mdx";
1920

20-
| Creation Cost | SPL | light-token |
21-
| :---------------- | :------------------ | :------------------- |
22-
| **Token Account** | ~2,000,000 lamports | ~**11,000** lamports |
21+
<TokenAccountCost />
2322

2423
Solana Wallet Adapter handles wallet connection and transaction signing. You build transactions with light-token and the wallet signs them:
2524

light-token/welcome.mdx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import CookbookGuidesTable from "/snippets/overview-tables/cookbook-guides-table
1414
import WelcomePageInstall from "/snippets/setup/welcome-page-install.mdx";
1515
import SdkReference from "/snippets/overview-tables/sdk-reference.mdx";
1616
import { CodeCompare } from "/snippets/jsx/code-compare.jsx";
17+
import MintAccountCost from "/snippets/cost-tables/mint-account-cost.mdx";
18+
import TokenAccountCost from "/snippets/cost-tables/token-account-cost.mdx";
19+
import CuPerformance from "/snippets/cost-tables/cu-performance.mdx";
1720
import {
1821
splCreateMintCode,
1922
lightCreateMintCode,
@@ -39,9 +42,7 @@ import {
3942
Light-mint accounts represent a unique mint and optionally can store token-metadata.
4043
Functionally equivalent to SPL mints.
4144

42-
| Creation Cost | Light-Token | SPL-Token |
43-
| :---------------- | --------------: | ---------: |
44-
| **Mint Account** | **0.00001 SOL** | 0.0015 SOL |
45+
<MintAccountCost />
4546

4647
<Accordion title="Compare to SPL">
4748
<Tabs>
@@ -88,9 +89,7 @@ View the [guide](/light-token/cookbook/create-mint) to create Light Token mints,
8889
Light-token accounts can hold balances from any light, SPL, or Token-2022 mint, without the need
8990
to pay rent-exemption.
9091

91-
| Creation Cost | Light-Token | SPL-Token |
92-
| :---------------- | --------------: | ---------: |
93-
| **Token Account** | **0.00001 SOL** | 0.0029 SOL |
92+
<TokenAccountCost />
9493

9594
<Accordion title="Compare to SPL">
9695
<Tabs>
@@ -133,11 +132,7 @@ to pay rent-exemption.
133132
View the [guide](/light-token/cookbook/create-ata) to create associated token accounts.
134133
</Accordion>
135134

136-
| CU Performance | Light-Token | SPL-Token |
137-
| :----------------------- | ----------: | --------: |
138-
| **ATA Creation** | **4,348** | 14,194 |
139-
| **Transfer** | **312** | 4,645 |
140-
| **Transfer** (rent-free) | **1,885** | 4,645 |
135+
<CuPerformance />
141136

142137
<Card
143138
title="Learn how the Light Token Program works"

0 commit comments

Comments
 (0)