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

# Stellar Sources

> Build real-time Stellar pipelines with <5s latency

| Dataset          | Mainnet | Testnet | Description                                                                                                                                                        |
| ---------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ledgers`        | v1.2.0  | v1.2.0  | Extended ledger header data with protocol version, fee pool, and Soroban fee tracking                                                                              |
| `transactions`   | v1.2.0  | v1.2.0  | Transactions with Soroban resource breakdown (instructions, read/write bytes, fee details)                                                                         |
| `operations`     | v1.2.0  | v1.2.0  | Operations with result codes, event counts, and full ledger/transaction context                                                                                    |
| `events`         | v1.2.0  | v1.2.0  | System, contract, and diagnostic events from Soroban transactions                                                                                                  |
| `transfers`      | v1.2.0  | v1.2.0  | Token transfer events with 8 transfer types (burn, claim, clawback, donate, fee, mint, trade, transfer)                                                            |
| `ledger_entries` | v1.2.0  | v1.2.0  | Ledger entry changes including Soroban entry types (contract\_data, contract\_code, config\_setting, ttl)                                                          |
| `balances`       | v1.1.0  | v1.1.0  | Per-account, per-asset balance snapshots derived from ledger entry changes, covering native XLM, trustline assets (USDC, AQUA, etc.), and liquidity pool positions |

<Info>
  All v1.2.0 datasets (transactions, operations, events, ledgers, ledger\_entries, transfers) support starting from a specific ledger sequence using `start_at: <ledger_sequence>` (e.g., `start_at: 60000000`). This significantly reduces backfill times compared to starting from `earliest`.
</Info>

<Note>
  **v1.2.0 performance improvements**: Single-pass Arrow builders and optimized memory usage provide faster processing and lower resource consumption.
</Note>

## Dataset configuration

For resource sizing options, see [Pipeline Configuration](/turbo-pipelines/pipeline-config).

| Parameter           | Required | Description                                                                                                                                                                                |
| ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `start_at`          | Yes      | Ledger sequence to start indexing from, or `latest` / `earliest`                                                                                                                           |
| `end_at`            | No       | Stop indexing after this ledger sequence is reached                                                                                                                                        |
| `fetch_batch_size`  | No       | (Performance) Number of ledgers to fetch per batch, mainly for tuning backfills                                                                                                            |
| `fetch_parallelism` | No       | (Performance) Number of parallel fetch ranges to process concurrently (default: 1, recommended: 2-4 for backfills). Higher values improve throughput by overlapping S3 I/O with processing |

```yaml theme={null}
name: my-stellar-pipeline
resource_size: s

sources:
  stellar_transfers:
    type: dataset
    dataset_name: stellar_mainnet.transfers
    version: 1.2.0
    start_at: 60000000
    end_at: 61000000
    fetch_batch_size: 10
    fetch_parallelism: 2
```

When using `end_at`, combine with `job: true` at the top level so the pipeline auto-terminates after completion. See [Job Mode](/turbo-pipelines/job-mode) for details.

<Warning>
  Be cautious when increasing `fetch_batch_size` in job mode. Jobs do not automatically restart on failure, so resource errors (e.g., out of memory) will cause the job to fail permanently.
</Warning>

## Quick start

The fastest way to explore Stellar data is using a `blackhole` sink with `goldsky turbo inspect`:

```yaml theme={null}
name: demo-stellar-transfers-blackhole
resource_size: s

sources:
  stellar_transfers:
    type: dataset
    dataset_name: stellar_mainnet.transfers
    version: 1.2.0
    start_at: latest

sinks:
  dev_sink:
    type: blackhole
    from: stellar_transfers
```

```bash theme={null}
goldsky turbo apply demo.yaml
goldsky turbo inspect demo-stellar-transfers-blackhole
```

For testnet, simply swap the `stellar_mainnet` prefix with `stellar_testnet` in the `dataset_name`:

```yaml theme={null}
    dataset_name: stellar_testnet.transfers
```

## Guide: Monitor transfers for specific assets

```yaml theme={null}
name: demo-stellar-asset-tracker
resource_size: s

sources:
  stellar_transfers:
    type: dataset
    dataset_name: stellar_mainnet.transfers
    version: 1.2.0
    start_at: latest

transforms:
  asset_transfers:
    type: sql
    primary_key: id
    sql: |
      SELECT * FROM stellar_transfers
      WHERE asset_code = 'XLM'
      OR (asset_code = 'USDC' AND asset_issuer = 'GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN')
      OR (asset_code = 'AQUA' AND asset_issuer = 'GBNZILSTVQZ4R7IKQDGHYGY2QXL5QOFJYQMXPKWRRM5PAV7Y4M67AQUA')

