CodePad

the block library

Every block a coin can hold.

All 134 blocks across 15 families — what each one does, what it asks for, and whether it runs for real on a launched coin. Tap Ask Bolt on any block to start a rule with it.

134 blocks15 families9 runtime moduleslive via relay
EV

Events 19 blocks

When things happen on your coin.

tradesvolumeholderstime

EVENTS · 17

EV
when trade happensany side▾

Runs on every trade of the project token.

starts a ruleSolana
EV
when volume changes

Runs whenever traded volume changes.

starts a ruleSolana
EV
every10SOL of volume

Runs each time cumulative volume crosses another multiple of the amount.

starts a ruleSolana
EV
when creator fees arrive

Runs when creator fees land in the coin's vault.

starts a ruleSolana
EV
when market cap crossesabove▾$100000

Runs once each time market cap crosses the threshold in that direction.

starts a ruleSolana
EV
when holder count crossesabove▾1000

Runs once each time the holder count crosses the threshold.

starts a ruleSolana
EV
when wallettreasuryreceives funds

BUILDER ONLY. Runs when the given wallet receives a transfer. It never runs on a launched coin; use "when creator fees arrive" instead.

starts a ruleSolana
EV
when token graduates

Runs when the token graduates from its bonding curve.

starts a ruleSolana
EV
every60minutes

Runs on a repeating timer.

starts a ruleCore
EV
at time12:00each day

Runs daily at the given local time (HH:MM).

starts a ruleCore
EV
when webhookmy-hookreceived

Runs when a request hits this project's webhook path.

starts a ruleCore
EV
when website eventvisithappens

Runs when the project website emits the named event.

starts a ruleWebsite
EV
when agent completes task

Runs after any agent finishes a Run Agent task.

starts a ruleAI
EV
when bounty submission arrives

Runs when someone submits work to an open bounty.

starts a ruleBounties
EV
when buttonGopressed

Runs when the named button is pressed in the simulator.

starts a ruleCore
EV
when market caprises above▾$50000

Runs once each time the coin's market cap (in USD) passes this level. After it runs it waits until the market cap has moved back past the level by at least 5% before it can run again, so a coin sitting right on the line does not set it off over and over. Pretend trades move the pretend market cap in the builder; real trades do on a live coin.

starts a ruleSolanarolling out
EV
when pricedrops▾by20% within10minutes

Runs when the coin's price falls (or climbs) by at least this percent inside this many minutes, measured from the highest (or lowest) price in that time. It runs once for a move, then rests for the same number of minutes. Pretend trades move the pretend price in the builder; real trades do on a live coin.

starts a ruleSolanarolling out

VALUES · 2

EV
eventamount▾

A value from the event that started this script. Fields the event doesn't provide are empty.

gives a valueCore
EV
coinmarket cap (USD)▾

Your coin's numbers right now: market cap in USD, holder count, price per token in SOL, and volume and trades since launch. Simulated in the builder; real once the coin is live.

gives a valueSolana
LG

Logic 11 blocks

Decide what happens next.

ifrepeatwaitchance

ACTIONS · 11

LG
ifcondition
then

Runs the inner blocks only when the condition is true.

does somethingCore
LG
ifcondition
then
else

Runs one branch or the other depending on the condition.

does somethingCore
LG
repeat3times

Runs the inner blocks a number of times.

does somethingCore
LG
for eachitem ▾inlist

Runs the inner blocks once per list item, with the item stored in the variable.

does somethingCore
LG
wait1seconds

Pauses this script.

does somethingCore
LG
at most once every60seconds

Skips the inner blocks if they already ran within the cooldown window.

does somethingCore
LG
stopthis script▾

Ends execution.

ends a ruleCore
LG
run in parallel
branch A
branch B

Runs both branches at the same time and continues when both finish.

does somethingCore
LG
run sequencesteps

Groups blocks into a named, collapsible sequence.

does somethingCore
LG
with25% chance
do
otherwise

Randomly picks a branch: the first runs with the given probability.

does somethingCore
LG
switch onvalue
casea
caseb
casec
default

Runs the branch whose case text equals the value, or the default.

does somethingCore
CT

Checks 7 blocks

Yes-or-no questions for your ifs.

