/goldsky:turbo-transformsfrom Goldsky
Writes SQL, TypeScript, and dynamic table transforms for Turbo pipelines. Covers EVM log decoding, filtering, UNION ALL, TypeScript/WASM transforms, dynamic tables, and Solana decoding.
Ships in Goldsky. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write, understand, and debug SQL, TypeScript, and dynamic table transforms for Turbo pipeline configurations.
Identify what the user needs (decode, filter, reshape, combine, custom logic, or lookup joins), then use the relevant section below. If generating a complete pipeline YAML (not just a transform snippet), always validate with goldsky turbo validate before presenting it to the user.
Reference files for specialized topics:
references/evm-patterns.md — Advanced EVM patterns (decode-once-filter-many, UNION ALL, schema normalization)references/typescript-transforms.md — TypeScript/WASM script transforms and handler transformsreferences/dynamic-tables.md — Dynamic table transforms (allowlists, lookup joins)references/solana-patterns.md — Solana instruction/log decoding and function examplestransforms:
my_transform:
type: sql
primary_key: id
sql: |
SELECT id, block_number, address
FROM my_source
WHERE address = '0xabc...'
| Field | Required | Description |
|---|---|---|
type | Yes | sql, script, handler, dynamic_table, or throttle |
primary_key | Yes* | Column used for uniqueness and ordering (*not for throttle) |
sql | Yes | SQL query (for sql type transforms) |
FROM my_sourceFROM my_transformfrom field in SQL transforms — the FROM clause in SQL handles itTurbo SQL is powered by Apache DataFusion in streaming mode. The following are NOT supported:
dynamic_table transforms for lookup-style joins insteadpostgres_aggregate sink instead_gs_op ColumnEvery record includes a _gs_op column that tracks the operation type: 'i' (insert), 'u' (update), 'd' (delete). Preserve this column through transforms for correct upsert semantics in database sinks.
Quick reference for the most-used functions. For the complete function reference, see SQL transforms in the docs.
evm_log_decode() — Decode Raw EVM Logsevm_log_decode(abi_json, topics, data) -> STRUCT<name, event_params>
-- Aliases: _gs_log_decode, evm_decode_log
Returns decoded.event_signature (event name) and decoded.event_params[N] (1-indexed parameters as strings).
Example:
SELECT
_gs_log_decode('[{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]',
topics, data) AS decoded,
id, block_number, transaction_hash, address, block_timestamp
FROM my_raw_logs
Tips: Backtick-escape reserved words (`data`, `decoded`). Include all event ABIs in one array. Pre-filter by contract address at the source level for efficiency.
| Function | Purpose |
|---|---|
fetch_abi(url, format) | Fetch ABI from URL ('raw' or 'etherscan' format) |
_gs_keccak256(string) | Keccak256 hash (returns hex with 0x prefix) |
xxhash(string) | Fast non-cryptographic hash for composite keys |
to_u256(value) / u256_to_string(u256) | 256-bit integer math (avoids precision loss) |
dynamic_table_check(table, value) | Check if value exists in a dynamic lookup table |
to_timestamp(seconds) | Convert unix seconds to timestamp |
SELECT balance.token_type, balance.owner_address,
CAST(`balance` AS STRING) AS balance_amount
FROM my_balances_source balance
WHERE balance.token_type = 'ERC_20' AND balance.balance IS NOT NULL
transforms:
usdc_transfers:
type: sql
primary_key: id
sql: |
SELECT * FROM base_transfers
WHERE address = lower('0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913')
transforms:
clean_transfers:
type: sql
primary_key: id
sql: |
SELECT id, block_number, to_timestamp(block_timestamp) AS block_time,
address AS token_address, sender, recipient, amount
FROM my_source
-- Token amount conversions
(CAST(decoded.event_params[3] AS DOUBLE) / 1e6) AS amount_usdc -- 6 decimals
(CAST(decoded.event_params[3] AS DOUBLE) / 1e18) AS amount_eth -- 18 decimals
CAST(`balance` AS STRING) AS balance_amount -- preserve precision
| Token | Decimals | Divisor |
|---|---|---|
| USDC, USDT | 6 | 1e6 |
| WBTC | 8 | 1e8 |
| ETH, most ERC-20 | 18 | 1e18 |
CASE WHEN decoded.event_params[4] = '0' THEN 'BUY' ELSE 'SELL' END AS side
WHERE decoded.event_params[1] NOT IN ('0x4bfb...', '0xc5d5...', '0x4d97...')
Build multi-step pipelines where each transform reads from the previous:
transforms:
decoded:
type: sql
primary_key: id
sql: |
SELECT _gs_log_decode('[...]', topics, data) AS decoded,
id, block_number, transaction_hash, address, block_timestamp
FROM raw_logs_source
transfers:
type: sql
primary_key: id
sql: |
SELECT id, block_number, decoded.event_params[1] AS from_address,
decoded.event_params[2] AS to_address,
(CAST(decoded.event_params[3] AS DOUBLE) / 1e18) AS amount
FROM decoded
WHERE decoded.event_signature = 'Transfer'
Combine transforms with identical schemas into a single output:
all_events:
type: sql
primary_key: id
sql: |
SELECT * FROM transfers
UNION ALL
SELECT * FROM approvals
All branches must have the same columns in the same order. Use '' or 0 as placeholders.
For advanced EVM patterns (decode-once-filter-many, normalizing disparate events, multi-event activity feeds), read references/evm-patterns.md.
Filter data at the source before it reaches transforms for efficiency:
sources:
my_logs:
type: dataset
dataset_name: matic.raw_logs
version: 1.0.0
start_at: earliest
filter: >-
address IN ('0xabc...', '0xdef...')
AND block_number >= 82422949
filter: → coarse pre-filtering (contract addresses, block ranges)WHERE → fine-grained filtering (event types, parameter values, exclusions)sinks:
my_sink:
type: clickhouse
from: my_transform
table: my_table
secret_name: MY_SECRET
primary_key: id
batch_size: 1000
batch_flush_interval: 300ms
| Use Case | batch_flush_interval | batch_size |
|---|---|---|
| Real-time dashboards | 300ms | 1000 |
| Moderate throughput | 1000ms | 1000 |
| High-volume streaming | 10s | 100000 |
"Unknown source reference" — FROM clause name doesn't match any source/transform key. Check for typos.
"Missing primary_key" — Every transform needs primary_key. Almost always use id.
"Column not found" — Use goldsky turbo inspect <pipeline> -n <source_node> -p to see actual columns.
Empty results from decoded events:
decoded.event_signature matches event name exactly (case-sensitive)address filter matches correct contractdecoded.event_params[1], not [0]Type mismatch in UNION ALL — All branches need identical column counts and compatible types.
goldsky turbo inspect <pipeline-name> -n <transform_name> -p
For logic SQL can't express: custom parsing, BigInt arithmetic, stateful processing. Schema types: string, uint64, int64, float64, boolean, bytes.
Key rules: define function invoke(data), return null to filter, return object matching schema, no async/await or external imports.
See references/typescript-transforms.md for full docs, examples, and the SQL-vs-script decision table. Also includes Handler transforms for HTTP enrichment.
Updatable lookup tables for allowlists, blocklists, and join-style enrichment — without redeploying. Backed by PostgreSQL (durable) or in-memory (fast). Use dynamic_table_check('table_name', column) in SQL.
See references/dynamic-tables.md for full config, backend options, REST API updates, and wallet-tracking example.
Caps the throughput of a stream by buffering records into batches and emitting each batch on a fixed minimum interval. Throttle does not modify data — every input record passes through unchanged. Use it to:
handler so the receiving service is not overwhelmedtransforms:
throttled:
type: throttle
from: my_source # source or transform
max_batch_size: 100
min_batch_interval: 10s
| Field | Required | Description |
|---|---|---|
type | Yes | throttle |
from | Yes | Source or transform to read from |
max_batch_size | No | Max records per batch |
min_batch_interval | No | Minimum time between batches (e.g. 10s, 500ms, 1m) |
A batch is flushed downstream when both max_batch_size records have accumulated and min_batch_interval has elapsed since the previous batch. Effective max throughput ≈ max_batch_size / min_batch_interval records per second.
Best practices:
max_batch_size to match the downstream sink's preferred batch size.transform — chain other transforms downstream from it the same way you would any other transform (e.g. from: throttled in a sink).primary_key field (records pass through unchanged).IDL-based instruction decoding, program-specific decoders (Token, System, Stake, Vote), SPL token tracking.
See references/solana-patterns.md for all built-in decoders, full example pipeline, and array/JSON/hex function usage.
/turbo-builder — Build and deploy pipelines interactively using these transforms/turbo-doctor — Diagnose and fix pipeline issues (including transform errors)/turbo-pipelines — Pipeline YAML configuration and architecture reference/turbo-operations — Lifecycle commands and monitoring reference/datasets — Blockchain dataset and chain prefix referenceevals/trigger-eval.json (opens in a new tab)references/dynamic-tables.md (opens in a new tab)references/evm-patterns.md (opens in a new tab)references/solana-patterns.md (opens in a new tab)references/typescript-transforms.md (opens in a new tab)templates/multi-event-activity-feed.yaml (opens in a new tab)templates/throttled-webhook.yaml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub goldsky-io/goldsky-agent --plugin goldsky16 skills in this plugin
/auth-setupSet up Goldsky CLI authentication and project configuration. Use this skill when the user needs to: install the goldsky CLI (what's the official install command?), run goldsky login (including when the browser opens but 'authentication failed'), run goldsky project list and see 'not logged in' or 'unauthorized', switch between Goldsky projects, check which project they're currently authenticated to, or fix 'unauthorized' errors when running goldsky turbo commands. Also use for 'walk me through setting up goldsky CLI from scratch for the first time', and when they just installed Goldsky and say 'Set it up and help me get started'. If any other Goldsky skill hits an auth error, redirect here first./boostConfigure and troubleshoot Goldsky Boost, the free RPC caching CDN in front of a provider the user already pays for. Use for cutting RPC bills without migrating, connecting Alchemy/QuickNode/Infura upstreams, goldsky boost, edge.goldsky.com/boost, verification, cache hit rates, eth_getLogs forwarding, and x-cache / x-edge-billable / x-edge-source headers. Boost keeps the existing provider and forwards uncached requests. To replace a provider with Goldsky's managed RPC, use /edge. Pipeline, Subgraph, and Compose tasks have separate skills./datasetsUse this skill when the user needs to look up or verify Goldsky blockchain dataset names, chain prefixes, dataset types, or versions. Triggers on questions like 'what\'s the dataset name for X?', 'what prefix does Goldsky use for chain Y?', 'what version should I use for Z?', or 'what datasets are available for Solana/Stellar/Arbitrum/etc?'. Also use for chain-specific dataset questions (e.g., polygon vs matic prefix, stellarnet balance datasets, solana token transfer dataset names), and to answer 'is there a dataset for X?' where X is a domain rather than a chain — decoded logs, token transfers and balances, mint/burn events for circulating supply, DEX or prediction-market activity (Polymarket), or the raw blocks, transactions and traces behind wallet history and reconciliation. Do NOT trigger for questions about CLI commands, pipeline setup, or general Goldsky architecture unless the core question is about finding the right dataset name or chain prefix. Feeds REST queries (Polymarket, blocks) are /feeds./edgeConfigure and troubleshoot Goldsky Edge, Goldsky's managed EVM RPC endpoint service. Use for Edge RPC, Goldsky RPC endpoints, edge.goldsky.com, slow eth_getLogs, rate limits, hedged requests, flashblocks, HyperEVM system transactions, x402 pay-per-request RPC, pricing, the Edge dashboard, gs_edge_ keys, rpc-edge, and errors -32005/-32012/-32014/-32015/-32016. Covers resilient low-latency EVM endpoints and provider comparisons. For self-hosted eRPC configuration, consult docs.erpc.cloud/llms.txt. To keep an existing provider and reduce its bill through caching, or for x-cache / x-edge-billable / goldsky boost, use /boost. REST reads under edge.goldsky.com/data (Feeds: wallets, tokens, Polymarket, blocks; formerly Edge Data / Data APIs) are /feeds. Pipeline and Subgraph questions have separate skills./feedsQuery Goldsky Feeds over HTTP: one wallet's balances and transfers; metadata and current USD price of up to 100 EVM tokens; Polymarket activity (a wallet's trades), positions, PnL and balances; block headers by number, hash or timestamp; and a chain's head block. Feeds absorbed Edge Data / Data APIs, with the same URLs and keys. Use for wallet holdings, portfolio value, transfer history, deposit checks, token prices or metadata, a wallet's Polymarket trades or positions, which block was at a timestamp, the latest indexed block, edge.goldsky.com/data, a Feeds API key, Feeds pricing, or paying per request with x402 instead of a key. Get the key with goldsky feeds key reveal, then call the feeds over HTTP. The CLI login token is not this key. For rows in the user's own database, use /turbo-builder. For a Turbo dataset name, use /datasets. For JSON-RPC, use /edge or /boost./mirrorUse this skill when the user asks about Goldsky Mirror pipelines — creating, deploying, operating, or troubleshooting Mirror. Triggers on: 'Mirror pipeline', 'goldsky pipeline apply', 'sync subgraph to database', 'mirror vs turbo', 'direct indexing', 'mirror pipeline YAML', 'mirror pipeline pause/stop/restart'. Also use this skill when the user wants to sync a Goldsky subgraph into a database or message queue — Mirror is the only pipeline product that supports subgraph sources. For new pipelines that don't need a subgraph source, the turbo-builder skill is usually a better fit. Do NOT trigger on 'goldsky turbo' commands or generic 'build a pipeline' requests without subgraph context — those belong to the turbo skills.Other plugins' skills for the same job