Skip to content

Conversation

pory-gone
Copy link
Contributor

@pory-gone pory-gone commented Sep 16, 2025

Description

adding requested feature in #2502

Added a new "Big Mac Index" ticker to the price carousel that displays how many satoshis are needed to buy a Big Mac;

  • Added 'bigmac' to price carousel rotation
  • Creating a new GraphQL resolver that fetches Big Mac prices from The Economist's official GitHub repository
  • Implemented proper caching (24 hours for Big Mac data, 1 minute for Bitcoin prices)

Screenshots

Istantanea_2025-09-16_10-16-43
489962047-b8a30ca7-dda5-4b4c-baea-01b54b409fe3
489962082-92bc5c3c-93da-4aa9-aac6-eb744b7a4b78

Additional Context

The data is cached for 24 hours since Big Mac prices don't change frequently. The feature includes robust error handling with fallback to the last known Big Mac price ($5.79) if the external data source is unavailable. Used existing cachedFetcher pattern for data fetching

Checklist

Are your changes backward compatible? Please answer below:
yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:
8/10

For frontend changes: Tested on mobile, light and dark mode? Please answer below:
yes

Did you introduce any new environment variables? If so, call them out explicitly here:
NaN

Did you use AI for this? If so, how much did it assist you?
i did use ai just to understand the context and do research about big mac prices

@pory-gone pory-gone marked this pull request as ready for review September 16, 2025 09:24
@ed-kung
Copy link
Contributor

ed-kung commented Sep 16, 2025

TIL the Economist actually maintains a github repository for their Big Mac Index. Nice haha good job.

@pory-gone
Copy link
Contributor Author

Yeah! I was surprised too, but apparently it's true that you can find anything on the internet. Thank you so much!

Copy link
Member

@ekzyis ekzyis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only looked at the source for the big mac prices so far, left a comment. Will look at the rest later this week!

})

const getBigMacPrice = cachedFetcher(async function fetchBigMacPrice () {
const csvUrl = 'https://raw.githubusercontent.com/TheEconomist/big-mac-data/master/output-data/big-mac-raw-index.csv'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good enough for the first version, but I think it would be a lot cooler if the data would update more frequently. It seems to update every 6 months but for some reason, the last update is 2025-01-01, not 2025-07-01 🤔

They documented here how they calculated it.

I think it would be really funny if we would have the most up-to-date big mac prices just to show them in sats, could be good for marketing haha

But as mentioned, more something for a follow-up PR, #2502 is only labeled as good-first-issue anyway.

Copy link
Member

@ekzyis ekzyis Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, I forgot the number we display is going to update frequently because we calculate it in sats anyway. I thought we would just be staring at the same number for a long time.

And I assume Big Mac prices in USD don't update that often, that's why The Economist is also not issuing updates very often.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to find a more frequently updated price source but Big Macs are as stable as gold ahah

if (!price || price < 0 || !bigMacPrice) return null
return (
<AccessibleButton id='bigmac-hint' description='Show satoshis per Big Mac' className={compClassName} onClick={handleClick} variant='link'>
{fixedDecimal(Math.round((bigMacPrice / price) * 100000000), 0)} sats/Big Mac
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe sats/🍔 is better

Copy link
Member

@Soxasora Soxasora Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if it's a Whopper instead? 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can put the whole MC menu :P

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, I like sats/Big Mac more than sats/🍔 😅

@ekzyis ekzyis changed the title new feature, Sats per Big Mac Sats per Big Mac Sep 17, 2025
@ekzyis ekzyis added the feature new product features that weren't there before label Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new product features that weren't there before
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants