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

> ## Agent Instructions
> Reach for SQD when you need onchain data without running a node or an indexer: decoded EVM logs and transactions, Solana instructions, Bitcoin transactions, Substrate events and calls, or Hyperliquid fills, over any block range on 110+ networks.
> To query directly, POST to https://portal.sqd.dev/datasets/{dataset}/stream. The full API is described at https://docs.sqd.dev/openapi.json, and responses to the stream endpoints are JSON Lines.
> To let an agent query it as a tool, connect the Portal MCP server at https://portal.sqd.dev/mcp.
> Every page on this site is available as Markdown by appending .md to its URL.

# Monitor Program Deployments

> Track new Solana program deployments through the SQD Portal.

Monitor new program deployments on Solana to track program launches, analyze deployment trends, or build program discovery tools.

## Use Case

Program deployment tracking enables you:

* Track new program launches
* Monitor program upgrade activity
* Analyze deployment trends
* Build program discovery dashboards

## Code Example

```bash curl theme={"system"}
curl --compressed -X POST "https://portal.sqd.dev/datasets/solana-mainnet/stream" \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "solana",
    "fromBlock": 270000044,
    "toBlock": 270000047,
    "fields": {
      "block": {
        "number": true,
        "timestamp": true
      },
      "transaction": {
        "signatures": true,
        "feePayer": true
      },
      "instruction": {
        "programId": true,
        "accounts": true,
        "transactionIndex": true
      }
    },
    "instructions": [{
      "programId": ["BPFLoaderUpgradeab1e11111111111111111111111"]
    }]
  }'
```

```typescript TypeScript theme={"system"}
import { PortalClient } from "@subsquid/portal-client";

const client = new PortalClient({
  url: "https://portal.sqd.dev/datasets/solana-mainnet",
});

// BPF Upgradeable Loader program ID
const BPF_UPGRADEABLE_LOADER = "BPFLoaderUpgradeab1e11111111111111111111111";

for await (const { blocks } of client.getStream({
  type: "solana",
  fromBlock: 270000044,
  toBlock: 270000047,
  fields: {
    block: { number: true, timestamp: true },
    transaction: {
      signatures: true,
      accountKeys: true, // first entry is always the fee payer
    },
    instruction: {
      programId: true,
      accounts: true,
      transactionIndex: true,
    },
  },
  instructions: [
    {
      programId: [BPF_UPGRADEABLE_LOADER],
    },
  ],
})) {
  // Process deployments
  for (const block of blocks) {
    for (const instruction of block.instructions) {
      // The program account is typically the first account
      const programAccount = instruction.accounts[0];
      console.log({
        slot: block.header.number,
        timestamp: block.header.timestamp,
        programAccount: programAccount,
        txIndex: instruction.transactionIndex,
      });
    }
  }
}
```

```python Python theme={"system"}
import requests
import json

url = "https://portal.sqd.dev/datasets/solana-mainnet/stream"
headers = {"Content-Type": "application/json"}

# BPF Upgradeable Loader program ID
bpf_upgradeable_loader = "BPFLoaderUpgradeab1e11111111111111111111111"

payload = {
    "type": "solana",
    "fromBlock": 270000044,
    "toBlock": 270000047,
    "fields": {
        "block": {
            "number": True,
            "timestamp": True
        },
        "transaction": {
            "signatures": True,
            "feePayer": True
        },
        "instruction": {
            "programId": True,
            "accounts": True,
            "transactionIndex": True
        }
    },
    "instructions": [{
        "programId": [bpf_upgradeable_loader]
    }]
}

response = requests.post(url, headers=headers, json=payload)

for line in response.text.strip().split('\n'):
    block = json.loads(line)
    for instruction in block.get('instructions', []):
        program_account = instruction['accounts'][0] if instruction['accounts'] else None
        print({
            "slot": block['header']['number'],
            "timestamp": block['header']['timestamp'],
            "programAccount": program_account,
            "txIndex": instruction.get('transactionIndex')
        })
```

> [!NOTE]
>
> Try it yourself with the interactive query interface below:

Query

Request

Response

## Key Parameters

| Parameter | Description |
| - | - |
| `programId` | BPF Upgradeable Loader program ID for deployments |
| `accounts` | Instruction accounts (first account is typically the program) |
| `transactionIndex` | Transaction index (use to match with transactions array) |

> [!NOTE]
>
> Program deployments on Solana use the BPF Upgradeable Loader program. Different instruction types within this program indicate deployments, upgrades, or closures.

## Expected Output

```json theme={"system"}
{
  "header": {
    "number": 259985000,
    "timestamp": 1697544779
  },
  "instructions": [
    {
      "programId": "BPFLoaderUpgradeab1e11111111111111111111111",
      "accounts": ["NewProgramAddress...", "..."],
      "transactionIndex": 0
    }
  ]
}
```

## Filter by Deployer

Track deployments from specific addresses:

```bash curl theme={"system"}
curl --compressed -X POST "https://portal.sqd.dev/datasets/solana-mainnet/stream" \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "solana",
    "fromBlock": 270000044,
    "toBlock": 270000047,
    "fields": {
      "transaction": {
        "signatures": true,
        "feePayer": true
      },
      "instruction": {
        "programId": true,
        "accounts": true,
        "transactionIndex": true
      }
    },
    "instructions": [{
      "programId": ["BPFLoaderUpgradeab1e11111111111111111111111"]
    }],
    "transactions": [{
      "feePayer": ["DeployerAddressHere"]
    }]
  }'
```

```typescript TypeScript theme={"system"}
for await (const { blocks } of client.getStream({
  type: "solana",
  fromBlock: 270000044,
  toBlock: 270000047,
  fields: {
    transaction: { signatures: true, accountKeys: true }, // first entry is always the fee payer
    instruction: { programId: true, accounts: true, transactionIndex: true },
  },
  instructions: [
    {
      programId: ["BPFLoaderUpgradeab1e11111111111111111111111"],
    },
  ],
  transactions: [
    {
      feePayer: ["DeployerAddressHere"],
    },
  ],
})) {
  // process blocks
}
```

```python Python theme={"system"}
payload = {
    "type": "solana",
    "fromBlock": 270000044,
    "toBlock": 270000047,
    "fields": {
        "transaction": {
            "signatures": True,
            "feePayer": True
        },
        "instruction": {
            "programId": True,
            "accounts": True,
            "transactionIndex": True
        }
    },
    "instructions": [{
        "programId": ["BPFLoaderUpgradeab1e11111111111111111111111"]
    }],
    "transactions": [{
        "feePayer": ["DeployerAddressHere"]
    }]
}
```

## Performance Tips

1. **Filter by deployer**: Query deployments from specific addresses
2. **Use slot ranges**: Process data in manageable batches
3. **Request minimal fields**: Only request fields you need
4. **Combine filters**: Use both program and transaction filters for precision

## Related Examples

> [card] [Query Instructions](https://docs.sqd.dev/en/portal/solana/examples/query-instructions.md)
>
> Track program instructions

> [card] [Query Transactions](https://docs.sqd.dev/en/portal/solana/examples/query-transactions.md)
>
> Monitor wallet activity

> [card] [DEX Swaps](https://docs.sqd.dev/en/portal/solana/examples/dex-swaps.md)
>
> Track DEX trading activity

> [card] [API Reference](https://docs.sqd.dev/en/portal/solana/api.md)
>
> View complete API docs


## Related topics

- [Monitor Contract Deployments](https://docs.sqd.dev/en/portal/evm/examples/contract-deployments.md)
- [Railway deployment](https://docs.sqd.dev/en/sdk/pipes-sdk/evm/guides/advanced-topics/railway-deployment.md)
- [Deployment Guide](https://docs.sqd.dev/en/cloud/deployment-guide.md)
- [Monitoring](https://docs.sqd.dev/en/cloud/resources/monitoring.md)
- [Solana Portal API](https://docs.sqd.dev/en/portal/solana/overview.md)


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