Inspiration
When we first read the SGX challenge, we started thinking about something pretty simple: what's the point of knowing the market is crashing if you don't know how badly it's going to affect you?
We looked into how sudden market movements can affect leveraged traders, particularly when margin calls come into play. Sometimes, even a relatively small movement can put an entire portfolio at risk.
That's when we came up with the idea of building a weather forecast, but for financial markets.
We wanted something that could spot danger, warn traders before things get worse, and help them understand their options instead of leaving them staring at a bunch of red numbers.
And that's how Coccinelle was born! The name means ladybug in French. An unusual name for a financial platform, maybe, but we liked it.
What it does
Coccinelle is an interactive FX risk-monitoring platform designed to help traders prepare for market volatility.
It brings together several features:
- Storm Monitor: Analyses market movements and generates a risk score from 0 to 100, with warnings ranging from green to red.
- Margin Forecast: Uses Monte Carlo simulations to estimate the probability of a margin breach over the next 24 hours.
- Exposure X-Ray: Shows how vulnerable a simulated portfolio is by tracking leverage, profit and loss, and margin utilisation.
- Protection Lab: Lets users test protective actions, such as reducing or closing positions, and compare their potential effects.
- Judge vs Coccinelle: Compares a human's chosen intervention with a simulated strategy that responds to the first critical warning.
We also built a historical replay system, allowing users to watch market conditions change and see how Coccinelle reacts.
One particularly interesting example comes from the SGX USD/JPY data on 30 July 2026, where our risk engine moves from yellow to amber to red in just two minutes.
We wanted people to actually experience how quickly market conditions can change.
How we built it
We're a team of three, so we divided the project into three main components.
First, we used Python and pandas to process the historical FX data provided by SGX. We then built a market risk engine to analyse price movements, calculate risk scores, and detect warning signals.
For the backend, we used FastAPI, connecting the risk engine to portfolio calculations, Monte Carlo forecasting, and protection simulations. We used WebSockets to send market updates and alerts to the frontend as the replay progresses.
We also included optional AI-generated explanations to make technical warnings easier to understand, while keeping financial calculations and risk checks separate from the language model.
Finally, we built the frontend using React, Vite, Tailwind CSS, and Recharts.
We wanted the interface to feel like a proper financial platform without being boring, so we spent time creating interactive charts, an animated storm radar, visual warning effects, and an interactive Protection Lab.
The goal was to make complicated financial information understandable even to someone without much trading experience.
Challenges we ran into
Honestly, our biggest enemy was time!
We started with loads of ideas, including multiple AI agents, historical crisis comparisons, and simulations of market-wide margin-call cascades.
Eventually, we had to accept that we couldn't build absolutely everything in one hackathon.
Another major challenge was getting our three components to work together. Since we developed the risk engine, backend, and frontend separately, integrating everything involved plenty of debugging.
Processing the historical dataset also took work, and synchronising the replay with live dashboard updates, alerts, and forecasts turned out to be trickier than expected.
We had to deal with things like outdated forecasts appearing after jumping between timestamps and making sure the interface handled missing backend data properly.
There were definitely moments when fixing one thing seemed to break another.
But after quite a lot of testing (and more than a few coffees), we managed to get everything working together.
Accomplishments that we're proud of
Our biggest accomplishment is simply that we turned an ambitious idea into a working, end-to-end prototype.
We managed to:
- Build a functioning risk engine using historical SGX market data.
- Integrate market monitoring with probabilistic margin forecasting.
- Create an interactive dashboard that makes financial risk easier to understand.
- Implement simulated protective actions with deterministic risk checks.
- Build a Judge vs Coccinelle comparison to demonstrate the potential value of earlier intervention.
- Connect our independently developed components and validate them with automated tests.
We're especially proud of the historical replay and storm visualisations.
Watching the risk score rise while the dashboard reacts, then exploring how different decisions affect a portfolio, really brings our original idea to life.
It's one thing to describe the concept. It's another to actually see it working.
What we learned
One of the most interesting things we learned was how much leverage changes the way market risk works.
A price movement that barely affects one trader could be disastrous for another, depending on their portfolio and available margin.
We also learned that forecasting isn't about predicting one exact outcome. It's about exploring possibilities, understanding uncertainty, and communicating risk clearly.
On the technical side, we gained experience working with financial datasets, building asynchronous systems, implementing Monte Carlo simulations, and integrating a full-stack application under serious time pressure.
And perhaps our biggest lesson was learning to prioritise.
We had to stop chasing every new idea and focus on building something that actually worked.
What's next for Coccinelle
There's still plenty we'd love to explore!
We'd like to expand the integrated risk engine to support more currency pairs simultaneously, evaluate our forecasts against additional historical market events, and experiment with more advanced protection strategies.
We'd also be interested in exploring how Coccinelle could integrate with institutional FX infrastructure, potentially making sophisticated risk-monitoring tools more accessible to smaller firms.
For now, Coccinelle uses historical data and simulated portfolios, with no real trading involved.
But we're genuinely happy with what we've achieved in such a short amount of time.
We started with an idea, three people, and a lot of enthusiasm. We ended up with a working platform that combines market analysis, forecasting, and interactive risk management.
Because markets don't come with weather forecasts. Maybe they should. ๐