compareand / orchance

VALUES · 7

CT
a=▾b

Compares two values.

yes / noCore
CT
hello worldcontainsworld

True if the text contains the substring, or the list contains the item.

yes / noCore
CT
aand▾b

Combines two conditions.

yes / noCore
CT
notvalue

Inverts a condition.

yes / noCore
CT
valueexists

True if the value is set (not empty).

yes / noCore
CT
random chance25%

True with the given probability.

yes / noCore
CT
walletwalletowns tokentoken

True if the wallet holds any of the token. Leave the token empty for your own coin. Read from Solana when live; simulated in the builder for made-up wallets.

yes / noSolana
DT

Data 15 blocks

Lists, randomness and numbers.

randomlistsmath

VALUES · 15

DT
0

A number.

gives a valueCore
DT
text

A piece of text. {name} inserts the value of a variable.

gives a valueCore
DT
true▾

True or false.

yes / noCore
DT
lista, b, c

A list of comma-separated items. Numbers stay numbers.

gives a valueCore
DT
objectkey=value, score=1

An object written as key=value pairs.

gives a valueCore
DT
current timestamp

Milliseconds since 1970.

gives a valueCore
DT
1+▾1

Adds, subtracts, multiplies or divides.

gives a valueCore
DT
10% of100

A percentage of a number.

gives a valueCore
DT
min▾of1and2

The smaller or larger of two numbers.

gives a valueCore
DT
random number from1to10

A random whole number between the bounds, inclusive.

gives a valueCore
DT
random item fromNVDA, TSLA, AAPL, META, AMD

Picks one item at random.

gives a valueCore
DT
length oflist

Number of items in a list.

gives a valueCore
DT
item1oflist

The item at a position (1 = first).

gives a valueCore
DT
keyofobject

Reads one field of an object.

gives a valueCore
DT
joinhello world

Joins two values into text.

gives a valueCore
ST

State 7 blocks

Remember things between runs.

setchangeread

VALUES · 1

ST
score ▾

The value of a variable. Variables persist between executions.

gives a valueCore

ACTIONS · 6

ST
setscore ▾to0

Stores a value in a variable.

does somethingCore
ST
changescore ▾by1

Adds to a number variable (use a negative number to subtract).

does somethingCore
ST
incrementscore ▾

Adds 1 to a variable.

does somethingCore
ST
resetscore ▾

Clears a variable back to empty.

does somethingCore
ST
appendthingto listitems ▾

Adds a value to the end of a list variable (creates the list if needed).

does somethingCore
ST
removefirst item▾valuefrom listitems ▾

Removes from a list variable. 'items equal to' removes every item equal to the value.

does somethingCore
AG

Agents 13 blocks

Characters that live in your world.

creatememorytools

VALUES · 3

AG
nameofagent

Reads a property: name, species, personality, budget, score, inventory, or any custom property.

gives a valueAI
AG
random existing agent

One of the project's agents, picked at random.

gives a valueAI
AG
all agents

A list of every agent in the project.

gives a valueAI

ACTIONS · 10

AG
create agentcat, frog, penguin

Creates a persistent agent entity: unique id, identity, properties, memory, inventory and activity history.

does somethingAI
AG
run agentagent
taskExplore something strange on the web.

Gives the agent a task. The result is an object with response, decision and data.

does somethingAI
AG
giveagenttoolbrowser▾

Permanently grants an agent a tool.

does somethingAI
AG
giveagentan on-chain wallet

SIMULATED in the builder, real on a live coin. Gives the agent its own wallet address (it starts empty). Nothing is spent.

does somethingFinancepretend in builder
AG
fundagentwith0.1SOL from the coin's money

SIMULATED in the builder, real on a live coin. Sets this amount aside for the agent from the coin's claimed fees. The agent can never spend more than it was given.

does somethingFinancepretend in builder
AG
agentagentsends0.01SOLto walletwallet

SIMULATED in the builder, real on a live coin. The agent sends SOL (or a token, by its address) from its own wallet. It counts against the coin's spending limits.

does somethingFinancepretend in builder
AG
agentagentbuys$COINfor0.01SOL

