> ## Documentation Index
> Fetch the complete documentation index at: https://docs.defiloops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What a card can watch and do

> The kinds of card that run today, what each can read and do, and which ones have no backtest.

**In short:** a card can wait for a condition, run on a clock, run once, rest as an order at a price, hold a share of its money in one token, or trade several assets. It reads prices and data feeds. It can swap, lend, borrow, bridge and manage liquidity positions. Each kind is approved the same way, but not every kind has a backtest.

## The kinds

| kind | starts when | backtest | notes |
| - | - | - | - |
| **Condition** (`WHEN`) | its conditions are true on a closed bar | yes | the most common card |
| **Clock** (`EVERY`) | the timetable says so, in UTC | yes, for swaps | one rule, no `AND` line |
| **Run once** (no trigger) | you press Start | no | confirmed in chat with the exact amounts |
| **Resting order** (`IMMEDIATELY WHEN`) | the price reaches your level | no | limit, stop, trailing stop, bracket, grid |
| **Hold** (`HOLD`) | every bar | yes | keeps a share of its value in one token |
| **Several assets** | as above | no | several tokens against one dollar stablecoin |
| **Group** | as its members | with the group | several cards on one budget, approved together |
| **Binance card** | the venue's rules | no | armed by you with its own limits, not approved like the others |

A card with no backtest is approved over a different record. The approval page says plainly that there is no backtest and why. It lists every order, swap and collect the card will run, with tokens, amounts, prices and limits, and you sign that list instead of a report.

## What a card can read

A card compares numbers. They come from three places.

* **Prices.** `the ETH price is below $2,800`, `the cbBTC price is 10% below its highest price since entry`, or the price when the card last bought.
* **What it holds.** `this strategy holds no cbBTC` reads the card's own books. `my wallet holds no cbBTC` reads your whole wallet, once per bar. The card's own trades never change your wallet, so a rule guarded only by the wallet needs a limit on how often it fires.
* **Measures over data feeds.** A measure reads one feed and the card compares the result.

The feed families a measure can read today:

| family | examples |
| - | - |
| funding rates | the daily median across four venues, one venue's rate, Hyperliquid's hourly rate |
| open interest and positioning | open interest in dollars, long/short account ratios |
| volatility | the Deribit DVOL index, 30-day implied volatility of an option currency |
| liquidations | daily liquidation volume on centralised venues and on Hyperliquid |
| on-chain metrics | market cap over realised cap (MVRV) |
| stablecoin supply | circulating supply and its growth |
| macro | the 10-year and 2-year treasury yields and their spread |
| pools and DEX activity | a pool's TVL, fees and volume, swap counts per hour |
| lending markets | Aave reserve prices, loan-to-value and liquidation thresholds |
| venue markets | Hyperliquid candles, mark prices and funding |

The agent finds the right feed key by searching the feed registry. It never writes a key that the registry does not list. A feed's history starts when it began to be recorded, so a backtest on a newer feed covers only that span, and the agent says so.

## What a card can do

| action | forms |
| - | - |
| swap | `swap 100 USDC for WETH, at most 0.5% below market`, a share, a dollar size, `the rest` |
| take from your wallet | `take 10 USDC from my wallet` |
| send to you | `send 10% of my USDC to my wallet`, never to another address |
| lend | supply to Aave v3, withdraw what the card supplied, repay debt |
| borrow | borrow on Aave v3 with a loan-to-value ceiling, in a card that runs once |
| leverage | open, lever up or unwind a position on Aave v3 in one step |
| liquidity | open a Uniswap band of a stated width, collect fees, remove or move positions |
| bridge | move USDC, or USDC and WETH, to another network |
| wrap | wrap ETH, unwrap WETH |

Some limits come with these actions.

* A borrow or withdrawal keeps the loan-to-value at most 50% on Aave v3 and Morpho. Aave v4 runs in a card that runs once, on Ethereum only. Its 50% is a recommended limit that the server checks at save and at start. On chain, only your account ceiling binds.
* A borrow or a leveraged position inside a rule that waits or repeats runs on paper only. To run a loan live, write a card that runs once.
* A card that runs once crosses at most one bridge. The steps after it spend what landed. A recurring rule may end in a bridge.
* A band takes a quantity of each token and a width. `15%-wide` means 15% either side of the price.
* A card cannot name a pool. The system chooses the pool and checks its price against an independent reference when you save.
* Dollar sizes such as `swap $1,000 of my WETH for USDC` work. Gold works too: a card may name XAUt on Ethereum.

