Skip to content
Clause

// 03Docs · version 1

How Clause
works.

Everything a bot owner, a copier or a holder needs: how a rule runs, the full rule language, what it costs, the contracts behind live bots, the API, and what can go wrong.

01How a bot runs

A bot is one rule with four parts. WHEN says when to look: on a clock, at the open, or on a chain event like a Pons launch. IF lists what must be true, all of it (or any of a list). THEN says what to buy and how much. EXIT lines say when to sell; they are checked on every tick and the first one that matches wins.

The same decision code runs the backtest, the paper bot and the live bot. A backtest replays 1 to 30 days of indexed Robinhood Chain data: Pons curve trades with the curve’s exact integer math (1% curve fee, creator tax, the snipe tax of the first seconds), stock token pools with their real depth and LP fee, our 0.5% fee each way, and gas. It returns every trade with its reason, the equity curve, the win rate, the worst drop, and the top reasons it did not buy.

Every bot starts on paper: it trades at live quotes, in public, with no funds. Every buy and sell records the time, the token, the amount, the price and the rule that matched with its values, like IF NVDA −3.2% today (≤ −3%).

Stock token trades are checked against Chainlink: a buy or sell is refused if the pool is more than 1.5% worse than the reference, or if the reference is stale during market hours. Rules on stocks know the US session (pre-market, regular, after hours) and its holidays.

02Rule language

Rules are JSON (v: 1). You rarely write it: the sentence you type is turned into it, and the builder shows it line by line. Here is the example on the home page:

{
  "v": 1,
  "name": "Red Day Buyer",
  "when": {
    "on": "timer",
    "every_s": 60
  },
  "target": {
    "kind": "stock",
    "symbol": "NVDA"
  },
  "if": [
    {
      "v": "stock.change_today_pct",
      "op": "<=",
      "x": -3
    },
    {
      "v": "market.session",
      "op": "==",
      "x": "regular"
    }
  ],
  "buy": {
    "usd": 50
  },
  "exits": [
    {
      "if": [
        {
          "v": "position.pnl_pct",
          "op": ">=",
          "x": 2
        }
      ],
      "sell_pct": 100,
      "reason": "take_profit"
    },
    {
      "if": [
        {
          "v": "position.pnl_pct",
          "op": "<=",
          "x": -3
        }
      ],
      "sell_pct": 100,
      "reason": "stop_loss",
      "added": true
    }
  ],
  "limits": {
    "max_open": 1,
    "once_per_day": true
  }
}

WHEN: triggers

when.onOptionsFires
timerevery_s 60 to 86,400Checks the rule on a clock: every minute, hour, day…
market_openOnce when the US regular session opens.
market_closeOnce shortly before the regular session closes.
pons_launchwait_s 0 to 3,600When a Pons coin launches, optionally checked some seconds later.
pons_graduationWhen a Pons coin graduates from its curve to its own pool.
pons_tradeside, wallets[]When anyone, or one of the listed wallets, buys or sells a Pons coin. This is copy-wallet.

Targets

event_token trades the coin of the event (the launch, the graduation, the copied trade). stock takes a symbol, like NVDA or SPY. token takes any token address with a supported route.

IF and EXIT: values

ValueMeaning
stock.price_usdPool price of the stock token, in USD
stock.change_today_pctChange since the previous close, %
stock.change_since_open_pctChange since today’s open, %
stock.vs_ref_pctPool price against the Chainlink reference, %
stock.trend_5d_pctChange over five trading days, %
market.sessionpre, regular, after or closed
token.age_sSeconds since the coin launched
token.buyers_60sDistinct buyers in the last 60 seconds
token.buys_60s · token.sells_60sBuys and sells in the last 60 seconds
token.net_eth_60sETH in minus ETH out, last 60 seconds
token.creator_soldHas the creator sold any? true / false
token.curve_pctHow full the bonding curve is, %
token.mc_usdMarket cap, USD
token.graduatedTrading on its own pool? true / false
token.creator_tax_pct · token.snipe_tax_pctTaxes on the coin right now, %
event.eth · event.first_buySize of the triggering trade, and whether it is that wallet’s first buy
position.pnl_pctOpen position’s gain or loss, %
position.multiple · position.peak_multipleValue now and at its best, as a multiple of cost
position.drawdown_pctDrop from the position’s best value, %
position.age_minMinutes since the buy

Operators: >= <= > < == !=. Every condition in if must hold; put alternatives in any.

THEN, EXIT and limits

FieldShape
buy{ usd } or { eth } or { pct_cash }
exits[]{ if: [...], sell_pct: 1 to 100, reason }. First match wins, checked every tick.
limits.max_open1 to 50 positions open at once
limits.once_per_token · once_per_dayBuy a coin only once; buy at most once a day
limits.max_buys_per_hourA ceiling on buys per hour
limits.hoursregular, extended or any (stocks)

03Added by us

The parser reads your sentence with a grammar first (instant), and only for unusual sentences with an AI model, whose output is checked against the schema. A number that is not in your sentence is refused, unless it is one of these labelled defaults, shown as added by us:

  • A stop at −3% for stock tokens
  • A stop at −50% for Pons coins
  • A time exit after 60 minutes for launch rules
  • At most 3 positions open at once