SIMULATED in the builder, real on a live coin. The agent buys with SOL it was given, and what it buys lands in its own wallet. On a live coin an agent can only buy the coin itself ($COIN) or a token by its address. It counts against the coin's spending limits.

does somethingFinancepretend in builder
AG
rememberSomething happened.in memory ofagent

Appends an entry to the agent's memory.

does somethingAI
AG
setholdingsofagenttovalue

Sets a property on the agent.

does somethingAI
AG
remove agentagent

Retires the agent from the project.

does somethingAI
AI

AI 7 blocks

Names, words and decisions.

askwritedecide

VALUES · 7

AI
ask AIWrite a one-line motto.

Returns the model's text answer.

gives a valueAI
AI
AI structured outputInvent a mascot.
fieldsname, mood, catchphrase

Returns an object with exactly the listed fields.

gives a valueAI
AI
AI choose fromred, green, blue

The model picks one option.

gives a valueAI
AI
AI classifytext
intopositive, neutral, negative

Returns one of the labels.

gives a valueAI
AI
AI summarizetext

A short summary.

gives a valueAI
AI
AI generate identity fora capybara

Returns an object with name, personality, bio and emoji.

gives a valueAI
AI
AI decidesIs this a good idea?

The model answers yes or no.

yes / noAI
WB

Web 6 blocks

Talk to the rest of the internet.

searchpagesAPI

VALUES · 5

WB
search web forstrange deep sea creatures

A list of results, each with title, url and snippet. Made-up results in the builder. A live coin needs this site's search service: without it the launch is refused or the step fails. A live coin never gets made-up results.

gives a valueBrowser
WB
open pagehttps://example.com

Opens a URL or a search result. Returns a page object (title, url, text, links).

gives a valueBrowser
WB
text of pagepage

The readable text of a page.

gives a valueBrowser
WB
follow link1on pagepage

Opens the nth link of a page.

gives a valueBrowser
WB
HTTPGET▾https://api.coingecko.com/api/v3/ping

Calls a web address and gives back { status, ok, body } (JSON bodies are read for you). Headers as "Name: value" lines. Public addresses only, at most 10 web calls per run. In the builder only GET is sent; other methods are sent once your coin is live.

gives a valueBrowser

ACTIONS · 1

WB
save findingFinding
detailscontent

Stores a finding in the project's findings list and on the agent.

does somethingBrowser
MD

Media 5 blocks

Pictures and cards.

imagecardavatar

VALUES · 3

MD
generate image ofa capybara in a tiny suit

Returns an image URL. The builder returns a placeholder picture. A live coin needs this site's image service: without it the launch is refused or the coin gets a placeholder picture.

gives a valueAI
MD
generatecaption▾abouttopic

Writes a short piece of text.

gives a valueAI
MD
choose image from🐸, 🐱, 🐧

Picks one image (URL or emoji) at random.

gives a valueAI

ACTIONS · 2

MD
create cardNew card
texttext

Adds a visual card to the project world.

does somethingWebsite
MD
set avatar ofagentto🦫

Changes an agent's visual.

does somethingAI
WD

Worlds 13 blocks

A place for everything to live.

feedcountersentities

ACTIONS · 13

WD
create entity of typeitem
nameThing

Creates a persistent entity that appears in the project world.

does somethingWebsite
WD
setstatusof entityentitytovalue

Sets a property on an entity (or agent).

does somethingWebsite
WD
delete entityentity

Removes an entity from the world.

does somethingWebsite
WD
show in project worldagent

Places an agent or entity on the world stage.

does somethingWebsite
WD
addentityto collectionshelf

Adds an item to a named collection shown in the world (shelf, gallery, team…).

does somethingWebsite
WD
post to project feedSomething happened!

Adds a line to the project feed. {name} inserts a variable.

does somethingWebsite
WD
change countervisitorsby1

Changes a public counter displayed on the project site.

does somethingWebsite
WD
set websiteheadlinetoHello!

Updates a key in the project website's public state.

does somethingWebsite
WD
AI build website fromA fun site for my frog coin

The AI designs your coin's website (title, sections, theme) from your words. It only picks from safe pieces, never raw code.

does somethingWebsite
WD
add website sectiontext▾
titledAbout
contentHello!