For the full list of operations, see the [catalogue](https://docs.defiloops.com/adapters/catalogue.md).

## Networks

A card runs on Ethereum, Arbitrum or Base, on the network its `ON` line names. Its balances, its prices and every step stay on that network. Bridging crosses between them in a card that runs once.

Ethereum steps cost dollars each, and Base and Arbitrum cost cents. The agent warns once when a small strategy has several Ethereum steps. Each firing on Ethereum pays mainnet gas from the fee payer, and the approval says so.

## Resting orders

A card whose rule is `IMMEDIATELY WHEN` becomes a resting order. The engine never evaluates it on bars. The order fires when the market reaches the price, and it is placed again for what is left after a partial fill.

```
PLAN Trail my cbBTC by 8%
ON Base
IMMEDIATELY WHEN the cbBTC price is 8% below its highest price since entry
DO swap 100% of my cbBTC for USDC, at most 1% below market
LIMITS at most once a day
```

A bracket puts a stop and a target under one entry.

```
PLAN Buy the dip with a stop and a target
ON Base
BUDGET 2,800 USDC
IMMEDIATELY WHEN the ETH price is at most $2,800
DO swap 100% of my USDC for WETH, at most 1% below market
THEN IMMEDIATELY WHEN the ETH price is below $2,500, swap 100% of my WETH for USDC, at most 1% below market
THEN IMMEDIATELY WHEN the ETH price is at least $3,300, swap 100% of my WETH for USDC, at most 1% below market
LIMITS at most once a day
```

The stop and the target share what the entry bought, so the position is never sold twice. A grid places one order per rung.

```
PLAN Sell the rally in rungs
ON Base
BUDGET 5 WETH
FOR EACH of 5 rungs between $3,000 and $3,400:
  IMMEDIATELY WHEN the ETH price reaches it, swap 20% of my WETH for USDC, at most 1% below market
LIMITS at most 5 actions per run · fills only within 0.5% of its level
```

[Order types](https://docs.defiloops.com/orders.md) describes limits, stops, rungs and trailing stops in more detail. A stop that looks once per closed bar is a different card, a `WHEN` card with `CHECK every 1 day`, and it cannot act between bars.

## A card that recurs and moves money

A rule that waits or repeats may also supply, withdraw or send.

```
PLAN Buy the dip and park it on Aave v3
ON Base
BUDGET 1000 USDC
CHECK every 1 day
WHEN the WETH price is below 2000
DO swap 100 USDC for WETH, at most 1% below market
THEN supply it to Aave v3
LIMITS at most once a day
```

A clock card can collect the fees of every Uniswap position, swap what it collected and repay a loan with it.

```
PLAN Weekly fees repay the loan
ON Base
EVERY week
FOR EACH of my Uniswap positions: collect its fees
THEN swap the cbBTC collected for USDC, at most 1% below market
THEN repay all of my Aave v3 debt in USDC, with what was collected
```

This card spends only what it collected, so it goes live without a `BUDGET` line. It has no backtest, because a fee collection has no model.

## A setup card, then a clock card

A request with several steps becomes a card that runs once for the "now" part, plus an `EVERY` card for each recurring part. This setup card pulls dollars from your wallet, builds a collateral position on Aave v3 and opens a liquidity band.

```
PLAN Set up a cbBTC-collateral loan and a cbBTC/USDC band
ON Base
DO take $2.50 of cbBTC from my wallet
THEN supply it to Aave v3 as collateral
THEN take $2.50 of USDC from my wallet
THEN swap it for cbBTC, at most 1% below market
THEN supply everything the swap produced to Aave v3 as collateral
THEN borrow USDC up to 30% loan-to-value on Aave v3
THEN swap half of it for cbBTC, at most 1% below market
THEN open a 30%-wide band around the current price with what the swap produced and the rest of what the borrow produced
```

The `Weekly fees repay the loan` card above is its second half. You start the two cards separately.

## Venue cards

A card can trade on Hyperliquid, Lighter or Binance.

* **Hyperliquid.** A card on Hyperliquid runs once, and you approve and start it like any card that runs once. A card that waits on a condition or a clock there is refused today.
* **Lighter.** A card can name Lighter. It drafts the grant, and you sign it. Running it needs a verified Lighter connection and USDC on Lighter. See [Lighter](https://docs.defiloops.com/venues/lighter.md).
* **Binance.** A Binance card does not use the approval and signing flow above. You arm it from the card, and you fill in every limit the card left open: the most it may fire, the total, the expiry, the price tolerance and the most per fire. The card's own numbers are prefilled. Nothing is defaulted, and the chat never signs. Binance is connected in demo mode today, so its cards act on Binance's demo environment and not on live funds.

## What a card still cannot do

* It cannot name a token its network does not trade, such as cbBTC on Arbitrum.
* A card cannot act on a bridge's arrival. A recurring cross-chain strategy is two cards, and you start the second once the money has landed.
* A card on Aave v4 cannot recur.
* A set of positions, an over-time level and a periodic `HOLD the top 3 of ...` basket are read by the checker, and the card is refused today.

## Under the hood

This part is for readers who want the mechanism.

A condition card is evaluated by the runtime on every closed bar of the asset it trades, and woken by the feed runtime when a bar closes. A card whose conditions read no price and no measure wakes on the bars of the asset it trades. A resting order card lowers to the same order loop as the swap page's orders. A group is one strategy version of several member cards on one ledger, and each member keeps its own clock and rules.

A `HOLD` card holds a share of its own value in one token against a dollar stablecoin, sized by a measure that returns a fraction between 0 and 1. It needs a `BUDGET`, because the share is of what the card itself holds.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.