This script connects to Nostr relays to aggregate P2P Bitcoin & Crypto exchange orders, similar to the p2p.band website. It fetches order data from Nostr and pricing data from public APIs.
This Python implementation is based on the original p2pband project by KoalaSat. The original project is a React-based web application that provides a similar P2P Bitcoin order aggregation service. This Python version reimplements the core functionality as a command-line tool for server-side usage and analysis.
Original Project: https://github.com/KoalaSat/p2pband
Original Author: KoalaSat
License: MIT (following the original project's license)
It is highly recommended to use a Python virtual environment to manage dependencies and avoid conflicts with other projects.
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install the required dependencies:
pip install -r requirements.txt
To run the script, simply execute the following command:
python3 p2p_aggregator.py
<OR>
python3 p2p_aggregator.py -t 30s -c USD,BTCTo see the full list of arguments (scan time, currencies and cryptos supported), run:
python3 p2p_aggregator.py -hThe script will start fetching and processing events from Nostr relays and will print the structured order data to the console. Once the scan is complete, it will save a CSV report for you to review, e.g. 'offers-ALL-20250710181005.csv'.