Adds a section to the website. Content: text as is; cards as lines “Title: text”; stats as “Label = holders”; links as “Label | https://...”; image as an address; button as its label.

does somethingWebsite
WD
update website section1(number, title or hero)
new titletitle
new contentbody

Changes a website section. Leave a box empty to keep what is there. “hero” changes the top of the page (title, then tagline).

does somethingWebsite
WD
set website thememidnight▾

Picks one of the website's ready-made looks.

does somethingWebsite
WD
show notificationHello!

Pops a notification in the preview.

does somethingWebsite
FN

Money 16 blocks

Send, buy back, burn and airdrop from the coin's vault.

sendbuy backairdrop

VALUES · 8

FN
SOL balance of wallettreasury

A wallet's SOL balance. Made up in the builder, read from Solana on a live coin. Leave it as "treasury" for the coin's own spendable fees.

gives a valueSolana
FN
treasurySOL▾

The coin's collected creator fees that are not spent yet. Pretend numbers in the builder, the real amount on a live coin.

gives a valueFinance
FN
budgetcomputeBudget

BUILDER ONLY. The current amount in a named budget. A live coin can't keep budgets properly, so don't use budgets in a coin you plan to launch.

gives a valueFinance
FN
budgetcomputeBudgethas at least1

BUILDER ONLY. True if the budget holds at least the amount. A live coin can't use budgets properly, so don't use this in a coin you plan to launch.

yes / noFinance
FN
a random buyer from the last60minutes

The wallet of one buyer of this coin, picked at random from everyone who bought in that time. Every buyer has the same chance, however many times they bought. Plug it into the wallet slot of Send. The pick is seeded from the event that started the run and written on the receipt. If nobody bought in that time, the Send is skipped and nothing is paid. The coin remembers its last 200 buys. Pretend buys in the builder, real ones on a live coin.

gives a valueSolanarolling out
FN
the biggest buyer of the last60minutes

The wallet that bought the most of this coin in that time, counting all of its buys together (in SOL). Plug it into the wallet slot of Send. If nobody bought in that time, the Send is skipped and nothing is paid. The coin remembers its last 200 buys. Pretend buys in the builder, real ones on a live coin.

gives a valueSolanarolling out
FN
the latest buyer

The wallet of the most recent buyer of this coin. Plug it into the wallet slot of Send. If nobody has bought yet, the Send is skipped and nothing is paid. Pretend buys in the builder, real ones on a live coin.

gives a valueSolanarolling out
FN
buys in the last60minutes

How many buys of this coin happened in that time. The coin remembers its last 200 buys, so this never counts past 200. Pretend buys in the builder, real ones on a live coin.

gives a valueSolanarolling out

ACTIONS · 8

FN
send0.1SOL▾to walletwallet

Sends SOL to a wallet. Pretend in the builder. On a live coin it is a real payment from the coin's own fees, inside its limits.

does somethingFinance
FN
buy0.03SOL▾of$COIN

Buys the coin back with SOL, or buys a tokenized stock (plug in a stock block). Pretend in the builder. On a live coin it is a real buy paid from its own fees: a coin can trade only itself and up to 3 stocks picked at launch. Set “as a percent of” to spend a percent of the event's own amount (e.g. the fees that just arrived) or of the coin's claimable fees instead of the flat amount above; leave it on “nothing” to use the amount as is.

does somethingFinance
FN
sell0.03SOL▾of$COIN

Sells some of this coin that its wallet holds, or a percent of a tokenized stock it holds (plug in a stock block: 50 sells half, 100 sells all). Pretend in the builder, a real sale on a live coin. For the coin itself, on a live coin the number is how many tokens to sell, not an amount of SOL.

does somethingFinance
FN
add1to budgetcomputeBudget

BUILDER ONLY. Puts some of the coin's funds into a named budget. A live coin can't use budgets properly (the money can get stuck), so don't use this in a coin you plan to launch.

does somethingFinance
FN
spend1from budgetcomputeBudget

BUILDER ONLY. Spends from a named budget. Fails if the budget is too small. A live coin can't use budgets properly, so don't use this in a coin you plan to launch.

does somethingFinance
FN
burn1tokens▾of $COIN

