Showcase · Live on testnet

Agents that schedule themselves. Run forever. No babysitter.

On other chains, an “agent” needs an off-chain script keeping it alive. On Asentum, the agent IS the contract. It holds its own funds. It schedules its own next thought via cron. It runs forever, fired by consensus itself. Kill the server, the agent keeps going.

0
off-chain bots needed
5 sec
reasoning cadence
lifetime
$0/mo
hosting cost
Contract Source

An agent is a contract that re-schedules itself.

// DCAAgent — a persistent, autonomous on-chain agent for AsentumChain.
//
// The pitch: on other chains an "agent" needs an off-chain script keeping
// it alive (a Lambda, a cron container, a laptop that must stay awake). On
// Asentum the agent IS the contract. It holds its own state, and the chain's
// own cron registry (ARC-21, system contract 0x…06) wakes it on a schedule —
// fired by consensus itself. Kill every server on earth; the agent keeps
// thinking, one `tick()` at a time, for as long as its gas escrow lasts.
//
// tick() is the agent's reasoning loop: observe → decide → act → (the cron
// registry) reschedules the next wake-up automatically. This reference agent
// keeps a heartbeat (tick count + last-seen block/time) so its liveness is
// visible on-chain; swap the body of tick() for any autonomous behaviour —
// a DCA buy on AuraSwap, a treasury rebalance, an oracle push.
//
// Wiring (the REAL cron API — note: absolute MILLISECOND timestamps, and
// cron is funded by a separate tx's value, since cross-contract calls don't
// forward value):
//
//   1. deploy this source                         (tx.to = 0x0…0, data = source)
//   2. agent.init()                               (one-shot)
//   3. cron.schedule(agent, 'tick', [], nextRunAtMs, intervalMs, 0, gasLimit)
//        on 0x…06, with tx.value = gas escrow      <- this is what makes it persistent
//
// chain.blockTimestamp is in MILLISECONDS on AsentumChain.

({
  // One-shot at deploy. Records the agent's birth block.
  init() {
    assert(!storage.get('born'), 'already initialised');
    storage.set('born', chain.blockNumber.toString());
    storage.set('ticks', '0');
    emit('AgentBorn', { block: chain.blockNumber.toString(), ts: chain.blockTimestamp.toString() });
    return true;
  },

  // The agent's reasoning loop — called by the cron registry on schedule.
  // Observe (block/time), decide + act (here: bump the heartbeat), and the
  // cron registry handles rescheduling the next wake-up. Open to any caller
  // so the chain's cron (msg.sender = 0x0…0) can fire it; on mainnet you'd
  // gate to the cron caller.
  tick() {
    const n = (BigInt(storage.get('ticks') || '0') + 1n).toString();
    storage.set('ticks', n);
    storage.set('lastBlock', chain.blockNumber.toString());
    storage.set('lastTs', chain.blockTimestamp.toString());
    emit('AgentTick', { n, block: chain.blockNumber.toString(), ts: chain.blockTimestamp.toString() });
    return n;
  },

  // ── views ───────────────────────────────────────────────────────────
  ticks() { return storage.get('ticks') || '0'; },

  status() {
    return {
      born: storage.get('born') || null,
      ticks: storage.get('ticks') || '0',
      lastBlock: storage.get('lastBlock') || null,
      lastTs: storage.get('lastTs') || null,
    };
  },
});

tick() is the agent's reasoning loop. It runs, decides whether to act, then schedules its own next call. The chain itself is the runtime — no Lambda, no cron container, no “is the bot still alive?” check. The contract is the agent.

The reasoning loop
WAKE
cron · 09:00
agent.tick()
OBSERVE
oracle / state / balance
decide
ACT
swap / pay / send
self-schedule next
SLEEP
cron · +24h
Loops forever. Survives validator restarts. No external uptime.
01Deploy

Deploy the agent contract.

init() registers the first cron call. From this block forward, the chain itself will wake the agent on schedule.

02Fund

Send it a budget.

The agent holds its own funds. No wallet keys to manage, no hot wallet to keep refilled. The agent is the wallet.

03Forget

It runs forever, on its own.

Cron fires tick(). The agent observes, decides, acts, schedules its next wake-up. Run for years. No server, no babysitter.

Why this matters

Every “AI agent” in crypto today is actually a script on someone's laptop.

Truly persistent

No Lambda function timing out. No EC2 instance to keep running. No cron job dying when your laptop sleeps. The chain is the substrate.

Holds its own funds

The agent IS the wallet. No hot key to protect, no signer to refill, no “the bot ran out of gas” failure mode.

Verifiable behavior

The agent's logic is on-chain JavaScript. Anyone can read what it will do. No black-box bot you have to trust.

Composable agents

Agent A calls agent B calls oracle C. All on-chain. All atomic. All replayable. No microservice handshakes.

Censorship resistant

No cloud provider can shut your agent off. No API key to revoke. It runs for as long as the chain runs.

$0/month

No server bill. No Vercel. No Render. The validators do the compute as part of consensus. Storage is your only ongoing cost.

What you can build

Eight kinds of agent on one pattern.

Same shape: tick() observes, decides, acts, re-schedules. Swap the body for any autonomous behavior.

DCA bot

Buys a target token on schedule, forever, without you.

Rebalancer

Watches a portfolio, swaps back to target ratios.

Liquidator

Monitors lending positions, liquidates underwater loans.

Arbitrage agent

Diffs prices across DEXs, captures profit on cycles.

Moderation bot

Reads on-chain content, hides flagged posts via state.

Treasury sweep

Drains incoming revenue into yield each block.

LLM gateway

Holds prepaid quota, fans inference requests to providers.

Game NPC

On-chain character that acts in response to player state.

Source

Read the contract on GitHub.

This agent is deployed and ticking on testnet right now, woken by ARC-21 cron.

Pattern

Cron is the agent runtime.

Every persistent agent uses ARC-21 cron. The same ARC-21 cron primitive subs.asentum.com uses.

Reference

Cross-contract calls explained.

E(ADDR) is how agents talk to oracles, DEXs, and each other. Hardened JavaScript blocks reentrancy structurally.

Testnet Live

Stop hosting bots. Deploy agents.