## Carbon stream

*Yellowstone gRPC*

Server-filtered bidirectional gRPC stream on port 9443, for Dev, Business and Pro plans (not Free). Each Subscribe is one stream under the account cap in [rate limits](https://carbium.sh/docs/limits.md). Authenticate with `x-token` or a bearer token in gRPC metadata.

```
# Carbon Stream  gRPC. No server reflection: pass geyser.proto and
# solana-storage.proto from rpcpool/yellowstone-grpc (yellowstone-grpc-proto/proto) in ./proto
grpcurl -import-path ./proto -proto geyser.proto -H 'x-token: <YOUR_KEY>' \
  -d '{"slots":{"s":{}},"accounts":{},"transactions":{}}' \
  services.carbium.sh:9443 \
  geyser.Geyser/Subscribe
# -> stream: slot updates, and a ping every 15 s
# authorization: Bearer <YOUR_KEY> also accepted
```

### filters

| filter | selects on | commitment |
|---|---|---|
| slots | slot status ticks | processed / confirmed / finalized |
| accounts | account, owner, memcmp / datasize | processed / confirmed / finalized |
| transactions | account include / exclude, vote, failed | processed / confirmed / finalized |
| blocksMeta | block header, no transactions | processed / confirmed / finalized |
| entry | entry-level shreds | processed / confirmed / finalized |
| transactionsStatus | transaction filter shape, status frames only | processed / confirmed / finalized |
| blocks | only transactions of the 9 liquidity programs in SKILL.md; full blocks: getBlock | processed / confirmed / finalized |

> One Subscribe can combine filters. Commitment: one per subscription, default processed. Replay with from_slot: processed only, light filters, paid plans. Idle subscriptions count against the concurrent cap; close those you are not reading.

### methods

#### Calls

#### GetVersion

1 credit

```
{}
```

**answer**: {version: JSON {version: {package, version, proto, proto_richat, solana, git, rustc, buildts}, extra: {hostname}}}

#### GetSlot

1 credit

```
{}
```

**answer**: {slot}

#### GetBlockHeight

1 credit

```
{}
```

**answer**: {blockHeight}

#### GetLatestBlockhash

1 credit

```
{}
```

**answer**: {slot, blockhash, lastValidBlockHeight}

#### IsBlockhashValid

1 credit

| param | type |   |   |
|---|---|---|---|
| blockhash | string | req |  |
| commitment | enum number | opt | 2 is finalized |

```
{"blockhash":"<blockhash>","commitment":2}
```

**answer**: {slot, valid}

#### Ping

1 credit

| param | type |   |   |
|---|---|---|---|
| count | number | req |  |

```
{"count":1}
```

**answer**: {count}

#### SubscribeReplayInfo

1 credit

```
{}
```

**answer**: {firstAvailable}

#### Streams

#### slots

5 + 20 a MiB sent

| param | type |   |   |
|---|---|---|---|
| slots.\<name>.filter_by_commitment | bool | opt |  |
| commitment | string | opt |  |

```
{"slots":{"s":{"filter_by_commitment":true}},"commitment":"PROCESSED"}
```

**answer**: update {filters, slot: {slot, parent, status, deadError?, bankId?}, createdAt}

**refuses**: 403 -32050 a key on the free plan

#### accounts

200 by owner, 25 by account; + 20 a MiB sent

| param | type |   |   |
|---|---|---|---|
| accounts.\<name>.account | pubkey[] | opt | one of account or owner is needed |
| accounts.\<name>.owner | pubkey[] | opt | each owner must be in the covered set |

```
{"accounts":{"a":{"owner":["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"]}}}
```

**answer**: update {filters, account: {account: {pubkey, lamports, owner, executable, rentEpoch, data, writeVersion, txnSignature?}, slot, isStartup, bankId?}, createdAt}

**refuses**: 403 -32050 a key on the free plan; 403 -32050 a heavy stream on a plan with none: blocks, entry, accounts by owner alone, transactions by vote or failed alone; 403 -32010 an owner outside the covered set; 403 -32010 neither account nor owner is named

#### transactions

200 all, 25 by account, 5 by signature; + 20 a MiB

| param | type |   |   |
|---|---|---|---|
| transactions.\<name>.vote | bool | opt |  |
| transactions.\<name>.failed | bool | opt |  |
| transactions.\<name>.account_include | pubkey[] | opt |  |
| transactions.\<name>.account_required | pubkey[] | opt |  |
| transactions.\<name>.signature | string | opt |  |

```
{"transactions":{"t":{"vote":false,"failed":false,"account_include":["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"]}}}
```

**answer**: update {filters, transaction: {transaction: {signature, isVote, transaction, meta, index}, slot, bankId}, createdAt}

**refuses**: 403 -32050 a key on the free plan; 403 -32050 a heavy stream on a plan with none: blocks, entry, accounts by owner alone, transactions by vote or failed alone; 403 -32010 a filter that names nothing

#### transactions_status

25 by account, 5 by signature; + 20 a MiB sent

| param | type |   |   |
|---|---|---|---|
| transactions_status.\<name>.account_include | pubkey[] | opt | an account or a signature is needed |
| transactions_status.\<name>.account_required | pubkey[] | opt |  |
| transactions_status.\<name>.signature | string | opt |  |

```
{"transactions_status":{"ts":{"account_include":["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"]}}}
```

**answer**: update {filters, transactionStatus: {slot, signature, isVote, index, err?, bankId}, createdAt}

**refuses**: 403 -32050 a key on the free plan; 403 -32010 no account and no signature named

#### blocks

200 + 20 a MiB sent

| param | type |   |   |
|---|---|---|---|
| blocks.\<name> | object | req | an empty object takes every block |

```
{"blocks":{"b":{}}}
```

**answer**: update {filters, block: {slot, blockhash, rewards: {rewards}, blockTime: {timestamp}, blockHeight: {blockHeight}, transactions, parentSlot, parentBlockhash, executedTransactionCount, updatedAccountCount, accounts, entriesCount, entries}, createdAt}

**refuses**: 403 -32050 a key on the free plan; 403 -32050 a heavy stream on a plan with none: blocks, entry, accounts by owner alone, transactions by vote or failed alone

#### blocks_meta

200 + 20 a MiB sent

| param | type |   |   |
|---|---|---|---|
| blocks_meta.\<name> | object | req |  |

```
{"blocks_meta":{"bm":{}}}
```

**answer**: update {filters, blockMeta: {slot, blockhash, rewards, blockTime, blockHeight, parentSlot, parentBlockhash, executedTransactionCount, entriesCount, bankId}, createdAt}

**refuses**: 403 -32050 a key on the free plan

#### entry

200 + 20 a MiB sent

| param | type |   |   |
|---|---|---|---|
| entry.\<name> | object | req |  |

```
{"entry":{"e":{}}}
```

**answer**: update {filters, entry: {slot, index, numHashes, hash, executedTransactionCount, startingTransactionIndex, bankId}, createdAt}

**refuses**: 403 -32050 a key on the free plan; 403 -32050 a heavy stream on a plan with none: blocks, entry, accounts by owner alone, transactions by vote or failed alone