Pretend in the builder, real on a live coin. Burns (destroys forever) some of the coin's own tokens held in its wallet. Pick a flat number of tokens, or a percent of what the coin wallet currently holds. A live coin burns for real (an on-chain SPL burn); nothing is sent to anyone, including the project.

does somethingFinance
FN
airdrop1a fixed amount▾ofSOL▾
tothe top▾10holders

Pretend in the builder, real on a live coin. Pays holders of this coin. “Top” splits the amount equally among that many top holders; “all” splits it in proportion to what each holder has. “A random” holder pays the whole amount to ONE holder, whatever number you type. The random pick is seeded from the triggering event, so it's the same pick every time this exact event is replayed (recorded in the receipt). A live coin pays at most the launch terms' recipient cap in one run.

does somethingFinance
FN
split1from budgettreasury
equally intocomputeBudget, rewardBudget, purchaseBudget

BUILDER ONLY. Moves an amount from one budget, divided equally into others. A live coin can't use budgets properly (the money can get stuck), so don't use this in a coin you plan to launch.

does somethingFinance
SK

Stocks 2 blocks

Tokenized stocks a coin can trade

VALUES · 2

SK
stockNVDA▾

A tokenized stock, such as NVDA (NVIDIA). Plug it into buy or sell. A coin can trade at most 3 different stocks, picked from 15 and fixed at launch. Tokenized stocks are not the shares themselves.

gives a valueFinance
SK
random stock fromNVDAx, TSLAx

Picks one of these tokenized stocks at random each time it runs. Every stock in the list counts toward the coin's 3 stocks.

gives a valueFinance
BT

Bounties 7 blocks

Reward people for doing things.

createjudgepay

VALUES · 2

BT
latest▾submission ofbounty

Reads a submission (wallet, content, score, status).

gives a valueBounties
BT
AI reviewsubmission
criteriaIs it funny and on-topic?

Returns { score 0-100, approved, feedback }.

gives a valueAI

ACTIONS · 5

BT
create bountyMake a meme
reward0.5SOL deadline24hours

Opens a bounty. Pretend in the builder. On a live coin the reward is a real payment from the coin's fees to whoever's entry is approved.

does somethingBounties
BT
wait for submission tobounty

Marks the bounty as accepting work. Submissions trigger 'when bounty submission arrives'.

does somethingBounties
BT
approvesubmission

Marks the submission approved.

does somethingBounties
BT
rejectsubmission

Marks the submission rejected.

does somethingBounties
BT
pay reward forsubmission

SIMULATED in the builder, a real payment from the coin's fees on a live coin. Pays the bounty's reward to the wallet that sent the submission.

does somethingFinancepretend in builder
OP

Social 3 blocks

Post where your holders are.

postwebhookemail

ACTIONS · 3

OP
send webhook tohttps://example.com/hook
payloadpayload

POSTs the payload as JSON to a web address. Sent for real once your coin is live (signed if you saved a signing secret); simulated in the builder.

does somethingSocial
OP
post toX▾
messagegm

SIMULATED in the builder: shows exactly what it would post. A live coin posts for real once you add that service under Connections. Limits: X once per 10 minutes, Discord and Telegram once per minute.

does somethingSocialpretend in builder
OP
email / notifyteam@example.com
subjectUpdate
bodybody

SIMULATED in the builder: shows exactly what it would send. A live coin emails one address, at most once a minute: the address typed here if Circuit allows that, otherwise the coin owner's own saved address.

does somethingSocialpretend in builder
MO

Modules 3 blocks

Your own blocks that talk to other sites

EVENTS · 1

MO
when modulemoduleeventevent
webhook pathmy-hook
module version1

Runs when a module's event arrives as a webhook (the same address and secret as any webhook of this coin).

starts a ruleYour modules

VALUES · 1

MO
module valuemodulename
version1inputinput

Reads a value from a module's website address. Needs your coin to be live; the builder only simulates it.

gives a valueYour modules

ACTIONS · 1

MO
module actionmodulename
version1inputinput

Sends the module's request. Needs your coin to be live; the builder only simulates it. A module can never move money.

does somethingYour modules

Snap any of these together in the builder — one sentence, or block by block.

Open the builder