Real-Time Demand Responsive Pricing: How Swvl Optimizes Revenue Stream in a Dynamic Marketplace

How Swvl optimizes its revenue stream using Real Time Demand Responsive Pricing


A Brief History of Dynamic Pricing

For the vast majority of transactional history, pricing was always considered dynamic; something to be negotiated between the buyer and the seller. It was dependent on a variety of observable and unobservable factors including not only the availability of stock and expected demand but also the shopkeeper’s evaluation of the customer’s propensity to pay. Faced with a customer who looked like they could pay more than the last, a smart shopkeeper would increase the price for each transaction in real-time. These principles of haggling still dominate street markets across the world today but they make the process arbitrary, inefficient, and time-consuming.

With the industrial revolution, goods and services started moving to the price-tag model to standardize transactions. A predetermined, single price eliminated information asymmetry, guaranteed equitability, and allowed retailers to conduct transactions quickly, and at scale. This system was the market standard for well over a century, but retailers are now realizing that efficiency comes with a tradeoff with profitability.

Simple transaction with a fixed price tag.

The first industry to reintroduce dynamic pricing was the Commercial Airline Industry. With extensive research and technical innovations, variables like departure time, destination, time of day, and season could be factored into the eventual price a potential consumer would pay at any given instance, making continuous price adjustment costless. In many ways, the new system is similar to early models of dynamic pricing but there is a fundamental difference. It is no longer a single person sitting behind a desk setting prices based on a gut feeling. These price changes are determined and automated by sophisticated algorithms that can monitor thousands of, previously unobservable, tangible factors and their complex relationship with demand to come up with a price that optimizes what a seller is willing to sell for, and the maximum a customer might pay for it.

The initial success of the airline industry made dynamic pricing spread to other industries like wildfire. At Swvl, we have had the fortune of being able to learn from the strategies others in our domain have used. Two dynamic pricing models that have had notable success are Uber’s Surge Pricing and the Airline Industry’s ESMR model.

Uber’s Surge Pricing

Uber’s innovative surge pricing model allows them to automatically raise their prices whenever demand exceeds supply in a given area. This increase in prices enables two changes: it reduces demand by disincentivizing it and increases supply by incentivizing more drivers to move to the area. This allows Uber to maintain reliability, driver availability and brings their network back into equilibrium almost instantaneously.

Uber’s Surge Pricing, showing the demand and supply shifts.

The Airline Industry’s Expected Marginal Seat Revenue (EMSR)

The EMSR for a seat s is the price multiplied by the probability of selling an additional seat. More simply, EMSR(s) is the expected value of the seat in question. This expected value is used as the cornerstone to allocate a certain number of available seats to a specific price tariff, with the overall goal of maximizing revenue and improving the feasibility of making necessary shifts between different price tariffs.

The concept can be illustrated with an oversimplified example. Assume you have two different price tariffs, a high P_h and a low P_l, and limited capacity C=100 In this setting, we want to come up with an optimal number of seats Q and protect them for P_h. Given the knowledge of each demand function at different price points, the probability of selling one more seat at any given point can be derived, helping us calculate EMSR(s).

EMSR for reserving a certain number of seats for a higher price class.

The observed Qshould satisfy the condition that the expected value of the last seat sold at P_h is equal(or marginally different) to the expected value for the remaining seats at P_l. Then 100-Q seats can be offered at P_l while protecting Q seats for P_h.

Swvl’s Pricing Framework

Swvl is a technology-driven solution to public transportation committed to enabling mobility within and across cities, by combining the convenience of a hop-on-hop-off service with the reliability of a confirmed seat. Operating with a high-quality fleet, and a constantly growing network of fixed and dynamic routes, we use algorithms to take people where they need to go — quickly, safely, reliably, and comfortably.

The base price for each trip is determined by a proprietary model which accounts for several factors including but not limited to; distance, time, vehicle type, service segment, area demand, and operational frequency. What it achieves is the standardization of price in correspondence with the level of service provided i.e. standardizing the value of a trip from point A to point B at 3.00 pm in a premium vehicle from a station that is a three-minute walk from your current location and many more distinct characteristics.

Standardization of Swvl service level prices.

Despite the sophistication of our base pricing model and continuous improvements to provide our customers with the most fair price for our service, we needed another layer of dynamic pricing to further optimize our revenue stream at a network level. This is because while the service level is standardized, each customer is unique, with a different set of preferences, and hence a different willingness to pay for each level of service, regardless of standardization. Our Real-Time Demand Responsive Pricing model was developed to improve our business model and fill precisely this need.

Real-Time Demand Responsive Pricing

While Real-Time Demand Responsive Pricing is highly relevant to our business model, the uniqueness of our operations prevented us from adapting existing out-of-box solutions to dynamic pricing. Among other concerns, two factors to consider are:

  • The design of our network prevents us from shifting our supply as easily and quickly as Uber’s surge pricing does
  • Our hop-on, hop-off service means that for any given ride, there are many possible trips with distinct origin-destination combinations. With the very limited time available between dispatch to ride, the price classes and corresponding probabilities of each trip are nearly impossible to map. This diminishes the success of any variant of ESMR applications

However, the heuristic approach of ESMR and the network balancing approach of surge pricing provided a crucial starting point we could leverage in developing our own dynamic pricing model suited for our business model. Using these as a baseline, we then restructured our thinking to adapt it for stochastic demand/cost functions and follow a more Bayesian Framework.

