P2P virtual stock market launches on PolyCash

Joey Rich
PolyCash
Published in
5 min readAug 31, 2019

Buy and sell tech stocks in this decentralized trading game

PolyCash developers have recently published an exciting new module to our open source codebase. Virtual Stock Market is a decentralized stock market where traders can buy and sell the stocks of 12 of the most well-known American tech companies. Virtual Stock Market uses a digital currency called dollars with an abbreviation USDF, and a supply of 1 billion fake dollars. USDF are not backed by any financial assets and you can get $100k to play around with just for signing up. While this game uses fake dollars with no tangible value, PolyCash is designed for stablecoins backed by dollars (or other currencies) and with the support of investors, this technology can be used to launch real money stock markets.

How it Works: PolyCash

PolyCash is a virtualization layer for the blockchain and is an implementation of the “colored coins” concept. Like ERC-20, PolyCash is a protocol for second layer crypto assets. PolyCash makes it easy to create a new digital currency on top of Bitcoin, Litecoin and other UTXO based blockchains. In PolyCash-protocol crypto assets, the blockchain underlying each asset supplies all immutable transaction data relevant to that asset.

But crypto assets also rely on parameters which are not included in the underlying blockchain. These parameters are represented in the “game definition” a JSON format text document which includes all protocol-level information defining the crypto asset. Nodes that agree on a game definition are guaranteed to be in consensus for a particular crypto asset. Any differences in the game definition between nodes represents a fork of the asset. While simple crypto assets may use a game definition which never changes, more advanced crypto assets like prediction markets have frequent changes to the game definition. These changes propagate to all nodes running the asset to avoid forks.

PolyCash supports two types of financial instruments: binary options (which pay out either at zero or at the payout amount) and synthetic assets (which pay out anywhere between 0% and 100% of the maximum possible payout).

How it Works: Virtual Stock Market

The Virtual Stock Market uses our synthetic assets functionality to enable contracts which track the value of AMZN, AAPL, FB, GOOG, HP, IBM, INTC, MSFT, NFLX, CRM, TWTR and UBER. To understand how it works, take a look at this example market for Microsoft (NASDAQ:MSFT):

An example market for buying & selling synthetic Microsoft shares

This market issues contracts which track MSFT between $120 and $150 for a period of approximately one week.

Virtual Stock Market runs on one of our custom blockchains called “StakeChain.” In this market, synthetic MSFT contracts could be purchased between blocks 428201 and 429400 which means that this market was open between 2019–08–29 02:08:02 UTC and 2019–08–29 13:08:18 UTC (about 11 hours).

In total $451,180 was spent on this market which is equivalent to approximately 15,039 two-sided contracts at $30 per contract. When the market closed, buyers were locked in at price of $16.38 for their side of each contract while short sellers were locked in at a price of $13.62.

The payout block for this market is #448360 which will be mined around September 5, 2019. At that time, the real-world price of Microsoft shares will be written into the game definition, and all of the UTXOs associated with long and short shares of MSFT will be paid out in the correct amount.

These synthetic shares of MSFT only track the price of MSFT between $120 and $150. If the price of MSFT is above $150 on September 5th, long contracts will pay out at the maximum of $30 and short contracts will pay out at $0. Or if the price is below $120, short contracts will pay out at $30 and long shares will pay out at $0.

To demonstrate how contracts works, let’s take a look at a UTXO for buying MSFT in our example market.

Example showing a UTXO for buying MSFT

In this example, the trader spent $9,150.6 to buy 558.7 contracts representing 558.7 synthetic shares of MSFT. This position is equivalent to 558.7 shares of MSFT plus a debt of $67,044. All long and short contracts have a leverage determined by the upper and lower prices tracked by the market.

In this paradigm, leverage is the ratio between the current value of the contracts compared to the current value of the tracked asset (MSFT). As this image shows, the trader’s leverage has changed from 8.3267X at the time the market was closed for buying to a leverage of 7.85X based on the current price of MSFT. Although the price of MSFT has only increased 0.84% from $136.37 to $137.51, the trader’s contracts have gone up in value by 6.96% due to leverage.

PolyCash synthetic assets work using fully decentralized software and allow people & corporations to hold positions in nearly anything, within the limits of a fixed price range and for a fixed period of time. Holding positions permanently can be achieved by purchasing new synthetic assets whenever assets are resolved and paid out. This design requires all long positions to be matched by short positions and relies on stablecoins backed by dollars or other financial assets. This design inherits the security and decentralization benefits of cryptocurrencies and has the potential to provide financial services with extremely low fees and friction.

Try it out by signing up for Virtual Stock Market on PolyCash, claiming $100k in fake dollars and then purchasing your favorite tech stocks. Or download PolyCash from github and install it on your own computer. We are always looking for strategic partnerships so please feel free to get in touch by email via joeyfrich@gmail.com if you’re interested in learning more.

--

--