HACKER Q&A
📣 axiosgunnar

What happens on a database level when you sell a stock like $GME?


How do you actually "sell" a stock to somebody?

Does some counter in one database get decreased by 1, and another counter is increased? Surely it must be more sophisticated.

Also, how can two brokers trade securities between each other?

How can you prevent somebody from duplicating a stock like you would duplicate a file?


  👤 giantg2 Accepted Answer ✓
I can't give a really detailed answer, but you can look up Swift messages, Symbiont, FIS, Alladin, and maybe the SEC site for some info.

Internally, a company would be decreasing the number of shares for an individual. They might send the order to a broker or if they are a broker, then to the market. I think Swift messages are part of that communication. They usually are sent to custodial banks. I forget if the broker or custodial bank holds the certificate. Then theres a whole clearing process which takes 2 days. Dark pools and other agents can be involved. I think CFA foundations has details on the whole process.

There's also a similar process for funds. Sometimes the orders don't need to be sent to the market. Basically if fund A is selling a stock and fund B is buying the same stock, then only the net order is sent to the market.

Symbiont is working on blockchain tech to shorten the settle time make the records immutable. Sort of interesting stuff.


👤 CTDOCodebases
Cede & Co is the company that performs the function you are describing. I can’t give you answers on the technical side of things.

This article below will hopefully help you understand things a bit more clearly.

https://www.bloomberg.com/opinion/articles/2015-07-14/banks-...

EDIT: I pasted the wrong link. See below.

https://smithonstocks.com/part-8-illegal-naked-shorting-seri...


👤 gadders
Crest is the UK equivalent if that helps you track down better documentation. https://en.wikipedia.org/wiki/CREST_(securities_depository)