Export and analyze swap events from an Avalanche C-Chain smart contract.
- Clone or download this repository
- Run with Docker Compose:
docker-compose up --buildThe CSV file will be saved to the output/ directory.
# Build the container
docker build -t swap-exporter .
# Run the container
docker run -v $(pwd)/output:/app/output swap-exporter- Install dependencies:
pip install -r requirements.txt- Run the exporter:
python swap_exporter.pyThe script generates all_swap_events.csv with the following columns:
block_number: Block number where the swap occurredtransaction_hash: Transaction hashlog_index: Log index within the transactionsender: Address that initiated the swapamount0_in: Input amountamount0_out: Output amounttoken_in: Input token addressto: Recipient addressstable: Whether this is a stable swap (boolean)
- Contract:
0xCaD684775d7879E63f5d319dAcC8086EeCC01B01 - Network: Avalanche C-Chain
- Deployment Block: 64929070
- Event Topic:
0xe7857fba7d66e2e29213fda7a0394efbaa80d435dfc7b4c1f147d78c2f9caa62
The exporter tracks events with amount0_in = 200000000000 and reports statistics on completion.