sinks:
  asset_transfers_sink:
    type: postgres
    from: asset_transfers
    schema: public
    table: demo_stellar_asset_transfers
    secret_name: MY_POSTGRES_SECRET
    primary_key: id
```

For more sink types and configuration options, see [turbo sinks docs](/turbo-pipelines/sinks).

## Guide: Track transactions of a specific account

```yaml theme={null}
name: demo-stellar-account-tracker
resource_size: s

# [Centre] Account for managing USDC on Stellar Mainnet
sources:
  stellar_transactions:
    type: dataset
    dataset_name: stellar_mainnet.transactions
    version: 1.2.0
    start_at: latest

transforms:
  account_transactions:
    type: sql
    primary_key: transaction_hash
    sql: |
      SELECT * FROM stellar_transactions
      WHERE account = 'GAFK7XFZHMLSNV7OJTBO7BAIZA66X6QIBV5RMZZYXK4Q7ZSO52J5C3WQ'

sinks:
  account_transactions_sink:
    type: postgres
    from: account_transactions
    schema: public
    table: demo_stellar_account_transactions
    secret_name: MY_POSTGRES_SECRET
    primary_key: transaction_hash
```

## Guide: Track contract activity

```yaml theme={null}
name: demo-stellar-contract-tracker
resource_size: s

# Track all events and transfers on a specific contract_id
sources:
  stellar_events:
    type: dataset
    dataset_name: stellar_mainnet.events
    version: 1.2.0
    start_at: latest

  stellar_transfers:
    type: dataset
    dataset_name: stellar_mainnet.transfers
    version: 1.2.0
    start_at: latest

transforms:
  contract_events:
    type: sql
    primary_key: id
    sql: |
      SELECT * FROM stellar_events
      WHERE contract_id = 'CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA'

  contract_transfers:
    type: sql
    primary_key: id
    sql: |
      SELECT * FROM stellar_transfers
      WHERE contract_id = 'CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA'

sinks:
  contract_events_sink:
    type: postgres
    from: contract_events
    schema: public
    table: demo_stellar_contract_events
    secret_name: MY_POSTGRES_SECRET
    primary_key: id

  contract_transfers_sink:
    type: postgres
    from: contract_transfers
    schema: public
    table: demo_stellar_contract_transfers
    secret_name: MY_POSTGRES_SECRET
    primary_key: id
```

## Guide: Monitor account balances

```yaml theme={null}
name: demo-stellar-balance-tracker
resource_size: s

sources:
  stellar_balances:
    type: dataset
    dataset_name: stellar_mainnet.balances
    version: 1.1.0
    start_at: latest

transforms:
  account_balances:
    type: sql
    primary_key: account_id, asset_code
    sql: |
      SELECT * FROM stellar_balances
      WHERE asset_code = 'XLM'
      OR (asset_code = 'USDC' AND asset_issuer = 'GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN')

sinks:
  account_balances_sink:
    type: postgres
    from: account_balances
    schema: public
    table: demo_stellar_account_balances
    secret_name: MY_POSTGRES_SECRET
    primary_key: account_id, asset_code
