Skip to content
blockchain-compression cargo add →

// presets

One dictionary, six levels of effort.

Every preset uses the same Solana dictionary. What changes is the Zstandard level behind it — the tradeoff between CPU cost and ratio. Ratios below are the README's published ranges; your real numbers depend on how repetitive your input is.

// honesty note: "up to 60:1" is the top of the MaxCompression range on archival Solana data — not a median, not a guarantee, and not what a random EVM payload will see. Measure on your own data with compressor.stats().best_ratio.

// reported ratio range by preset

FastCompression
5–15:1
Transactions
10–30:1
Instructions
10–25:1
Accounts
15–40:1
Mixed
12–35:1
MaxCompression
20–60:1

FastCompression

5–15:1
zstd level3
best forReal-time processing

Lowest latency. Use when you compress on the hot path and can trade ratio for speed.

Transactions

10–30:1
zstd level3
best forTransaction data

Tuned for batched transactions where program IDs and discriminators repeat heavily.

Instructions

10–25:1
zstd level6
best forProgram instructions

A middle level for decoded instruction streams.

Accounts

15–40:1
zstd level6
best forAccount state snapshots

The sweet spot for account dumps — highly repetitive key and owner fields.

Mixed

12–35:1
zstd level6
best forGeneral-purpose

A safe default when the workload is a mix of transactions and account state.

MaxCompression

20–60:1
zstd level19
best forArchival storage

Highest ratio, highest CPU cost. Reserved for cold, write-once archival data.

// choosing

Which preset should I pick?

  • Compressing on the hot path? Start with FastCompression (level 3) and measure whether you can afford Transactions.
  • Warehousing account snapshots? Accounts targets that structure and reports the best non-archival ratios.
  • Mixed workload, unsure? Mixed is the safe default.
  • Cold, write-once archival? MaxCompression (level 19) — you pay the CPU once and store it forever.

Set it up in the quickstart →