Flatline
monitoringOpen an account

If your AI agent goes silent, its trades go flat.

Give an agent a trading account on Robinhood Chain and a heartbeat to keep. It trades Stock Tokens inside the account and checks in on time. When it stops, crashed, stuck or cut off, the account flatlines: the agent is locked out, every position is sold to USDG at Chainlink-checked prices, and the money goes back to you.

09:00:00account #12 opened · timeout 1h
09:14:31trade · buy NVDA $250
09:58:02beat
10:41:17trade · sell 0.4 NVDA
11:41:17no beat for 1h · FLAT
11:43:05keeper · sold NVDA, TSLA for USDG
11:43:05$612.40 USDG sent to owner
example account, illustrative times
beat · trade · beat · tradelast check-intimeout · flat · sold · USDG home
0accounts
0agents alive
0flatlined
$0.00held in accounts
// the switch

A heartbeat, a timeout, and an exit nobody has to press.

AI agents fail quietly. A process dies at 3 a.m., an API key gets revoked, a model loops on an error, the server bill goes unpaid. The positions it opened stay open, and nobody is watching them.

Flatline gives each agent an account with a timeout between 10 minutes and 30 days. Every trade counts as a check-in, and the agent can also call beat on its own schedule. Miss the window and the account is dead: the agent cannot trade or beat again.

From that moment anyone can flatten it. Our keeper does it within minutes: each Stock Token is sold on its Uniswap pool inside 1.5% of Chainlink, and every USDG in the account goes to the owner's wallet in the same transaction.

The owner never waits on the switch. Withdraw anything at any time, change the agent, or revive the account to let the agent back in with a fresh clock.

t0Open

Owner funds it, names one agent and a timeout.

t0 … tnTrade, beat

Each trade or beat resets the clock.

tn + timeoutSilence

No check-in in time. The agent is locked out.

+ minutesFlatten

Positions sold inside 1.5% of Chainlink.

same txHome

All USDG goes to the owner's wallet.

// accounts

Every account, live.

AccountStatusTimeoutLast check-inHolds
Loading…
// for agents

Three calls for the agent. One rule: keep beating.

The agent is any address: a GPT or Claude script with its own key, a trading bot, a cron job. It needs a little ETH for gas and nothing else. It never holds the money; the account does.

trade buys a Stock Token with USDG or sells it back, inside the account. beat checks in without trading. The owner sets how long silence is allowed.

// the agent's loop
while (true) {
  const idea = await model.next();                     // "buy NVDA with 100 USDG" or nothing
  if (idea) await wallet.writeContract({ address: BOOK, abi, functionName: "trade", args: [ID, NVDA, true, 100_000000n] });
  else      await wallet.writeContract({ address: BOOK, abi, functionName: "beat", args: [ID] });
  await sleep(15 * 60_000);                              // well inside a 1h timeout
}
// tradeable

27 Stock Tokens at Chainlink.

// questions

Questions.

Can the agent take the money?
No. It can only swap between USDG and listed Stock Tokens inside the account. Withdrawals and flatten proceeds go to the owner only.

What if a pool is off when it flatlines?
That sale waits. The keeper retries every few minutes, and the owner can always withdraw the tokens as they are.

What does it cost?
0.1% of each trade, and $0.05 per flatten to whoever runs it. Opening an account costs only gas.

Is it audited?
No. The contract is small and public, but unaudited. Size accordingly.