services
Get a key

library / AI and blockchain / SI0019

Hackathon agent ideas

A Solana AI agent hackathon rewards a demo that works on live data. Five read-only agent ideas follow, each with its tools and its likely limit, plus one Node file that hands a model four capped reads.

By Carbium · AI product ideas · SI0019 · updated 2026-11-22

01

What the demo needs

An agent project at a hackathon gets about a minute of screen time. In that minute the model has to call a tool, receive a real answer from mainnet and say something a judge can check. Most of the work sits in the tools.

That suits read-only agents. A team with no signer has no wallet to fund, no key on a shared laptop and no half-sent transaction to explain when a demo goes wrong. Mainnet reads are real data already, and a pasted address or signature is an input anyone in the room can try.

The five ideas below share one shelf of tools. The model picks a tool by name, your code runs it against Carbium and hands back a string, and the loop repeats until the model answers. LLM tool calling covers the loop itself.

02

The tool shelf

The file defines four tools, get_slot, get_balance, recent_activity and get_transaction, each with a description, a parameter list for a model's tool schema and a run function. Every read passes commitment: "confirmed". callTool is the one door a model's request goes through.

main.ts
// SI0019 · Hackathon agent ideas// https://carbium.sh/library/si/hackathon-agent-ideas// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.// SPDX-License-Identifier: MIT// Read-only tool shelf for a Solana agent. Run: CARBIUM_KEY=... node main.ts [address]import { address, createDefaultRpcTransport, createSolanaRpcFromTransport, signature } from "@solana/kit";const key = process.env.CARBIUM_KEY;if (!key) {  console.error("Set CARBIUM_KEY to your Carbium API key.");  process.exit(1);}const apiKey: string = key;const rpc = createSolanaRpcFromTransport(  createDefaultRpcTransport({    url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",    headers: { "x-api-key": apiKey },  }),);const commitment = "confirmed";const cap = 1200;type Args = Record<string, string | number>;// Each tool: a description and parameters for the model's schema, and the read it runs.const tools = {  get_slot: {    description: "Current slot.",    params: {} as Record<string, string>,    run: async (_a: Args) => rpc.getSlot({ commitment }).send(),  },  get_balance: {    description: "SOL balance of an address, in lamports.",    params: { address: "base58 address" },    run: async (a: Args) => rpc.getBalance(address(String(a.address)), { commitment }).send(),  },  recent_activity: {    description: "Newest transactions that list an address, newest first.",    params: { address: "base58 address", limit: "1 to 10, default 3" },    run: async (a: Args) => {      const limit = Math.min(Number(a.limit ?? 3), 10);      return rpc.getSignaturesForAddress(address(String(a.address)), { limit, commitment }).send();    },  },  get_transaction: {    description: "One transaction by signature: fee, error and logs.",    params: { signature: "base58 signature" },    run: async (a: Args) =>      rpc        .getTransaction(signature(String(a.signature)), { commitment, encoding: "json", maxSupportedTransactionVersion: 1 })        .send(),  },};// The one door a model's request goes through: unknown names get an error, results are capped.async function callTool(name: string, args: Args): Promise<string> {  if (!Object.keys(tools).includes(name)) return JSON.stringify({ error: `no tool named ${name}` });  try {    const value = await tools[name as keyof typeof tools].run(args);    const out = JSON.stringify({ ok: value }, (_k, v) => (typeof v === "bigint" ? v.toString() : v));    return out.length > cap ? `${out.slice(0, cap)}...(cut at ${cap} characters)` : out;  } catch (e) {    return JSON.stringify({ error: (e as Error).message });  }}const target = process.argv[2] ?? "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";console.log("tools:", Object.entries(tools).map(([n, t]) => `${n}(${Object.keys(t.params).join(", ")})`).join(" "));// A fixed script stands in for the model: the calls it would ask for, in order.async function step(name: string, args: Args): Promise<string> {  console.log(`> ${name} ${JSON.stringify(args)}`);  const text = await callTool(name, args);  console.log(`< ${text}`);  return text;}await step("get_slot", {});await step("get_balance", { address: target });const recent = await step("recent_activity", { address: target, limit: 3 });const first = /"signature":"([1-9A-HJ-NP-Za-km-z]+)"/.exec(recent)?.[1];if (first) await step("get_transaction", { signature: first });else console.log("no signature to read for", target);

run: CARBIUM_KEY=<YOUR_KEY> node main.ts MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr

Set CARBIUM_KEY and pass an address; with none it reads the Memo program, which has traffic at any hour. CARBIUM_RPC_URL overrides the endpoint, which defaults to https://services.carbium.sh. A short script stands in for the model: slot, balance, three recent signatures, then the first signature as a transaction.

Three choices in callTool matter once a real model drives it. An unknown name returns an error string, so an invented tool reaches nothing. Each result is one JSON string cut at 1,200 characters, since the context window is a budget and a full transaction can eat much of it. Errors return as text too, so a 429 reaches the model as something it can read.

get_transaction sets maxSupportedTransactionVersion: 1 with encoding: "json". Mainnet carries v1 transactions, and without that option (or with 0) a call for a v1 transaction, or a block holding one, answers -32015, uncharged.

03

What a run shows

LineMeaning
tools: get_slot() get_balance(address) ...The shelf as a model sees it, names and parameters.
> get_balance then < {"ok":"..."}A call and its capped result. Lamports and slots arrive as strings, since JSON has no bigint.
recent_activity result with signature, slot and errThe newest transactions that list the address. err is null when one succeeded.
get_transaction result with metaFee and err of the first signature. {"ok":null} means the ledger no longer holds it.
{"error":"..."}A failed call as text. The run goes on to the next step.
04

