Need to build a trading game on prices going up or down. PROs ONLY!

Job ID: 35909166

Budget: $750 – $1,500 USD

Hi,

Only pros can apply. NO spam!
Paying you a fee AND after, a long term share in revenue (to incentivize you to do the job well).

We build a simple trading game to bet on the price of cryptocurrencies going up/down.
Needs to offer 1-1000x multipliers (if you can do 3000x too, even better).
Your code will be audited by multiple pros after.
Take this seriously.

Reply with a CLEAR explanation of your understanding of the project, preferably with examples of why you can and will do the job.

Generic bids = ignored.

-----------

TRADING PRICE FORMULATION

Index Prices

To provide fair/reliable pricing for the trading games, we need a composite index price every 500 milliseconds that is derived from real-time price feeds to the world's most liquid spot/derivative crypto exchanges. With many price sources, the index is robust to manipulation, tech issues, and other odd trading activity that may occur on individual exchanges.

INDEX CONSTITUENTS

Spot Exchanges:
Binance
Coinbase Pro
Kraken
Huobi
OKEx

Derivative Exchanges:
Binance (Coin-Margin)
Binance (USDT-Margin)
Huobi (Coin-Margin)
Huobi (USDT-Margin)
OKEx (Coin-Margin)
OKEx (USDT-Margin)

The index price methodology is designed to satisfy two important statistical properties of time series: the Markov and martingale properties. The Markov property refers to the memoryless nature of a stochastic process, which ensures that the conditional probability distribution of future values only depends on the current value. The martingale property implies that the current value of a stochastic process is also the expected value of future values. These 2 properties make index prices unbiased estimators of future prices, so that users can bet on the changes in value of the underlying cryptocurrencies without having to worry about the microstructure effects of individual exchanges.

Calculation steps:
1. Subscribe to as many levels of depth as available using each exchange's streaming APIs.
2. Remove any price feeds for which there have been no market data updates for the last 30 seconds.
3. Remove any price feeds with crossed buy and sell prices or whose top-of-book mid-price is more than 10% away from the median top-of-book mid-price across all price feeds.
4. Wait until there are at least 6 valid price feeds. If there are not enough price feeds, the trading index price will not be updated.
5. Combine resting limit orders from each price feed into a single composite order book. It is okay and expected that the price of some buy orders will exceed the price of some sell orders from other exchanges. Individual order sizes are capped to $1 million to limit influence of a single large order.
6. Using the composite order book, a function is defined to represent the marginal price to buy or sell a given amount.

I.e, the marginal buying function is:

P_buy(s) = max{p_i | sum_{i in 1..N}{s_i} <= s}}

where p_i | (i in (1).N) and s_i | (i in (1).N) are the buy prices and sizes sorted in increasing distance from the top-of-book. This function gives the maximum price one would pay to buy an amount s.

7. The marginal buy and sell price functions are then used to define a marginal mid-price function given a size:

P_mid(s) = (P_buy(s) + P_sell(s)) / 2

8.
Final index price is then calculated as the weighted average of the marginal mid-prices at each size. The weights are chosen to be the probability density of the exponential distribution, which is monotonically decreasing, resulting in a higher emphasis on prices closer to the top-of-book.

How weights are given:

w_i = L * exp(-L * v_i)

where v_i are the sizes at which the mid-prices are calculated and are defined as the union of the cumulative buy and sell sizes from the composite order book. L is a scaling factor defined as 1 / V, where V is the maximum size at which a mid-price is calculated and is defined as the minimum of the sum of buying and selling sizes in the order book.

The output of this calculation is a single index price.