```

***

## Dataset schemas

Full field reference for all Stellar datasets.

<AccordionGroup>
  <Accordion title="Ledgers">
    | Field                   | Type      | Description                                       |
    | ----------------------- | --------- | ------------------------------------------------- |
    | `ledger_sequence`       | UINT32    | Ledger sequence number                            |
    | `ledger_hash`           | STRING    | Ledger hash                                       |
    | `ledger_closed_at`      | TIMESTAMP | Ledger close time (UTC)                           |
    | `ledger_signature`      | STRING    | Ledger signature                                  |
    | `transaction_count`     | UINT32    | Total transactions in ledger                      |
    | `previous_ledger_hash`  | STRING    | Previous ledger hash                              |
    | `protocol_version`      | UINT32    | Stellar protocol version                          |
    | `total_coins`           | LONG      | Total XLM in circulation (stroops)                |
    | `fee_pool`              | LONG      | Fee pool amount (stroops)                         |
    | `base_fee`              | UINT32    | Base fee in stroops                               |
    | `base_reserve`          | UINT32    | Base reserve per account                          |
    | `max_tx_set_size`       | UINT32    | Maximum transaction set size                      |
    | `successful_tx_count`   | UINT32    | Count of successful transactions                  |
    | `failed_tx_count`       | UINT32    | Count of failed transactions                      |
    | `soroban_fee_write_1kb` | LONG      | Soroban fee per 1KB write (nullable, pre-Soroban) |
    | `node_id`               | STRING    | Node identifier                                   |
  </Accordion>

  <Accordion title="Transactions">
    | Field                                 | Type      | Description                                                                                                      |
    | ------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------- |
    | `transaction_hash`                    | STRING    | Transaction hash                                                                                                 |
    | `account`                             | STRING    | Source account                                                                                                   |
    | `account_muxed`                       | STRING    | Muxed account variant                                                                                            |
    | `account_sequence`                    | LONG      | Account sequence number                                                                                          |
    | `max_fee`                             | LONG      | Maximum fee willing to pay                                                                                       |
    | `fee_charged`                         | LONG      | Actual fee charged                                                                                               |
    | `fee_account`                         | STRING    | Fee bump fee account                                                                                             |
    | `fee_account_muxed`                   | STRING    | Muxed variant of `fee_account` (fee bump only)                                                                   |
    | `inner_transaction_hash`              | STRING    | Inner transaction hash (fee bump only)                                                                           |
    | `new_max_fee`                         | LONG      | New max fee (fee bump only)                                                                                      |
    | `memo_type`                           | STRING    | Memo type: `MemoTypeMemoNone`, `MemoTypeMemoText`, `MemoTypeMemoId`, `MemoTypeMemoHash`, or `MemoTypeMemoReturn` |
    | `memo`                                | STRING    | Memo value (null when `memo_type` is `MemoTypeMemoNone`)                                                         |
    | `time_bounds_lower`                   | LONG      | Lower time bound (Unix seconds)                                                                                  |
    | `time_bounds_upper`                   | LONG      | Upper time bound (Unix seconds)                                                                                  |
    | `successful`                          | BOOLEAN   | Whether transaction succeeded                                                                                    |
    | `transaction_result_code`             | STRING    | Transaction result code                                                                                          |
    | `operation_count`                     | UINT32    | Number of operations                                                                                             |
    | `event_count`                         | UINT32    | Number of contract events                                                                                        |
    | `diagnostic_event_count`              | UINT32    | Number of diagnostic events                                                                                      |
    | `inclusion_fee_bid`                   | LONG      | Fee bid for inclusion                                                                                            |
    | `resource_fee`                        | LONG      | Soroban resource fee                                                                                             |
    | `soroban_resources_instructions`      | LONG      | CPU instructions used                                                                                            |
    | `soroban_resources_read_bytes`        | LONG      | Bytes read from storage                                                                                          |
    | `soroban_resources_write_bytes`       | LONG      | Bytes written to storage                                                                                         |
    | `non_refundable_resource_fee_charged` | LONG      | Non-refundable resource fee                                                                                      |
    | `refundable_resource_fee_charged`     | LONG      | Refundable resource fee                                                                                          |
    | `rent_fee_charged`                    | LONG      | Rent fee charged                                                                                                 |
    | `tx_signers`                          | STRING    | JSON array of signature hints                                                                                    |
    | `ledger_sequence`                     | UINT32    | Ledger sequence number                                                                                           |
    | `ledger_hash`                         | STRING    | Ledger hash                                                                                                      |
    | `ledger_closed_at`                    | TIMESTAMP | Ledger close time                                                                                                |
    | `ledger_signature`                    | STRING    | Ledger signature                                                                                                 |
  </Accordion>

  <Accordion title="Operations">
    | Field                        | Type      | Description                                                                                    |
    | ---------------------------- | --------- | ---------------------------------------------------------------------------------------------- |
    | `id`                         | STRING    | Unique operation ID (`{ledger_sequence}-{tx_hash}-{op_index}`)                                 |
    | `source_account`             | STRING    | Account that initiated the operation                                                           |
    | `source_account_muxed`       | STRING    | Muxed account identifier                                                                       |
    | `type`                       | STRING    | Operation type name in snake\_case (e.g., `payment`, `create_account`, `invoke_host_function`) |
    | `type_i`                     | UINT32    | Operation type as integer (matches Stellar XDR enum discriminant)                              |
    | `body`                       | STRING    | JSON-serialized operation body                                                                 |
    | `result_code`                | STRING    | Result code (e.g., `PaymentSuccess`, `PathPaymentStrictReceiveSuccess`, `OpBadAuth`)           |
    | `operation_result`           | STRING    | JSON-serialized full operation result                                                          |
    | `event_count`                | UINT32    | Number of contract events generated                                                            |
    | `ledger_entry_changes_count` | UINT32    | Number of ledger entry changes                                                                 |
    | `transaction_hash`           | STRING    | Parent transaction hash                                                                        |
    | `transaction_account`        | STRING    | Transaction source account                                                                     |
    | `transaction_fee_account`    | STRING    | Fee account (for fee bump transactions)                                                        |
    | `transaction_successful`     | BOOLEAN   | Whether the transaction succeeded                                                              |
    | `transaction_index`          | UINT32    | Transaction position in ledger                                                                 |
    | `ledger_sequence`            | UINT32    | Ledger sequence number                                                                         |
    | `ledger_hash`                | STRING    | Ledger hash                                                                                    |
    | `ledger_closed_at`           | TIMESTAMP | Ledger close timestamp                                                                         |
    | `ledger_signature`           | STRING    | Ledger signature                                                                               |
  </Accordion>

  <Accordion title="Events">
    | Field                           | Type      | Description                                       |
    | ------------------------------- | --------- | ------------------------------------------------- |
    | `id`                            | STRING    | Unique event ID                                   |
    | `type`                          | STRING    | Event type: `system`, `contract`, or `diagnostic` |
    | `contract_id`                   | STRING    | Contract ID                                       |
    | `topics`                        | STRING    | JSON array of event topics                        |
    | `data`                          | STRING    | JSON-serialized event data                        |
    | `in_successful_contract_call`   | BOOLEAN   | Whether in successful contract call               |
    | `transaction_hash`              | STRING    | Parent transaction hash                           |
    | `transaction_account`           | STRING    | Transaction source account                        |
    | `transaction_account_muxed`     | STRING    | Muxed account variant                             |
    | `transaction_fee_account`       | STRING    | Fee account                                       |
    | `transaction_fee_account_muxed` | STRING    | Muxed fee account variant                         |
    | `transaction_successful`        | BOOLEAN   | Whether transaction succeeded                     |
    | `transaction_index`             | UINT32    | Transaction position in ledger                    |
    | `operation_body`                | STRING    | JSON operation body                               |
    | `operation_result_code`         | STRING    | Operation result code                             |
    | `operation_type`                | STRING    | Operation type                                    |
    | `ledger_sequence`               | UINT32    | Ledger sequence number                            |
    | `ledger_hash`                   | STRING    | Ledger hash                                       |
    | `ledger_closed_at`              | TIMESTAMP | Ledger close time                                 |
    | `ledger_signature`              | STRING    | Ledger signature                                  |
  </Accordion>

  <Accordion title="Transfers">
    | Field                         | Type           | Description                                                                       |
    | ----------------------------- | -------------- | --------------------------------------------------------------------------------- |
    | `id`                          | STRING         | Unique transfer ID                                                                |
    | `transfer_type`               | STRING         | One of: `burn`, `claim`, `clawback`, `donate`, `fee`, `mint`, `trade`, `transfer` |
    | `sender`                      | STRING         | Sender address                                                                    |
    | `recipient`                   | STRING         | Recipient address                                                                 |
    | `asset_raw`                   | STRING         | Raw asset string (`native` or `CODE:ISSUER`)                                      |
    | `asset_code`                  | STRING         | Parsed asset code (`XLM` for native)                                              |
    | `asset_issuer`                | STRING         | Asset issuer (null for native)                                                    |
    | `amount`                      | DECIMAL(38, 0) | Transfer amount as a raw integer (stroops for XLM; i128 range for Soroban tokens) |
    | `to_muxed_id`                 | LONG           | Muxed account sub-identifier                                                      |
    | `contract_id`                 | STRING         | Contract ID                                                                       |
    | `topics`                      | STRING         | JSON array of event topics                                                        |
    | `data`                        | STRING         | JSON event data                                                                   |
    | `in_successful_contract_call` | BOOLEAN        | Whether in successful contract call                                               |
    | `transaction_hash`            | STRING         | Parent transaction hash                                                           |
    | `transaction_account`         | STRING         | Transaction source account                                                        |
    | `transaction_fee_account`     | STRING         | Fee account                                                                       |
    | `transaction_successful`      | BOOLEAN        | Whether transaction succeeded                                                     |
    | `transaction_index`           | UINT32         | Transaction position in ledger                                                    |
    | `operation_body`              | STRING         | JSON operation body                                                               |
    | `operation_result_code`       | STRING         | Operation result code                                                             |
    | `operation_type`              | STRING         | Operation type                                                                    |
    | `ledger_sequence`             | UINT32         | Ledger sequence number                                                            |
    | `ledger_hash`                 | STRING         | Ledger hash                                                                       |
    | `ledger_closed_at`            | TIMESTAMP      | Ledger close time                                                                 |
    | `ledger_signature`            | STRING         | Ledger signature                                                                  |
    | `amount_bought`               | DECIMAL(38, 0) | Amount bought as a raw integer (trade type only)                                  |
    | `trade_fee`                   | DECIMAL(38, 0) | Trade fee as a raw integer (trade type only)                                      |
  </Accordion>

  <Accordion title="Ledger entries">
    | Field                            | Type      | Description                                                       |
    | -------------------------------- | --------- | ----------------------------------------------------------------- |
    | `id`                             | STRING    | Unique change ID                                                  |
    | `change_type`                    | STRING    | One of: `created`, `updated`, `removed`, `state`, `restored`      |
    | `ledger_entry_type`              | STRING    | Entry type (e.g., `account`, `trustline`, `contract_data`, `ttl`) |
    | `entry_data`                     | STRING    | JSON entry data (for created/updated/state/restored)              |
    | `key_data`                       | STRING    | JSON key data (for removed entries)                               |
    | `last_modified_ledger_sequence`  | UINT32    | Last modified ledger (null for removed)                           |
    | `operation_id`                   | STRING    | Parent operation ID                                               |
    | `operation_type`                 | STRING    | Operation type                                                    |
    | `operation_result_code`          | STRING    | Operation result code                                             |
    | `operation_source_account`       | STRING    | Operation source account                                          |
    | `operation_source_account_muxed` | STRING    | Muxed operation account                                           |
    | `operation_body`                 | STRING    | JSON operation body                                               |
    | `transaction_hash`               | STRING    | Parent transaction hash                                           |
    | `transaction_account`            | STRING    | Transaction source account                                        |
    | `transaction_fee_account`        | STRING    | Fee account                                                       |
    | `transaction_successful`         | BOOLEAN   | Whether transaction succeeded                                     |
    | `transaction_index`              | UINT32    | Transaction position in ledger                                    |
    | `ledger_sequence`                | UINT32    | Ledger sequence number                                            |
    | `ledger_hash`                    | STRING    | Ledger hash                                                       |
    | `ledger_closed_at`               | TIMESTAMP | Ledger close time                                                 |
    | `ledger_signature`               | STRING    | Ledger signature                                                  |
  </Accordion>

  <Accordion title="Balances">
    | Field                           | Type      | Description                                                      |
    | ------------------------------- | --------- | ---------------------------------------------------------------- |
    | `account_id`                    | STRING    | Stellar account address                                          |
    | `asset_code`                    | STRING    | Asset code (`XLM` for native, e.g. `USDC` for credit assets)     |
    | `asset_type`                    | STRING    | Asset type: `native`, `credit_alphanum4`, or `credit_alphanum12` |
    | `asset_issuer`                  | STRING    | Asset issuer account (null for native XLM)                       |
    | `liquidity_pool_id`             | STRING    | Liquidity pool ID (for pool-based balances)                      |
    | `balance`                       | DECIMAL   | Balance amount in stroops                                        |
    | `last_modified_ledger_sequence` | UINT32    | Ledger sequence when balance was last modified                   |
    | `change_type`                   | STRING    | Type of change: `created`, `updated`, `removed`, `restored`      |
    | `ledger_entry_type`             | STRING    | Source entry type: `account`, `trustline`, or `liquidity_pool`   |
    | `ingested_at`                   | TIMESTAMP | Timestamp when the record was ingested                           |
  </Accordion>
</AccordionGroup>

***

## Deprecated versions

<AccordionGroup>
  <Accordion title="stellar.* (deprecated)">
    The following dataset versions are no longer supported and should be migrated to the current `stellar_mainnet.*` datasets.

    | Deprecated dataset       | Versions         | Migrate to                       |
    | ------------------------ | ---------------- | -------------------------------- |
    | `stellar.ledgers`        | v3.1.0 and prior | `stellar_mainnet.ledgers`        |
    | `stellar.transactions`   | v3.1.0 and prior | `stellar_mainnet.transactions`   |
    | `stellar.operations`     | v3.1.0 and prior | `stellar_mainnet.operations`     |
    | `stellar.events`         | v3.2.0 and prior | `stellar_mainnet.events`         |
    | `stellar.transfers`      | v3.2.0 and prior | `stellar_mainnet.transfers`      |
    | `stellar.ledger_entries` | v3.1.0 and prior | `stellar_mainnet.ledger_entries` |
    | `stellar.balances`       | v3.1.0 and prior | `stellar_mainnet.balances`       |

    <Warning>
      These datasets were used with the Mirror product and are no longer supported.
    </Warning>
  </Accordion>
</AccordionGroup>

For any questions or feedback, reach out at [support@goldsky.com](mailto:support@goldsky.com).
