Inspiration
In Lagos, trading is powered by information, but not all information leads to profit. With inflation creating large price gaps between physical markets like Mile 12, Oyingbo, and Alaba International Market and online sellers, traders often see attractive prices without accounting for distance, logistics effort, or delivery cost. This often leads to what I call a profit trap: a deal that looks good on paper but fails in practice.
I built Eko Arbitrage Market Agent to help traders avoid this trap by turning scattered market prices into clear, practical insights. The goal was to create an AI agent that reasons through market data the way a real trader would, quickly, contextually, and in familiar language.
What It Does
Eko Arbitrage Market Agent is a Gemini 3–powered market intelligence assistant designed for the Lagos trading ecosystem.
The application:
- Analyzes 1,200+ real market price entries across food staples, electronics, and household goods
- Identifies and ranks profitable arbitrage opportunities between physical markets and online sellers
- Uses the Browser Geolocation API (with user permission) to estimate distance and pickup effort at query time, with graceful fallback when location is unavailable or outside Nigeria
- Responds in both English and Nigerian Pidgin, improving accessibility for everyday traders
- Enables one-tap WhatsApp sharing of verified deals, reflecting how business is actually conducted in Lagos
Users can ask simple questions like “best rice deals” or “which beans deal make sense” and receive concise, ranked recommendations instead of manually comparing prices.
How We Built It
The core reasoning engine is powered by Gemini 3 Flash (preview).
- Data Layer: Market prices are stored in Supabase and provided to the agent as structured context
- Reasoning Layer: Gemini 3 performs multi-step reasoning to interpret user queries, compare prices, calculate profit margins, and summarize results conversationally
- Geolocation Integration: Location data is used as optional contextual input to estimate distance and pickup time, without blocking access when unavailable
- Language Control: The agent adapts output based on a user-selected language toggle (English or Nigerian Pidgin)
- Frontend: A responsive web dashboard displays deal cards and integrates WhatsApp sharing using lightweight deep links
Rather than hard-coding business logic, Gemini 3 is used to reason over structured market data and generate actionable insights.
Profit Calculation
To estimate deal viability, the agent evaluates a simplified profitability model:
$$ P_{\text{true}} = (Price_{\text{online}} - Price_{\text{market}}) - (Distance_{\text{km}} \times Rate_{\text{naira}}) $$
Where the rate is weighted heuristically based on item bulk (e.g., electronics versus 50 kg food bags).
Challenges We Ran Into
- Model configuration: Aligning with supported Gemini 3 preview endpoints required careful API configuration
- Schema grounding: Ensuring Gemini correctly interpreted CSV column meanings was critical to avoiding ambiguous or “undefined” outputs
- Cold-start latency: Initial response delays were reduced through warm-up and caching strategies
- Language handling: Preventing mixed English/Pidgin responses required explicit agent-level rules and output constraints
What We Learned
I learned that large-context models like Gemini 3 are most effective when treated as reasoning layers, not just text generators. Clear schema definitions, explicit instructions, and grounded data dramatically improve accuracy. I also learned that usability, especially language choice and sharing, is just as important as intelligence when building AI for real users.
What’s Next
- Deeper location-aware insights within Lagos
- Historical price trend analysis
- Multimodal inputs such as price-tag or receipt images
- Optional third-party logistics handoff for streamlined pickup
- Expansion to other Nigerian market hubs.

Log in or sign up for Devpost to join the conversation.