-
-
Notifications
You must be signed in to change notification settings - Fork 134
Sats per Big Mac #2543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Sats per Big Mac #2543
Conversation
b243d07
to
91e4fe7
Compare
TIL the Economist actually maintains a github repository for their Big Mac Index. Nice haha good job. |
Yeah! I was surprised too, but apparently it's true that you can find anything on the internet. Thank you so much! |
There was a problem hiding this 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' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe sats/🍔
is better
There was a problem hiding this comment.
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? 👀
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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/🍔
😅
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;
'bigmac'
to price carousel rotationGraphQL
resolver that fetches Big Mac prices from The Economist's official GitHub repositoryScreenshots
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 fetchingChecklist
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