All Case Studies
RetailPricingOptimization10 min read

Valley Auto Exchange

ML-Powered Dynamic Pricing & Inventory Turn Optimization for a Used-Car Lot

PythonLightGBMXGBoostSeleniumFastAPIReactPostgreSQL

-37%

Days on Lot

58 → 36 days

+$840

Gross Margin per Unit

improvement

-71%

Aged Inventory

90+ day units

01The Challenge

Valley Auto Exchange is a used-car dealership in Harlingen, TX that typically holds 80-120 vehicles on the lot at any time. The owner and lot manager priced vehicles manually using a combination of KBB lookups, gut feel, and whatever the last similar car sold for. This approach led to two recurring problems.

First, mispriced inventory that sat too long. On average, vehicles spent 58 days on the lot before selling — well above the industry target of 30-45 days for independent dealers. Cars priced too high lingered, depreciating daily while consuming floorplan interest. Each day a car sits costs roughly $15-25 in carrying costs. At any given time, 15-20% of the lot was "aged inventory" — units past 90 days that would eventually sell at a loss.

Second, underpriced vehicles that left money on the table. The dealer had no systematic way to identify when a specific vehicle was in high demand regionally. A 2019 Toyota Tacoma in good condition commands a premium in South Texas due to cross-border demand and ranch/farm use — but without market data, the dealer priced it the same as comparable sedans. They also lacked acquisition intelligence, buying at Manheim and ADESA auctions without a model for which vehicles would yield the best margin.

Data Landscape

The data landscape: 3 years of DMS sales data (~1,800 transactions), nightly competitive listings scraped from 4 platforms across the McAllen-Harlingen-Brownsville metro, Manheim Market Report wholesale benchmarks, and seasonal/macroeconomic features including tax refund season and cross-border peso exchange rate.

02Our Approach

We built a three-model system: a LightGBM pricing model that predicts optimal list price from vehicle attributes and local market conditions, a time-decay optimizer that automates markdown strategy per vehicle segment, and an XGBoost acquisition scorer that produces buy sheets before each auction.

  • LightGBM Regressor dynamic pricing model trained on 1,800 historical transactions — predicts optimal list price with confidence intervals using vehicle attributes, local comps, and seasonal indicators
  • XGBoost Classifier acquisition scoring model that predicts whether an auction vehicle will sell within 45 days at 12%+ margin — produces pre-auction buy sheets
  • Selenium + BeautifulSoup nightly competitive scraping pipeline across Cars.com, Autotrader, Facebook Marketplace, and Craigslist for the McAllen-Harlingen-Brownsville metro
  • FastAPI + React lot-manager dashboard serving per-vehicle price recommendations, age alerts, markdown triggers, and auction buy sheets
  • Time-Decay Optimizer automated markdown strategy calibrated per vehicle segment — trucks depreciate more slowly than sedans in this market

Data Ingestion

DMS export + nightly scrape

Feature Engineering

Comps, seasonality, demand

Price Prediction

LightGBM regressor

Markdown Strategy

Time-decay optimizer

Dashboard

FastAPI → React UI

03Key Findings

Days on Lot Distribution: Before vs. After

Distribution of inventory turn times before and after deployment. The 'After' distribution compresses sharply — vehicles now sell within 40 days, with the long tail of 90+ day aged inventory nearly eliminated.

Pricing Model Accuracy (R² = 0.91)

Model-recommended price vs. actual sale price for ~200 recent transactions. Points cluster tightly along the y=x line across all vehicle segments. Trucks (green) are systematically higher-priced — reflecting South Texas cross-border and ranch demand.

Monthly Gross Margin Trend

Average gross margin per vehicle over 24 months. First 12 months (pre-deployment) average $2,100-2,300 with high variance. After go-live, margins climb steadily to stabilize around $3,000 — a +$840/unit improvement.

Time-Decay Pricing: Example Vehicle

Recommended price curve for a 2020 Honda Civic (42k miles) over 90 days on lot. The system applies stepped markdowns at day 21 and day 45, with an overlay of comparable sales average. Trucks follow a slower decay curve in this market.

04Business Impact

Avg. Days on Lot
58 days36 days
-37%
Aged Inventory (90+ days)
18% of lot5.2%
-71%
Gross Margin per Unit
$2,180$3,020
+$840
Annual Floorplan Savings
BaselineReduced
~$18,200

Projected Annual Value

~$18,200 in annual floorplan interest savings, plus an estimated $840 additional margin on each of ~400 annual transactions

The most visible change was inventory velocity. The lot manager no longer has vehicles languishing past 90 days — the time-decay system automatically flags and recommends markdowns before carrying costs erode margin. Aged inventory dropped from 18% to 5.2% of the lot, freeing up floorplan capital for faster-turning vehicles.

The pricing accuracy gain was equally significant. The scatter plot tells the story: the model's recommended prices track actual sale prices with R² = 0.91 across all vehicle segments. The dealer stopped both leaving money on the table (underpriced trucks) and overpricing sedans that would sit for months. The acquisition scoring model transformed auction strategy — the dealer now walks in with a data-driven buy sheet instead of bidding on instinct.

05Technical Details

Dynamic Pricing Model (LightGBM)

  • Features: year, make, model, trim, mileage, condition, local comp count, median comp price, days-on-market for comps, acquisition cost, seasonal flags
  • Target: actual sale price (not list price) to capture real willingness-to-pay
  • Performance: R² = 0.91, MAE = $420 on held-out test set

Time-Decay Optimizer

  • Strategy: initial price (days 1-21), first markdown (day 21-30), aggressive markdown (day 45+), floor price (day 60+)
  • Calibrated per segment — trucks decay slower than sedans in South Texas
  • Automated weekly repricing suggestions (lot manager approves or overrides)

Acquisition Scoring (XGBoost)

  • Predicts sell-within-45-days at 12%+ margin — binary classifier
  • Produces ranked "buy sheet" before each Manheim/ADESA auction
  • Inputs: auction price, vehicle attributes, current local demand signals

Infrastructure (AWS)

  • Scraping: Selenium + BeautifulSoup on Lambda + EventBridge (nightly)
  • Backend: FastAPI serving pricing recommendations via REST
  • Frontend: React dashboard for lot manager with per-vehicle cards
  • Database: PostgreSQL for transaction history and competitive listings

Facing similar challenges?

Let's discuss how data science can drive results for your business.