Warren Buffet will blow up the Nasdaq

No. I’m not a fortune teller.

Nor does it necessarily mean that Warren Buffet is a great genius. Although he probably is.

At least when someone wants to give an example of a great investor when selecting portfolios and stocks Warren Buffet’s name always comes up.

The question is much more earthly.

The news starts like this:

Berkshire Hathaway, the investment group run by Warren Buffett, closed trading Tuesday at $421,420 per share on an uptrend.

So far so good, especially if you own shares of this group. For me, a sliver of a share would be enough to make my day.

And so it goes:

It so happens that Nasdaq computers and other market traders store the stock price as a 32-bit number. The highest possible number in this compact format is 2^32 -1, or 4,294,967,295. However, Nasdaq records the stock price to four decimal places (to the hundredth of a cent), so the largest number it can store is not that, but 429,496.7296. (2^32 – 1) / 10000.

Aaaah! Y2K strikes back!

Remember the Y2K problem?

Computer programs in the 70’s and 80’s represented the year with 2 digits.

More or less what we do now when we type today’s date with 07/05/21. No need to say 2021. We already understand that.

The point is that, following this logic, after 12/31/99 would come 01/01/00. And of course, for a program that compares dates, 00 is less than 99.

Anything could happen.

Anything.

Disordered reports where the 2000 operations would appear first before those of 1999.

Age calculations of people that started to fail: 00-64 means you are -36 years old.

Planes that would land before takeoff.

In critical systems it could be a cataclysm.

And of course, when those programs were created nobody thought that those programs were going to see the turn of the century.

But many of them lasted longer than they were expected to.

So, during the 1990s, the new stuff that was being developed didn’t have that problem anymore.

But a burgeoning industry of consultants emerged to analyze, fix or rewrite systems so that they would continue to work beyond the year 2000.

Let’s go back to our friend Mr. Buffet

Warren for friends.

What has Warren done wrong?

Nothing. On the contrary. He is doing too well.

It has nothing to do with the total value of Berkshire Hathaway. In fact, I’m sure there are other companies whose total value is much higher.

It has to do with the value of the individual shares.

It is on the verge of not being able to be represented within the Nasdaq computer system.

The first thing is that this system must have been in place for years.

For quite a few years now it has been normal to use 64 bits to represent numbers which means 2^64-1 possible values which would be about 4.3 billion out of 4.3 billion values. Wow, that’s a lot.

But in the 80’s and 90’s it was not so normal. Computers were less powerful, with less memory, and you had to economize on memory usage. So if you could represent a number with half the memory then it made sense to save it.

And those who developed this system must have seen a single $430,000 share as unthinkable.

So go ahead with this decision.

But then the problem should be simple to solve, shouldn’t it? Just change all the fields representing the value of a stock from 32 to 64 bits and install the new version in Nasdaq and problem solved.

Problem solved for Nasdaq.

But the explanation says “Nasdaq computers and other market traders”.

Who are the “other market operators”?

Any system that uses this information for its processes. From those that read the stock price to display it to stock traders or websites like finance.yahoo.com to programs that launch buy and sell trades, sometimes with a person trader and sometimes with an automated system of rules.

Any of them could potentially have this limitation as well.

And if tomorrow Nasdaq installs a new version of its software that solves the problem and passes a number larger than the $429,000 to another connected system that is not ready anything can happen.

Most likely that the other system will ignore the bits greater than 32 and keep only the value that exceeds the $429,000 as if it were the value of the stock.

Now imagine that one of these programs has a sell order if the stock value drops below $400,000 and suddenly what comes into that computer is a value of $160. Then the system would perhaps have a rule that would order the immediate sale of the stock for $160 to prevent it from ever being worth $0.

What a deal.

That’s an example, it doesn’t necessarily have to be that way.

The question is how are you sure that this change will not affect external systems that do not depend on you?

Because, most likely, Nasdaq’s programs have already been modified to use 64-bit numbers internally.

Moreover, probably the programs of any exchange operator are also prepared to work with 64-bit numbers. Especially if those traders also work with other exchanges that do not have that restriction.

But what cannot be changed without a lot of testing and verification is the format in which these numbers are exchanged between the different systems.

How to make the change?

One possible idea is to create a new data exchange format with at least 64-bit numbers. Develop both query and update operations using this new format but leave the old format available for those who have not adapted. Wait until everyone uses the new format to turn off the old one.

This is one option.

But any change involving multiple systems must be managed very carefully. Always look for backward compatibility and, when this is not possible, generate a new version and allow time for users of the old version to switch to the new one.

so what now?

In fact, according to finance.yahoo.com, the current value is $430,483.00 per share. In other words: Nasdaq’s systems must have failed by now.

Stay tuned for more news.

More important than the internal design of a computer system is its external design: the interfaces it provides for interacting with others.

Changing your internal design is always in your hand. It may be more or less complicated and more or less expensive, but it is entirely up to you.

But changing an interface is much more complicated. Because it can mortgage you in the long run.

The more successful your business is, the more complicated it will be to make any change.

If you are designing an interface that you are going to offer to third parties let’s talk.

If you are Nasdaq pass me the data and I will send you the invoice.