Every 15min
🌐 Binance P2P API
Official source for BUY/SELL offers
https://p2p.binance.com/bapi/c2c/v2/friendly/c2c/adv/search
Payload: {"fiat": "BOB", "asset": "USDT", "tradeType": "SELL"}
→
⚙️ AWS Lambda
Automated serverless processing
fetch_data.py runs every 15 minutes:
1. Fetch SELL offers (USDT sellers)
2. Fetch BUY offers (USDT buyers)
3. Parse and validate offer data
→
🎯 Median Absolute Deviation Outlier Filter
Adaptive statistical filtering
Dynamic threshold using linear interpolation:
- Low amount of offers: MAD = 6.0 (lenient)
- High amount of offers: MAD = 3.0 (strict)
- Between: interpolated value
Removes: |price - median| / mad > threshold
→
📊 VWAP Calculation
Volume-Weighted Average Price
VWAP = Σ(price × volume) / Σ(volume)
- Applied to filtered offers only
- Sell VWAP: For USDT buyers
- Buy VWAP: For USDT sellers