// 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:1Lowest latency. Use when you compress on the hot path and can trade ratio for speed.
Transactions
10–30:1Tuned for batched transactions where program IDs and discriminators repeat heavily.
Instructions
10–25:1A middle level for decoded instruction streams.
Accounts
15–40:1The sweet spot for account dumps — highly repetitive key and owner fields.
Mixed
12–35:1A safe default when the workload is a mix of transactions and account state.
MaxCompression
20–60:1Highest 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 affordTransactions. - ▸Warehousing account snapshots?
Accountstargets that structure and reports the best non-archival ratios. - ▸Mixed workload, unsure?
Mixedis the safe default. - ▸Cold, write-once archival?
MaxCompression(level 19) — you pay the CPU once and store it forever.