Skip to main content

Intent structure

TIM intents are expressed in XML. Every intent has a <type>, a <chain_id>, and type-specific fields.
The <entry> block defines what triggers the trade and what action to take. The <exit> block is optional and defines take-profit/stop-loss conditions.

Buy semantics

A <buy> action spends quote tokens to acquire base tokens.
  • <amount> is the number of quote tokens to spend
  • <quote> is the token you are spending (address or AIUSD)
  • <base> is the token you are buying (address or symbol)
This spends 1 USDC to buy TRUMP on Solana.
<buy> does not support <relative> or percentage amounts. To buy with your full balance, query your portfolio first and use the absolute amount.

Sell semantics

A <sell> action sells base tokens to receive quote tokens.
  • <amount> is the number of base tokens to sell
  • <quote> is the token you receive
  • <base> is the token you are selling

Sell all

Use <amount>all</amount> to sell your entire balance:

Sell percentage

Use <relative> to sell a percentage of your balance (sell only):

Default quote token

When the user does not specify a quote token, default to USDC on the target chain. For example:
  • “sell TRUMP” uses USDC as quote
  • “sell TRUMP for AIUSD” uses AIUSD as quote
  • “buy TRUMP with SOL” uses SOL as quote

Exit strategies

Attach an <exit> block to set take-profit and stop-loss conditions:

Intent type examples

IMMEDIATE — buy with USDC

IMMEDIATE — buy with SOL

IMMEDIATE — sell all

IMMEDIATE — sell percentage

IMMEDIATE — buy with exit strategy

CONDITIONAL_ENTRY — event-triggered buy

Register a rule that triggers when PumpFun posts a bullish signal:
For CONDITIONAL_ENTRY, the buy action uses:
  • <budget_aiusd> — amount in AIUSD to spend per matching event
  • <base_from_event> — must be contract_address (token resolved from the event)
The response includes a rule_id. The rule stays active and triggers on each matching event until cancelled.

CLOSE_POSITION — close by position ID

The response includes cancelled_orders (any exit orders that were removed) and realized_pnl.

Token addressing

Follow this priority order when specifying tokens:
  1. Contract address provided — use it directly
  2. Common tokens — use the known addresses from the table below
  3. Other tokens — use the symbol (e.g., trump, JUP). TIM resolves it automatically.

Common token addresses

Amounts are always in human-readable decimal format (e.g., 0.170324), not raw smallest-unit integers.

CAIP-2 chain IDs

AIUSD trading rules

  • Buy AIUSD: use a <sell> action with <quote>AIUSD</quote>. Any token can be sold for AIUSD.
  • Sell AIUSD: use a <buy> action with <quote>AIUSD</quote>. The base token must be a stablecoin: USDC, USDT, or USD1.
To buy non-stablecoins with AIUSD, run two intents:
  1. Convert AIUSD to USDC (<buy> with <quote>AIUSD</quote> and <base> = USDC address)
  2. Swap USDC for the target token (<buy> with <quote> = USDC address)

Buy AIUSD (sell a token to get AIUSD)

Sell AIUSD for USDC