# What a source is

> A source is anything a strategy, workflow or script can build on. Markets give bars; typed sources give events. Every event is also a signal anything in your account can react to.

Everything on ftw.trade starts from what it reads. A **source** is anything a strategy, workflow or script can build on, and there are two families.

## Markets: bars

A market gives bars (and, for a pool, every swap). A strategy runs on one.

| Market | Read as | Comes from |
|---|---|---|
| A pool on any EVM chain or Solana | `pool:<chain>:<address>` | Indexed by ftw.trade from the chain, bars from 5 seconds to a day |
| A perp, builder perp or spot pair | `perp:hyperliquid:BTC`, `perp:lighter:ETH` | Hyperliquid and Lighter, with funding |
| A shared feed | `feed:btc-usd-coinbase` | Crypto, stocks, commodities and lending rates, free to everyone |
| A Polymarket outcome | `poly:<token id>` | Polymarket, its price the probability |

More in [Markets and feeds](https://docs.ftw.trade/sources/markets).

## Typed sources: events

A typed source is a stream of events with fields you declare: `{ token: address, progress: number }`. You choose how its events are made:

| Kind | Made by | Good for |
|---|---|---|
| **Flowscript** | A program over ftw.trade's streams, a websocket or a polled URL | Filters, thresholds and indicators over launches, swaps, prices, order books. No code to host. The first choice when it fits |
| **TypeScript** | A script with `@ftw/sdk` | Polling an API or listening to a stream with your own logic |
| **Pushed** | Your own service, posting to ftw.trade with the source's key | A bot, a webhook, a stream reader you run elsewhere |
| **Contract event** | Any event any contract emits on an EVM chain you've added | Mints, swaps, governance, anything on chain |
| **Machine** | Code with npm packages on a machine of your own | Long-lived sockets, heavy compute. Paid from credits |

More in [Sources in Flowscript](https://docs.ftw.trade/sources/flowscript-sources) and [Pushed, contract and other sources](https://docs.ftw.trade/sources/other-sources).

## Every event is a signal

The same event reaches everything that listens:

- a **strategy** reads the source as a tape (`sources.kol_calls()`) or runs on its bars (`source:<name>`);
- a **workflow** armed on it fires, with the event's fields as its trigger outputs;
- a **script** triggered by it runs.

Strategy runs and workflows can publish sources of their own too (a run's intents and results, a workflow's `emit` step), so one system's output is another's input.

## Watch them

- **Sources** in the app lists every source with its shape, latest event and rate, and what uses it. Open one to see its last events and what each started.
- **Flow** draws sources with everything downstream, and flags one that has stopped reading.

## Share them

Any source can be made public, with or without its code. Other accounts subscribe to it under a name of their own; they get its events, never your inputs or credentials.
