Real‑Time Dynamic Pricing in Medusa – Fluctum
Description and use
Fluctum adds dynamic pricing to Medusa for spot‑priced goods, automatically updating prices in real time and locking them at checkout.
Problem
E‑commerce merchants selling spot‑priced goods (gold, silver, etc.) face price mismatches between add‑to‑cart and checkout because market quotes change continuously, leading to losses or unhappy customers.
Outcome
The Fluctum starter demonstrates end‑to‑end dynamic pricing: live price updates via SSE, checkout‑time price locking, and audit‑ready price records, all without custom engine development.
Workflow
- Create a repo from the Fluctum starter template
- Install dependencies with pnpm
- Configure environment variables (copy .env templates, set API keys)
- Start Docker Compose to run PostgreSQL and Redis
- Run Medusa migrations
- Create an admin user and start the backend
- Copy the publishable API key to the storefront .env
- Start the storefront
- Add a product to the cart and observe live SSE price updates
- Proceed to checkout, triggering lockCartPrices
- Complete the order, verifying price lock and validation
Evidence
Fluctum fetches live spot prices on a schedule, streams them to the storefront, and locks the computed price for a cart when checkout begins.
The price stays fixed across these steps – it won’t drift even if the underlying spot price moves in the meantime.
- Record date: 2026-09-08T19:32:03.130Z