Skip to main content

Overview

This tutorial shows how to read Plasma Mainnet Beta data with Python. You will connect to your Chainstack endpoint, confirm network metadata, scan recent blocks, and decode USDT Transfer events—no write operations or private-key handling required.

Prerequisites

  • Chainstack account with a Plasma node (chain ID 9745, currency symbol XPL)
  • Python 3.10 or later
  • pip and virtualenv
  • Familiarity with .env files
Switch to a Plasma Testnet node (chain ID 9746) by dropping the testnet endpoint from your Chainstack console into PLASMA_RPC_URL.

1. Set up the project

Create a .env file and paste your Chainstack HTTPS URL from Access and credentials:
Replace the placeholder endpoint with the URL shown in your Chainstack console. Leave MIN_USDT at 0 to list every transfer, or raise it to filter out dust.

2. Add a read-only monitor

Create monitor.py:
PLASMA_USDT_ADDRESS points to the USDT contract announced by HTX for Plasma Mainnet. Always cross-check the address on Plasmascan before running production monitors.

3. Run the monitor

Expected console output:
If you receive an empty list, increase BLOCK_WINDOW or switch to Plasma Testnet where transfers are more frequent during testing.

4. Extend the analysis

  • Pipe output into a CSV or database for dashboards.
  • Compare mainnet versus testnet activity by swapping the RPC URL.
  • Add token balance snapshots with contract.functions.balanceOf(address).call() to profile top holders.
Run the script on a schedule (for example, GitHub Actions or a lightweight cron job) to feed alerting pipelines whenever a large USDT transfer crosses the Plasma network.
Last modified on April 13, 2026