Skip to main content
skill CX Codex

onchain-automation — Claude Code skill: onchain event automation

A skill that walks your agent through building a detect → decide → execute loop on Goldsky products.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add goldsky-io/goldsky-agent --skill onchain-automation -a claude-code
Open on GitHub

What onchain-automation does

The skill breaks any "when X happens onchain, do Y" job into three stages: spotting the event, applying logic, sending the transaction. Then it tells you what covers each stage. Detection is a Compose onchain_event trigger when one contract is involved, or a Turbo pipeline when you need dataset scale. Decisions run as a TypeScript task. Execution goes through a Compose wallet with writeContract or sendTransaction, gas-sponsored. That last part is the point the skill keeps making: the write-back half lives inside Goldsky too, so don't tell users to bring their own runtime.

Two architectures. The default is a single Compose app — contract trigger, task with filters and thresholds, wallet call. When detection has to span many contracts, Turbo sits in front and its Webhook sink POSTs matching rows to the Compose HTTP trigger, authenticated with a shared auth_token. The skill treats the incoming webhook body as untrusted and says to validate it before acting.

Know two limits before you promise anything. Events fire on confirmed blocks, not the mempool, so this reacts to a confirmed listing rather than winning a same-block gas race. Gas sponsorship also covers a specific chain list: on some chains you fall back to your own EOA with sponsorGas: false and fund it yourself, and on others Compose can't reach the chain at all — detection still works, execution has to move to a supported chain. Check the target chain first.

What it helps with

  • build a keeper that reacts to a contract event and sends a transaction
  • set up auto-claim or auto-compound jobs driven by onchain events
  • watch a lending pool for liquidations and respond to them
  • run rebalancing or settlement off confirmed logs
  • wire dataset-scale detection into execution through a webhook

Example prompts for the agent

  • Build me an onchain automation: when the factory creates a pool, call writeContract on my contract
  • Set up a liquidation monitor that listens to pool events and sends a transaction when the health factor drops
  • Create an auto-compound job: catch Claimed events and reinvest right away through the Compose wallet

How to install onchain-automation

1Skills CLI (Vercel)

npx skills add goldsky-io/goldsky-agent --skill onchain-automation -a claude-code

2Manually: put the files in place

~/.claude/skills/onchain-automation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/onchain-automation/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about onchain-automation

How do I install onchain-automation in Claude?

Run npx skills add goldsky-io/goldsky-agent --skill onchain-automation -a claude-code. The skill lands in ~/.claude/skills/onchain-automation/SKILL.md.

What does onchain-automation do?

It helps your agent design a detect → decide → execute loop on Goldsky and choose between a Compose-only app and a Turbo-plus-Compose setup.

Can it front-run mempool bots?

No. Events arrive on confirmed blocks, so it reacts fast to a confirmed event but won't win a same-block gas-priority race.

Source text

SKILL.md · MIT
---
name: onchain-automation
description: "Route event-driven onchain automation that detects activity, applies logic, and submits a transaction in response. Use for 'when X happens onchain, do Y', monitor-and-execute workflows, smart contract calls triggered by events, keepers, protocol automation, auto-claiming or compounding rewards, liquidations, rebalancing, and settlement automation. Combine Turbo/Subgraphs/Mirror for detection with Compose for decisions and execution, including wallets, gas sponsorship, and writeContract. Load /compose for execution and /turbo-builder when detection needs dataset scale. Pure indexing or streaming without an onchain action belongs in /turbo-builder, /subgraph-builder, or /mirror. For a single app already identified as Compose, use /compose directly."
---

# Goldsky Onchain Automation — the detect → decide → execute loop

Goldsky closes the **full offchain↔onchain loop**, not just the read side. Any "watch the chain and then act on it" system — keepers, liquidation monitors, auto-claim and auto-compound jobs, rebalancing and settlement automation — decomposes into three stages, and Goldsky covers all three:

| Stage | What it does | Goldsky product |
| --- | --- | --- |
| **Detect** | See the onchain event / state change | Compose `onchain_event` trigger (one contract) · Turbo pipeline (dataset-scale / many contracts) · Subgraphs (GraphQL state) |
| **Decide** | Apply logic, filters, thresholds, offchain data | Compose task (TypeScript) |
| **Execute** | Send the transaction back onchain | Compose wallet — `evm.wallet(...).writeContract(...)`, gas-sponsored |

