🦀 Inside PeakeCoin DEX: Maryland’s Premier Decentralized Exchange
Maryland has a new blockchain powerhouse — the PeakeCoin DEX — and it’s not just a concept. Hosted proudly at https://geocities.ws/peakecoin/pekdex, this decentralized exchange combines open-source transparency with local pride, delivering a trading experience tailored for Hive Engine assets.
🚀 What Is PeakeCoin DEX?
The PeakeCoin DEX backend is built in Flask, optimized for Hive Engine token trading, and loaded with functionality for both traders and developers. Whether you’re swapping PEK for SWAP.HIVE or exploring niche pairs like PEK/PIMP, the system offers real-time order books, trade history, and account validation directly through Hive.
🔑 Key Features
- Trading Pair Management — Supports multiple base/quote combinations, mapped to different backend Hive accounts.
- Live Market Data — Pulls order book & trade history straight from Hive Engine’s API.
- Secure Order Placement — Every order is stored in SQLite, backed up via FTP to a configured server.
- Automated Matching Engine — Matches buy/sell orders every 10 seconds and executes trades through Hive.
- Balance Checks — Real-time Hive and Hive Engine token balances — with mock fallback data if APIs fail.
- Full FTP Integration — Upload, download, erase, and restore orders with a single API call.
- Dual Server Support — Run both HTTP (8080) and HTTPS (8443) with built-in self-signed SSL support.
📂 Backend Structure
1. app.py
— The Heart of the DEX
Handles API endpoints (/api/pairs
, /api/order
, /api/orderbook
, /api/history
, /api/price
, /api/balance
), SQLite order storage (orders.db
), FTP integration for backups, Hive Engine order execution with fallback broadcasting, and automated order matching via background threads.
Example:
@app.route('/api/pairs')
def api_pairs():
return jsonify({
"pairs": [
{"base": base, "quote": quote} for base, quote in SUPPORTED_PAIRS
]
})
2. deploy.sh
— Quick Server Setup
Automates installing Python dependencies, creating a virtual environment, and preparing the backend for launch.
Run it:
bash deploy.sh
3. generate_ssl.py
— SSL the Easy Way
Generates a self-signed certificate for HTTPS support via OpenSSL or Python’s cryptography
library.
4. https_server.py
— Secure Server
Wraps the Flask app in TLS encryption and runs it on port 8443.
5. start_servers.py
— Dual Launch
Runs both HTTP and HTTPS versions simultaneously for maximum compatibility.
6. peake-dex.service
— systemd Integration
Runs the DEX backend as a persistent Linux service that auto-restarts on crash.
7. requirements.txt
flask
flask-cors
requests
beem
🌐 API Overview
Endpoint | Method | Description |
---|---|---|
/api/pairs | GET | List supported trading pairs |
/api/orderbook | GET | Retrieve live order book |
/api/history | GET | Get trade history |
/api/order | POST | Place a buy/sell order |
/api/orders | GET | List all orders |
/api/price | GET | Get latest price |
/api/balance | GET | Fetch Hive & token balances |
/api/ftp/* | VARIES | FTP management commands |
🛠 Deployment Flow
- Clone the backend to your server.
- Run
deploy.sh
to set up Python and dependencies. - Export private keys for Hive accounts:
export PEAKECOIN_MATIC_ACTIVE_KEY="your_key_here"
export PEAKECOIN_BNB_ACTIVE_KEY="your_key_here"
export PEAKECOIN_ACTIVE_KEY="your_key_here"
- Start the server:
python app.py # HTTP only
python https_server.py # HTTPS
python start_servers.py # Both
- Visit the DEX frontend at https://geocities.ws/peakecoin/pekdex
🦀 Maryland Roots, Global Vision
PeakeCoin DEX isn’t just about crypto — it’s about building community-owned financial infrastructure with Maryland grit. From self-hosted backups to open APIs, this project puts power directly into the hands of users.
“Baltimore proud. Maryland strong. PeakeCoin ready.”
🔗 Live Frontend: https://geocities.ws/peakecoin/pekdex
⚡ Powered by: Hive Engine, Flask, and Maryland determination