ATLAS-YPF
YPF posted the best quarter in its history and the market sold it. This case reconstructs why.

Of the year-on-year EBITDA increase explained by the oil price
Of quarterly EBITDA variation explained by 4 drivers
Earnings releases since 2020 with a negative abnormal return
Context
In Q2 2026 YPF reported its best results ever: adjusted EBITDA of US$ 2,804M (+149% year on year), a 42.7% margin, shale oil at 212.7 thousand barrels a day and net debt at the lowest point of the series. The stock fell 3.6% that same day.
The Challenge
"The market got it wrong" is a comfortable answer that doesn't survive the data. Explaining the price meant combining sources that never come together: SEC financial statements, well-by-well production from Argentina's Energy Secretariat, Brent, country risk, debt, and Vista and Pampa as comparables — without a single number typed in by hand.
My Role
Personal project end to end: framing the question, ingesting 8 public sources, financial and econometric modelling, and all three outputs — the Next.js website, the Power BI dashboard and the Excel workbook.
Approach
A Python pipeline with three separate layers: ingestion (one source per script, never mixed), transformation (every calculation lives there and only there) and export (outputs read, they don't compute). Fourteen invariants check every run: parts must add up to the total, no operator can produce more than the country, the EBITDA bridge must reconcile with the reported change. On top of that: a four-driver EBITDA model, an event study of the market reaction, and a country-risk regression.
Stack — why each technology
Key Decisions
Separate the oil price from management
A record explained by the cycle is valued differently from one explained by the company. The EBITDA bridge breaks down the US$ 1,680M year-on-year increase: US$ 851M is price, volume contributes −2M and cost −28M. The four-driver model (Brent, production, lifting cost and crude processed) explains 91% of quarterly variation since 2022.
Measure the reaction against the pattern, not intuition
An event study of every earnings release since 2020, using a market model estimated over the prior 120 trading days, shows 16 of 22 reports had a negative abnormal return. The Q2 2026 drop (−2.0% abnormal) is normal for YPF: not a rejection of the record, just the usual behaviour.
One pipeline, three outputs
The website, Power BI and Excel all read the same processed data and none of them computes on its own. An analyst, a manager and a general reader see exactly the same numbers, each in the tool they use.
Check that the data isn't impossible
The 14 invariants don't prove a number is right, but they catch when it's impossible: an operator producing more than the country, a territory whose five breakdowns don't match, a bridge that doesn't reconcile with the reported change.
Results
The answer is in the bridge: almost half of the improvement comes from Brent, the one driver the company doesn't control and that can reverse within a quarter. Repeating Q2 2026 EBITDA would take Brent at US$ 106. On top of that sits a structural discount: controlling for Brent, every 100 basis points of country risk takes 3.3% off the stock. YPF trades at 6.7x EV/EBITDA, against 8.1x for Vista and 7.7x for Pampa.
What I Learned
A record number isn't a conclusion: you have to separate what is cycle from what is management. And one source of truth with several outputs beats three hand-built dashboards, because nobody argues about where a figure came from.
A project like this for your organization?
Tell me the problem and we'll work out how to solve it with data.
Next case
ATLAS SENTINEL →