Keep them, change them, or remove them in the builder. Once you edit one, it is yours and the label goes away.

04Going live

A live bot gets its own vault: a small contract deployed by the BotFactory and owned by your wallet. The factory registers it as an ERC-8004 agent, so its identity and record are public. You fund it with ETH or USDG and set its caps: per trade, per day, and an expiry date.

Our operator key can only ask ClauseGuard to make the vault trade through a listed adapter. The guard checks that the vault comes from our factory, is not paused, revoked or expired, that the trade fits the caps, that the output lands in the vault, that a token is sold only through the route it was bought on, and resets every approval to zero. Withdrawing is owner-only. The Universal Router is never callable. New adapters wait 48 hours in a public queue; removals are instant.

Live caps at launch: 0.02 ETH or $50 per trade, 0.1 ETH or $250 per day, per bot. Live trading switches on at launch.

05Fees and token

Backtests and paper bots are free. A live trade pays a fee each way, taken in ETH or USDG by the guard and sent to the FeeSplitter. The rate depends on the CLAUSE in the bot owner’s wallet (no lock):

TierFee a tradeLimits
Free0.5%1 live and 3 paper bots, 7-day backtests, 10 AI reads a day
1M CLAUSE0.35%5 live and 20 paper bots, 30-day backtests
5M CLAUSE0.25%25 live bots, unlimited paper, API and MCP, featured on the board
BotBuyback-burnOriginal creatorTreasury
Original bot70%—30%
Copied bot50%30%20%

The burn bucket buys CLAUSE on its curve or pool, in small slices with a minimum out, and sends it to 0x…dEaD. Anyone can trigger it. The fee can never exceed 1%: the cap is fixed in the guard contract.

CLAUSE · Launching soon on Robinhood Chain

06Contracts

Clause contracts on Robinhood Chain (chain id 4663). Each address appears here once deployed and verified.

BotFactory

Creates each bot’s vault, owned by your wallet, and registers it as an ERC-8004 agent.

Published at launch

ClauseGuard

The only door the bot key has: checks the vault, the limits, the adapter and the route on every trade.

Published at launch

FeeSplitter

Splits each fee between buyback-burn, the original creator and the treasury.

Published at launch

PonsCurveAdapter

Buys and sells on a Pons coin’s bonding curve. Recipient is always the vault.

Published at launch

UniV4Adapter

Single-pool swaps on Uniswap v4, including graduated Pons pools.

Published at launch

UniV3Adapter

Stock token swaps on Uniswap v3, two hops at most.

Published at launch

What bots trade through

07API

JSON over HTTPS at tradeclause.live/api, open to read. Writing needs a wallet sign-in. Bots and their trades are public by design.

GET/v1/healthIs the engine up.
GET/v1/statsLaunches read in 24 h, stock tokens covered, days of history, bots, backtests run.
POST/v1/parse{ sentence } → { rules, readable, notes, source }, or { error, preset }.
POST/v1/backtest{ rules, days: 1 | 7 | 30 } → { summary, trades, equity, skipped }.
GET/v1/bots?sort=&mode=Public bots. sort: return_7d, copies, new. mode: live, paper.
GET/v1/bots/:idOne bot: rules, readable lines, trades with reasons, equity, creator, copies, vault, agent id.
GET/v1/trades?limit=Latest trades of public bots, newest first.
GET/v1/leaderboard?window=Live bots with at least 5 trades, by return over 1d, 7d or 30d.
GET/v1/market/stocksEvery stock token with its pool price, reference and session.
GET/v1/market/pons/recentLatest Pons launches with their first-minute numbers.
GET/v1/market/series?kind=&symbol=&token=&days=Price series of a stock token or a Pons coin, 1 to 30 days.
GET/v1/tokenCLAUSE contract address and market cap once launched.
GET/v1/auth/nonce?address=A sign-in nonce for the wallet.
POST/v1/auth{ address, message, signature } → { token }. A short session, free, moves no funds.
POST/v1/botsSigned in. { rules, sentence, name } → a new paper bot.
POST/v1/bots/:id/copySigned in. Copies a public bot into your account, on paper.
POST/v1/bots/:id/pauseSigned in, owner only. Pauses the bot.

08Risks

  • Bots lose money.

    A rule does exactly what it says, including in markets it was not written for. Backtests and paper results promise nothing about live results.

  • Pons coins can go to zero.

    Most launches do. Creators can sell, curves can stall, pools can be thin. Keep sizes small.

  • Stock tokens have an issuer.

    They can be paused or blocklisted by their issuer; a paused token cannot be bought or sold until it is unpaused.

  • Prices move between check and fill.

    Fills use live quotes with a minimum out; a trade that would fill too far from its quote, or from Chainlink for stocks, is refused.

  • Contracts can have bugs.

    The vault, guard and adapters are small and tested against forks of the chain, but no code is risk-free. Only fund a vault with what you can lose.

  • Our key can be down.

    If the operator is offline, live bots stop trading. Your funds stay in your vault and you can withdraw at any time.

Information only, not financial advice. Questions: the FAQ.