To discuss the model, let’s briefly look at all the constraints and variables that need to be considered and optimized.

Customers getting optimized prices at different times.

The Key Components

In order to build our framework, we consider the following factors:

  • The price for a given booking is a constant P.
  • The capacity of the vehicle is fixed and equal to C.
  • There is a limited time interval [0,τ]where you have control over price
  • There are κ discrete points in your timeline where you will exercise your control over the price.
  • i is the index of step where we can take an action and i=1,2,...,κ
  • There will be an arbitrary yet dense enough set of available price multipliers over domain [m_l, m_h].
  • P_i is the price at step i and satisfies P_i[m_l.P, m_h.P].
  • U_i is the observed utilization of the subject vehicle at step i and satisfies U_i[0, 1].
  • F_i is the predicted utilization of the vehicle at step i= κ, i.e. predicted final utilization, also satisfies F_i[0, 1]. More formally, it is the function F_i(U_i, t_i, <I_i>), where <I_i>is the information vector a ride carries at step i, is a direct input of F_i prediction model.

The Logic

Given the constraints of our operations, our objective is to apply a different set of pricing multipliers to our base price for each time interval between dispatch and ride, such that the predicted revenue after the application of the multiplier can be increased. While the multiplier can affect revenue in many ways, the framework is designed such that multipliers are only applied when the probability of affecting the revenue in the following two ways is optimized:

  • A decrease in price corresponds to a sufficient increase in demand translating to an increase in overall revenue despite lower price per seat
  • An increase in price corresponds to a small or negligible decrease in demand translating to more revenue per seat without the risk of customer churn due to higher prices

Formally speaking, the logic can be described as follows:

Apply P_i which is equal to P.m_i after every Δt interval change (or on t_i), where Δt= τ / κ and i=1,...,κ

At this step, the model to predict F_i steps in. It is a combination of exploiting the historical data given a ride’s characteristics and a probabilistic approach to be able to consider all possibilities. Statistically speaking, this output can be considered the expected-predicted value of F_i and by definition tends to minimize our error margin at the network level.

Having an approximation of F_i helps us reduce our formula of predicted additional revenue(from t_i to t_κ) to:

R_i(U_i, t_i, <I_i>) = (F_i(U_i, t_i, <I_i>)- U_i) . C . P . m_i

for every i=1,...,κ.

So, an oversimplified justification of any decision we make regarding the price is:

sgn(P_i — P_{i-1}) = sgn( (P_{i-1} — P_{i-2})(R_{i-1}-R_{i-2}))

I.e. if increasing the price increases our revenue, the price can be increased again; else it will be decreased. If decreasing the price increases our revenue, the price can be decreased again; else it will be increased.

By the power of the intuition expressed above, and by our heuristic approach, ideally, we can roam [m_l, m_h]. With this baseline in place, we added one additional layer of abstraction to constrain our roaming function

One pillar of this extra layer of this abstraction is mapping n mutually exclusive zones of [m_l, m_h] to n distinct zones of U_i[0, 1], such that whenever we expect a high revenue we make some multipliers unfeasible unless our revenue expectation does not go south. The other is to map the outcome of sgn(P_i — P_{i-1}) to 0 in predefined i zones given our n previous actions, i.e. we wait for our judgment to mature by giving it enough time. Last but not least is rejecting the intuition given bysgn(P_i — P_{i-1}) around m_l and m_h. This is more of a technical limitation of the setup but it is worth mentioning as it is one of the reasons we cannot generalize the sgn(P_i — P_{i-1}) equation.

This layer of abstraction helped fine-tune our roaming function and provided greater stability, helped us avoid cannibalizing our revenue stream, and more aggressively optimize it to further balance the marketplace health and customer experience.


A 9% uptick in revenue due to Real Time Demand Responsive Pricing.

The new framework was extensively A/B tested across various control and treatment groups. Our results showed that groups seeing responsive prices were not only yielding a 9% uptick in overall revenue but also had more stable and predictable returns across the network. This gave us the confidence to scale up the framework for larger groups of users.

Distribution of Treatment/Control rides, in terms of GMV per every 1000 seats available in the network.

Onwards and Upwards

Once the earlier versions of our dynamic pricing framework were ready, we started to finetune the multitude of its moving parts by testing and experimenting with various hypotheses. With each iteration, we gradually improved our setup, and happily revised many of our underlying assumptions. To date, the model has been tested in a variety of different cities, countries, and categories, and it has had demonstrable success in each market. Our gradual experimentation and roll-out hit maximum coverage almost one year ago, and the framework has become an indispensable part of our business ever since.

We knew from the beginning that the success of this model would help us balance our marketplace by minimizing excess demand (due to customers who value our product differently) and maximize the utilization of our network. However, an unexpected effect of Real-Time Demand Responsive Pricing has been the correction of our base price whenever there was a mismatch between the expectation of our customers and our provision. These alone provided us with key competitive advantages that irreversibly boosted our growth.

Despite these groundbreaking developments, to this day the task of deciding the “correct” price remains ambiguous. While there is constant scope for evolution, at Swvl we believe one thing is certain — any attempt to price must involve relying on data to understand demand and supply patterns, responding to real-time changes and challenges, constantly experimenting, and most importantly, staying true to our customer-first approach.

If what we are building excites you, get on board!


Project Ideation & Development: Mert Ates

Authors: Mert Ates & Mehr Javed

Creatives: Hazem El Samra, Mostafa & Omar



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store