CoolFace
Apppublic

Marchelo23/mempool

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes
App README

โšก Bitcoin Mempool Fee Predictor API

ML-powered real-time fee predictions for Bitcoin block inclusion.

Uses an XGBoost + LightGBM ensemble trained on live mempool data to predict the optimal fee rate (sats/vByte) needed to get your transaction confirmed in the next 1, 3, or 6 blocks.

๐Ÿ”— API Endpoints

EndpointDescription
GET /API info & status
GET /healthHealth check
GET /fees/predictML fee predictions (1, 3, 6 blocks)
GET /fees/currentCurrent mempool fees (from mempool.space)
GET /mempool/blocksProjected mempool blocks
GET /modelsLoaded model information
GET /model-metadataModel training metrics & metadata
GET /docsInteractive API docs (Swagger UI)

๐Ÿ“ก Example

bash
curl https://marchelo23-mempool.hf.space/fees/predict

Response

json
{
  "timestamp": "2026-04-23T12:00:00",
  "mempool_snapshot": {
    "tx_count": 45000,
    "vsize_mb": 120.5,
    "total_fee_btc": 1.234
  },
  "fee_predictions": {
    "1_block": {
      "predicted_fee_sat_vb": 42,
      "confidence_interval": [36, 48],
      "priority": "high"
    },
    "3_blocks": {
      "predicted_fee_sat_vb": 28,
      "priority": "medium"
    },
    "6_blocks": {
      "predicted_fee_sat_vb": 15,
      "priority": "low"
    }
  },
  "recommendation": "NORMAL"
}

๐Ÿง  Models

  • โ€”XGBoost (v2.1+): Primary model, 0.6 ensemble weight
  • โ€”LightGBM (v4.5+): Secondary model, 0.4 ensemble weight
  • โ€”Training: Automated retraining on live mempool snapshots
  • โ€”Features: 100+ engineered features from mempool state, fee landscape, block timing, and network metrics

๐Ÿ—๏ธ Architecture

mempool.space API โ†’ Feature Engineering โ†’ Ensemble (XGB + LGB) โ†’ Fee Predictions

Built with FastAPI, deployed as a Docker container on Hugging Face Spaces.

๐Ÿ“Š Data Source

All data is fetched in real-time from the mempool.space public API (Bitcoin mainnet).