Five ideas on the shelf

Ideas 1 and 2 reuse the shelf as it stands; the others add a tool of their own.

IdeaTools and what the model doesWatch for
1. Wallet explainerrecent_activity, then get_transaction for each signature; the model writes what the wallet didA token transfer to an existing token account lists the token accounts and the sender's authority, never the receiving wallet
2. Failed-transaction doctorget_transaction on a pasted signature; the model reads meta.err and the logsAn older signature can answer null; say so to the user
3. Program pulselogsSubscribe with mentions on one program; the model summarizes a batch every minuteOpening costs 25 credits, then 20 per MiB sent
4. Fee advisorgetRecentPrioritizationFees and getRecentPerformanceSamples; the model recommends a fee setting, as in Priority fee per compute unitThe agent advises and a person sends
5. Quote explainerquote on the RPC endpoint, a JSON-RPC method next to swap, health and prices; the model explains the route and fee in plain wordsswap returns an unsigned transaction, so a demo stops there unless you add a signer

Pick by what a judge can try. Ideas 1 and 2 take a pasted input and answer in plain words, so they demo live with no setup. Idea 3 needs a busy program on screen and a summary that visibly changes. Idea 5 ends at an unsigned transaction, and a landed one needs a signer you write and keep apart, as Agent RPC key safety describes.

A new tool goes on the shelf the same way: one description, one parameter list, one run. A tool that signs or sends does not belong there.

05

Cost of one agent turn

A turn is a chain of tool calls, and each call spends cells, the admission charge per call. get_slot is a cheap cached read at 1 cell. recent_activity and get_transaction cost 50 cells each.

Plan`getSignaturesForAddress``getTransaction`
Free ($0)0.24 req/s0.24 req/s
Dev ($20)1.2 req/s1.2 req/s
Business ($250)100 req/s5 req/s
Pro ($500)500 req/s25 req/s

A class absorbs bursts up to 1,024 cells or one second of its rate, whichever is larger. On Free that is about 20 calls at 50 cells, so one demo turn passes. Past the burst the refill rate rules. A model will not count cells, so cap the calls per turn in the loop and pause before the next one.

The live part is priced in credits. A logs mentions subscription opens at 25 credits and then costs 20 credits per MiB sent; a refused one is free. If each notification is 2 KiB, 50 notifications a second is about 352 MiB an hour, close to 7,000 credits, or 1.4% of the 500K Free grant. Summarize in batches and the model reads one batch a minute, whatever the rate.

Quotes for idea 5 spend no credits, because the quote plan is the meter; Free allows 10 quotes a second. The router fee on a quote, platformFee, is 5 bps (0.05%), charged on chain in the transaction, and the key needs the QUOTE scope or the call gets 401 -32001.

06

Where it ends

  • The shelf only reads. An agent that signs needs a signer in a separate process, with limits the model cannot edit.
  • getSignaturesForAddress reaches back 30 days at most, from Carbium's own address index. Its pages can list signatures below the validator's ledger floor, so getTransaction can answer null for an older one. The file prints that null, and the model has to be told what it means.
  • Transaction text is written by whoever sent it. Memo text and program logs reach the model as tool results, so treat them as data in the prompt. A read-only shelf limits what a hostile string can do.
  • The fixed script runs no model, so the choice of tools per turn is yours to test.
  • A wallet can own more than one token account for one mint, so a wallet explainer that reads a single account understates the holding.
  • getTokenLargestAccounts, getProgramAccountsV2 and other methods are not served and answer -32601, so an idea that ranks top holders needs another route.
07

When it goes wrong

what goes wrongwhat to do
get_transaction returns {"ok":null}.The signature is older than the ledger the node holds, though the address index listed it. Run the shelf on the newest signatures and tell the model that null means out of reach.
A transaction call answers -32015.The call left maxSupportedTransactionVersion out or sent 0, and the transaction is v1. Send 1 with an encoding, as get_transaction does.
A tool result is a 429.Too many 50-cell calls in one turn. callTool passes on only the error message, so the model never sees the retry-after value. Have the loop read the retry-after header from the transport or fall back to a fixed pause, and cap the calls per turn. Every key on the account shares the budget, so another loop may be spending it.
A tool result reads {"error":"Do not know how to serialize a BigInt"}.Kit returns slots, lamports and fees as bigint, which JSON.stringify refuses. The replacer in callTool writes them as strings, so keep it when you change that line.
The first call answers 401.The key is not recognized. Attach the whole key in the x-api-key header and check that CARBIUM_KEY holds it with no extra characters.
A call answers -32601.The method is not served or not found. Do not retry it; check the method name.
08

Questions

Which model does the shelf work with?

Any model that takes a tool or function schema. Each tool's description and parameter list map to a name, a description and a parameters object, and callTool takes the name and arguments the model returns. The file calls no model.

Can the agent send a transaction?

Not through this shelf. The swap method builds an unsigned transaction that you sign and send through any RPC, and signing stays with a process you control.

Does it run on the Free plan?

Yes. One run makes a slot read, a balance read and two 50-cell calls, which fit in the burst allowance. A turn that loops over many transactions meets the 0.24 req/s refill.

Can a transaction's text attack the model?

Yes, a memo or log line is text its sender chose. Keep tool results as data, keep the shelf read-only, and the worst a hostile string can do is waste a turn.