Enterprise Decision Intelligence for Food Delivery Platform Duopolies (Swiggy vs Zomato)
Version: 1.0.0 Production Release
In India's hyper-competitive on-demand food delivery landscape, Swiggy (Platform A) and Zomato (Platform B) operate as an entrenched duopoly controlling over 95% of aggregate gross merchandise value (GMV). In high-density urban zones, pricing decisionsβincluding consumer delivery fees, merchant commission take-rates, promotional fee discounts, and fleet surge allocationsβare deeply interdependent.
A platform that unilaterally cuts consumer delivery fees triggers retaliatory discounting from its rival, collapsing margins across the entire ecosystem. Conversely, excessive fee markups risk market-share migration and merchant churn.
PriceWar is an enterprise-grade quantitative pricing and strategic intelligence platform. It fuses structural econometric demand calibration with non-cooperative and cooperative game theory, empowering marketplace leadership, revenue management, and strategy executives to:
- Model Strategic Price Interdependence: Compute pure and mixed Nash equilibria across discrete pricing actions and identify sub-optimal price war traps.
- Predict Competitive Price Reactions: Derive analytical best-response functions under differentiated Bertrand price competition and capacity-constrained Cournot fleet deployments.
-
Analyze Long-Horizon Collusion Risks: Measure the stability of tacit high-fee cooperation over repeated interactions using Folk Theorem critical discount thresholds (
$\delta^*$ ). - Solve Asymmetric Cost Uncertainty: Formulate Bayesian Nash Equilibria (BNE) when competitor logistics routing and dispatch costs are private and unobservable.
- Stress-Test Regulatory & Macro Shocks: Simulate marketplace disruption from open networks (ONDC), festive/IPL surge demand, and government commission caps.
- Optimize Two-Sided Merchant Commissions: Maximize platform take-rate revenue subject to restaurant Individual Rationality (IR) participation constraints.
| Layer | Architecture & Technology | Description |
|---|---|---|
| Backend API Engine | Python 3.11+, FastAPI, Uvicorn (ASGI) | Asynchronous, sub-40ms execution, type-safe via Pydantic v2 |
| Algorithmic Math Core | nashpy, numpy, scipy |
Support enumeration, bimatrix solvers, and numerical optimization |
| Econometric Pipeline | pandas, scikit-learn, joblib |
Structural OLS and Logit market-share model fitting, point elasticity |
| Frontend Dashboard | React 18, TypeScript, Vite, Tailwind CSS | Modular component architecture, glassmorphic dark theme |
| Data Visualization | Recharts Responsive Analytics | Multi-series reaction curves, fee distributions, trajectory timeseries |
| State & Networking | TanStack React Query v5, Axios | Declarative caching, optimistic mutations, and background polling |
| Automated Testing | pytest, httpx (14 automated suites) |
Validated against known Prisoner's Dilemma, Matching Pennies, and closed forms |
pricewar/
βββ backend/
β βββ app/
β β βββ main.py # FastAPI production app, CORS, and router registration
β β βββ core/
β β β βββ config.py # Cost benchmarks, commission take-rates, strategy sets
β β β βββ demand.py # Econometric cleaner, feature engineering, Linear & Logit models
β β β βββ payoffs.py # N x M bimatrix engine & unit margin profit calculators
β β β βββ equilibrium.py # Pure & Mixed NE (Nashpy), IESDS, Bertrand & Cournot solvers
β β β βββ repeated.py # Multi-period dynamic supergames, Folk theorem Ξ΄*, tournament
β β β βββ bayesian.py # Bayesian game solver (unknown rival cost) & belief sweeps
β β β βββ scenarios.py # ONDC 3-player, festival surge, commission cap shock models
β β β βββ commission.py # Merchant mechanism design & IR constraint optimization
β β βββ routers/ # demand, oneshot, bertrand, repeated, bayesian, scenarios, commission
β βββ data/
β β βββ delivery_orders.csv # Empirical order records (N=1,500)
β β βββ fitted_demand_model.joblib # Serialized model pipeline
β βββ tests/
β β βββ test_game_theory.py # Algorithmic game theory and mathematical proof tests
β β βββ test_api.py # FastAPI endpoint integration tests
β βββ requirements.txt
βββ frontend/
β βββ src/
β β βββ api.ts # Typed Axios client & REST response schemas
β β βββ components/ # PayoffMatrix, SliderPanel, EquilibriumCard, Navbar
β β βββ pages/ # ExecutiveSummary, DemandElasticity, OneShot, BertrandCournot, Repeated, Bayesian, ScenarioLab, CommissionDesign, EconomicFrameworks
β β βββ App.tsx # Root application layout & React Query provider
β β βββ index.css # Tailwind styling, brand palettes, and glassmorphism
β βββ package.json
β βββ vite.config.ts
β βββ tailwind.config.js
βββ README.md
-
Empirical Calibration: Calibrates customer order volume against consumer delivery fee (
$P_i$ ), rival delivery fee ($P_j$ ), and promotional subsidies ($\text{Disc}_i$ ):$$Q_i = a - b \cdot P_i + c \cdot P_j + d \cdot \text{Disc}_i$$ -
Demand Sensitivity Parameters: Extracts structural coefficients for baseline volume (
$a$ ), own-fee price sensitivity ($b$ ), competitor price substitution ($c$ ), and discount promotion lift ($d$ ). -
Point Price Elasticity Spectrum: Evaluates elasticity across the βΉ10ββΉ60 fee spectrum, quantifying own-price elasticity (
$\epsilon \approx -1.24$ ) and cross-price substitution ($\eta \approx +0.82$ ).
-
Unit Margin Formulation:
$$\text{Margin}_i = P_i + (\text{Commission Rate} \times \text{GMV}) - \text{Rider Cost} - \text{Discount}_i$$ $$\Pi_i = \text{Margin}_i \times Q_i(P_i, P_j)$$ -
Equilibrium Solvers: Identifies Pure Strategy Nash Equilibria (mutual best responses), Mixed Strategy Nash Equilibria via
Nashpysupport enumeration, and Iterated Elimination of Strictly Dominated Strategies (IESDS). - Price War Trap Diagnosis: Demonstrates why non-cooperative discounting traps both platforms in a low-profit equilibrium despite mutual high-fee profitability.
-
Differentiated Bertrand: Solves simultaneous reaction functions
$P_1(P_2)$ and$P_2(P_1)$ , identifying the competitive Nash fee$P^* = \frac{a + b \cdot mc}{2b - c}$ and comparing against the joint monopoly cartel fee$P_M$ . -
Fleet Allocation Cournot: Models capacity allocation of delivery rider slots under inverse demand
$P(Q_1 + Q_2) = \alpha - \beta(Q_1 + Q_2)$ . - Reaction Function Visualization: Interactive curves marking the unique stable equilibrium intersection.
-
Repeated Game Engine: Simulates dynamic supergames over configurable horizons (
$N$ rounds) discounted by patience factor$\delta \in [0, 0.99]$ . - Strategy Arsenal: Always Cooperate, Always Defect, Grim Trigger, Tit-for-Tat, Pavlov (WSLS), Random, and an adaptive Tabular Q-Learning Agent.
-
Folk Theorem Enforcement: Computes the exact critical threshold:
$$\delta^* = \frac{\pi_{defect} - \pi_{collude}}{\pi_{defect} - \pi_{punish}}$$ - One-Deviation Property Validation: Verifies whether a single-period defection followed by perpetual punishment is subgame perfect (SPE).
- Strategy Tournament: Round-robin league simulation ranking strategies by cumulative discounted profit.
-
Bayesian Nash Equilibrium: Formulates strategic pricing when rival operational delivery costs are private:
$$c_B \in {c_L, c_H} \quad \text{with prior belief} \quad P(c_L) = p$$ - Closed-Form BNE Solver: Solves uninformed price $P_A^$ for Swiggy and type-contingent prices $(P_B^(L), P_B^*(H))$ for Zomato.
- Belief Sensitivity Curves: Visualizes how Swiggy's optimal fee systematically adjusts downward as the rival's likelihood of low-cost efficiency increases.
- ONDC Entry (3-Player Game): Evaluates incumbent fee compression when an open unbundled network enters at βΉ15 delivery.
- Festive / IPL Surge Multiplier: Models intercept demand expansion and profit capture during peak consumption events.
- Regulatory Commission Caps: Evaluates economic incidence when restaurant commissions are capped (e.g., from 20% to 12%), demonstrating fee pass-through to consumers.
- Welfare Decomposition: Side-by-side analysis of Consumer Surplus vs. Platform Operating Profits.
-
Mechanism Design: Optimizes platform take-rate
$r \in [5%, 35%]$ subject to each merchant's Individual Rationality (IR) participation constraint:$$\Pi_{restaurant}(r) \ge \bar{U}_{offline} \quad (\text{Reservation Walk-in Profit})$$ - Revenue Maximization: Identifies the profit-maximizing commission rate (~21%) and the critical churn threshold (~28%).
| Strategic Business Challenge | Marketplace Context | Quantitative & Algorithmic Solution |
|---|---|---|
| Demand Interdependence | Consumer delivery volume depends simultaneously on rival platform delivery fees and promotions. | Structural OLS and Logit econometric estimation; elasticity spectrum across price tiers. |
| Competitive Undercutting | Aggressive discounting leads to margin-destructive price wars. | Bimatrix Normal Form game; Pure & Mixed Nash Equilibria via Nashpy; IESDS dominance pruning. |
| Continuous Price Setting | Platforms choose continuous delivery fees with platform brand loyalty. | Differentiated Bertrand best-response equations; analytical Nash vs Cartel comparison. |
| Fleet Capacity Scarcity | Competing for a finite pool of delivery riders during peak hours. | Continuous Cournot capacity game allocating rider slots. |
| Collusion Enforcement | Sustaining profitable delivery fees without contractual agreements. | Repeated supergames with Folk Theorem |
| Private Cost Asymmetry | Rival logistics efficiency and route optimization capabilities are unobservable. | Bayesian Game with subjective prior distributions; closed-form Bayesian Nash Equilibrium. |
| Merchant Delisting Risk | High platform commissions trigger restaurant protests and offline migration. | Mechanism design subject to Individual Rationality (IR) participation constraints. |
| Regulatory & Open Net Shocks | Government fee caps or open network protocols (ONDC) disrupting market structure. | Multi-agent comparative equilibrium analysis & consumer surplus welfare measurement. |
- Python 3.11+
- Node.js 18+ and
npm
cd pricewar/backend
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run automated tests
PYTHONPATH=. pytest tests/ -v
# Launch FastAPI microservice on port 8000
uvicorn app.main:app --host 127.0.0.1 --port 8000Interactive Swagger documentation is live at: http://127.0.0.1:8000/docs
cd ../frontend
# Install dependencies
npm install
# Start Vite React development server
npm run devAccess the enterprise dashboard at: http://localhost:5173
- Non-Cooperative Pricing Trap: Unilateral incentives to capture short-term order share drive fees down to marginal cost plus baseline margin, confirming a classic Prisoner's Dilemma structure.
-
Collusion Sustainability ($\delta^ \approx 0.42$):* Tacit high-fee pricing (βΉ45) can be sustained indefinitely if both platforms maintain discount factors
$\delta \ge 0.42$ . Below this threshold, immediate defection gains exceed future punishment losses. - Information Asymmetry Shaves Markups: When Swiggy is uncertain about Zomato's routing costs, Swiggy is forced to price conservatively, transferring surplus to price-sensitive consumers.
- Regulatory Incidence: Capping restaurant commissions from 20% to 12% causes platforms to pass through ~65% of the lost margin to consumers via higher delivery fees.
- Merchant Commission Sweet Spot: The revenue-maximizing commission take-rate is ~21%. Above 28%, restaurant margins breach their reservation utility, triggering merchant churn.