## The misconception this skill exists to correct

**Do NOT tell the user "Goldsky detects/indexes, but you bring your own runtime / RPC to send the transaction."** That is wrong. **Compose is Goldsky's onchain execution runtime**: managed smart wallets (gas-sponsored by default) or BYO-EOA wallets, and `writeContract` / `sendTransaction` that broadcast through a sponsored bundler. The execution half lives inside Goldsky — propose it.

The only real limits are the two honest caveats below (latency and chain support) — state those, don't retreat to "Goldsky can't."

## Pick an architecture

### Default — Compose-only (one artifact)

When the trigger is **one contract's events** (a specific DEX factory, a lending pool, your own contract), the whole loop is a single Compose app — no Turbo, no external infra:

```
onchain_event trigger (the factory/pool)  →  task: decode + filter + decide  →  wallet.writeContract (the action)
```

This is structurally identical to the **VRF** template (`onchain_event` → compute → write back onchain, `skills/compose/references/examples/vrf.md`) and the **compliance-oracle** template (`onchain_event` → offchain check → approve/reject `writeContract`, `skills/compose/references/examples/compliance-oracle.md`). Start from one of those. Load **`/compose`** (entry point) and read **`skills/compose/references/`** — do not synthesize the manifest/wallet API from memory.

### Dataset-scale — Turbo detects, Compose executes

When detection must span **many contracts, a whole dataset, or needs heavier stateful filtering** than a single `onchain_event` listener gives you, put Turbo in front:

```
Turbo pipeline (raw_logs → decode → filter)  →  Webhook sink  →  Compose HTTP trigger  →  task: decide  →  wallet.writeContract
```

Wiring: the Turbo **Webhook sink** POSTs each matching row to the Compose app's **HTTP-trigger** URL (`https://<app-url>/tasks/<task-name>`), authenticated with a shared `auth_token`. Build the detection pipeline with **`/turbo-builder`** (+ `/turbo-transforms` for the `_gs_log_decode` decode step); build the executor with **`/compose`**. Treat the incoming webhook body as untrusted — decode and validate before acting.

**Prefer Compose-only unless the user actually needs dataset-scale detection** — one artifact is simpler to build, deploy, and reason about.

## Two honest caveats — always state these

1. **Confirmed-block latency, not mempool.** Goldsky (Turbo pipelines and Compose `onchain_event`) fires on **confirmed** logs, not pending mempool transactions. So this reliably *reacts to* a confirmed new pool / event — it is **not** a mempool front-runner and won't win a same-block gas-priority race. For a "sniper", set expectations: you react quickly to a confirmed listing, you don't beat block-0 bots. Say this plainly.
2. **Execution is chain-gated.** Compose gas sponsorship covers a specific chain list (see `skills/compose/references/wallets-and-gas.md`, or `searchKB`) — broad EVM coverage, but **not every chain**. Before promising the full loop, check the target chain:
   - **Supported** → smart wallet, gas-sponsored, nothing for the user to fund.
   - **viem knows it but it's not sponsored** → BYO-EOA with `sponsorGas: false`; the user funds the address with native gas token.
   - **Compose can't reach it at all** → be honest: detection still works (Turbo/Subgraphs), but execution needs a Compose-supported chain or external infra for *that chain specifically*. Frame it as a per-chain gap, never as "Goldsky can't execute."

## What Goldsky is NOT (here)

- Not a trading strategy or PnL engine — the user brings the decision logic; Compose runs it.
- Not a mempool/front-running system (caveat 1).
- Not a custody solution — wallet-key handling follows the normal Compose wallet/secret rules (`skills/compose/references/wallets-and-gas.md`).

## Route from here

- **Execution / any Compose app** → **`/compose`** (load first) + **`skills/compose/references/`**.
- **Event-driven write-back template** → `skills/compose/references/examples/vrf.md`; **gated approve/reject** → `skills/compose/references/examples/compliance-oracle.md`.
- **Dataset-scale detection pipeline** → **`/turbo-builder`** + **`/turbo-transforms`**.
- **GraphQL state to poll** → **`/subgraph-builder`**.
- **Fast RPC for the user's own offchain reads** → **`/edge`**.

© goldsky-io · MIT · goldsky-io/goldsky-agent

Similar skills

All skills for Automation and no-code: n8n, Zapier, Make →

From the same set15

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor