Three Months of a Small Site (1): Why Build a Premium Tracker
Next: More Than One Clock | 中文版:为什么要做一个看溢价的小站
It started with buying a fund.
The fund invested in overseas markets but traded on a domestic exchange. It had been doing well, so I bought a little. The next day the official value came out, and I realised I had overpaid: the exchange price was noticeably higher than what the fund was actually worth. That gap is called the premium. When the premium is high, you are paying a hundred to get something worth ninety-something.
The trouble is that the official value is published only the next day, while the exchange price changes every second. When you place the order, you have no idea what the fund “should” be worth.
First, a spreadsheet
The first attempt was simple: a spreadsheet. The quarterly report lists the fund’s holdings. Copy down the top ten, look up each stock’s latest price, multiply by its weight, apply the exchange rate, and you get a rough live estimate of the fund’s value. Put that next to the exchange price and the premium is plain to see.
One fund was fine. Two, five, a dozen, and the spreadsheet got heavier and heavier. Overseas prices had to be looked up by hand, exchange rates typed in, holdings copied again every quarter. More than once, by the time I finished a round, the market had already moved.
So the obvious thought: could a machine do this for me?
Then, a web page
The first version was a single page: a list of funds, one row each, showing the exchange price, the estimated value and the premium, sorted by premium. Jobs in the background fetched prices on a schedule and did the arithmetic, so the page was ready the moment you opened it.
One rule was set on day one: opening a page never fetches data. All fetching and calculation happen in the background on a timer; pages only read results that are already worked out. That keeps pages fast, and it means more visitors never turns into more knocking on the data sources’ doors.
A phone app came later, for a simple reason: the premium is something you remember to check on the commute or between meetings.
What grew in three months
I started in May; it has been about three months. The site grew from one table into a few more things:
- A watchlist, to see only the funds you care about;
- Alerts, a notification on your phone when a premium crosses a line you set;
- A portfolio, to note what you hold and see how its value moves;
- Sign-in, so the watchlist and portfolio stay in sync between the web and the phone.
None of these is complicated, but together they turn “a tool for myself” into “a site other people use”. Once other people use it, everything weighs more: a wrong number misleads someone, an outage gets questions, and lost data is really lost.
This series
This series isn’t about code. It is about some choices made over these three months, and the holes I fell into:
- Why build a premium tracker (this post)
- More than one clock: the trouble with many markets and many time zones
- Red for up, or green for up?: small details in the interface
- Moving house, and a two-month-old backup: a standby is not a backup
- One letter, two return addresses: debugging a sign-in
Each post has a Chinese version, starting here.
Comments