Developers who build classifieds monitors for used electronics usually treat the problem as a pure scraping exercise. Grab fresh listings from a local marketplace, compare the asking price against an average resale price, and push matches into a Telegram channel.
In production, that naive design fails for two unrelated reasons: bad margin math and broadcast congestion.
Failure 1: Gross spread hides real transaction costs
A used flagship phone listed 12,000 RUB below median retail price looks like an easy flip until you deduct real platform and handling overhead:
- Marketplace escrow / delivery fee: 7% off the final sale price (for example, 3,360 RUB on a 48,000 RUB smartphone)
- Intercity shipping and protective packaging: roughly 1,000 RUB when buying outside your city
- Repair parts and labor when sourcing damaged units instead of clean retail stock
Without deducting these upfront, a script spams buyers with deals that actually net 0 to 1,500 RUB once the unit sells.
Splitting deals into three separate pipelines
In real electronics resale and small repair shops, every listing belongs to one of three mutually exclusive tracks:
- Retail (fast flip): working devices with clean screens and batteries, turned over in 2 to 5 days.
- Repair: single known hardware fault (cracked OLED, dead battery, drifted stick) where part cost is fixed in advance.
- Donors: non-booting or board-damaged devices bought strictly below 22 - 25% of working median value for OEM screen, housing, and battery harvesting.
A lightweight, zero-dependency Python CLI makes it easy to enforce hard purchase ceilings before anyone picks up the phone:
from dataclasses import dataclass @dataclass(frozen=True) class DealInput: title: str mode: str # "retail" | "repair" | "donor" buy_price_rub: int median_sale_rub: int repair_cost_rub: int = 0 intercity: bool = False delivery_fee_rate: float = 0.07 def evaluate_deal(deal: DealInput) -> dict: fee = round(deal.median_sale_rub * deal.delivery_fee_rate) shipping = 1000 if deal.intercity else 0 if deal.mode == "donor": max_buy = round(deal.median_sale_rub * 0.25) parts_yield = round(deal.median_sale_rub * 0.35) net_profit = parts_yield - deal.buy_price_rub - shipping else: net_profit = deal.median_sale_rub - fee - shipping - deal.repair_cost_rub - deal.buy_price_rub max_buy = deal.median_sale_rub - fee - shipping - deal.repair_cost_rub roi_pct = round((net_profit / max(deal.buy_price_rub, 1)) * 100, 1) return { "title": deal.title, "mode": deal.mode, "net_profit_rub": net_profit, "roi_pct": roi_pct, "max_buy_rub": max_buy, "approved": net_profit > 0 and deal.buy_price_rub <= max_buy, } Running concrete 2026 numbers through this model illustrates how fast margins shift across tracks:
| Device | Mode | Median | Ask Price | 7% Fee + Repair | Local Net Profit |
|---|---|---|---|---|---|
| Galaxy S24 Ultra 256GB | Retail | 48,000 RUB | 34,500 RUB | 3,360 RUB | +10,140 RUB (29.4% ROI) |
| Steam Deck OLED | Repair (OLED swap) | 53,000 RUB | 26,000 RUB | 14,710 RUB | +12,290 RUB (47.3% ROI) |
| MacBook Pro 14 M1 Pro | Donor (parts harvest) | 81,000 RUB | 18,000 RUB | 0 RUB (28,350 yield) | +10,350 RUB (57.5% ROI) |
We extracted this calculator into a standalone zero-dependency Python tool (avito-resale-margin-cli) with JSON batch evaluation and unit tests so resellers and repair techs can verify ceilings offline before tuning alerts.
Failure 2: Broadcast alerts create a thundering herd
Even with accurate unit economics, sending the same underpriced listing to 30 subscribers in one city destroys the deal. The seller gets 15 calls in 30 seconds, realizes they underpriced the item, deletes the listing, and relists it 8,000 - 10,000 RUB higher.
The architectural fix is replacing pub/sub broadcast with a single-recipient fair lease queue:
- Cap active subscribers per
(city, model_slot)segment (for example, maximum 7 seats). - Deduplicate relisted items with a content fingerprint (
blake2bover normalized tokens + seller + 500 RUB price bucket) instead of relying solely on external listing IDs. - Assign each qualified listing to strictly one active subscriber inside an atomic
BEGIN IMMEDIATEtransaction in SQLite WAL mode, sorting by(last_dispatched ASC, dispatched_today ASC)with a per-user cooldown. - On
HTTP 403(user blocked the bot), mark the seat blocked and immediately return the item topendingso the deal routes to the next active buyer without dropping.
This exact pipeline runs in production at AviSniper, a cloud Telegram monitor built around a dedicated Avito electronics reseller workflow covering 30 electronics categories with pawnshop, replica, iCloud, and MDM filtering baked in before dispatch.
Practical takeaways
If you are building any real-time arbitrage or classifieds monitoring pipeline:
- Never show gross price deltas without subtracting marketplace fees, logistics, and repair overhead first.
- Treat broadcast fan-out as a bug whenever listings are single-quantity physical goods.
- Keep the queue state machine atomic and small: SQLite in WAL mode handles 50,000 - 100,000 daily events on a single NVMe VPS before you ever need PostgreSQL or a separate message broker.