Looking for a TEAM PLAYER! I want to find a few people to constantly develop and implement projects in Crypto and earn together. This technical specification is a trial so that we can see each other and understand if we can work together / realize that we are not suitable for each other. IF your GOAL is to earn once - this is NOT for you. I am looking for long-term cooperation.
Task: implementation of the fastest calculation and opening of an order on the ByBit exchange
Data preparation
We parse all tokens on the ByBit exchange (spot / futures, separately), the list is updated every 5 minutes by cron.
We connect via socket to each coin and collect ticks (order book changes) and trades in real-time.
We send all this to Victoria Metrics, data up to 5 minutes - stored in RAM
Separately for spot, separately for futures we collect the current order book independently by ticks
Data calculation for the trade
We calculate the price change dynamics by VOLUME.
For this, we take the average price for asks (for opening a long) in equivalent volumes:
1,000$, 5,000$ (step in the form of an array to be set in the settings)
We compare with the average value of trades over the last 60 and 300 seconds
We compare with the average value of asks (for the same volume) from the order book history.
As a result, we get an array [price_difference_60s]
1000$ - 5.86%
5000$ - 6.12%
We check if at a volume of 1000$ the delta in price is less than 10% (PRICE_CHANGE_DELTA_60S = 10), then we continue the logic/purchase.
Calculation of slippage data to determine size.
Using the specified constant (MAX_SLIPPAGE_PERCENT = 5) we add asks line by line until we reach the required limit of >5%
We multiply volume by price in the order book to calculate the available volume in the order book considering the maximum slippage.
We use the variable from the config (MAX_POSITION_SIZE_IN_USD = 10000) for the final size calculation. For example, in the order book, the available volume at ask is 8500$ with slippage <5%, so this is our position size of 8500$, if the available volume >10000$, then our position size will be 10,000$ (taken from MAX_POSITION_SIZE_IN_USD)
Opening a trade
We send limit orders via websocket and through the REST API at ask prices +5% to the price (taken from MAX_SLIPPAGE_PERCENT) and the IOC (immediate or cancel) parameter.
Along with the order, a stop loss/take profit is set at 33% of the size for growth +10%, +20%, +30%
The stop loss is set at -10% from the first ask in the order book.
Pass order orderLinkId and "smpType": "CancelTaker" for the correct operation of the script when running in parallel on multiple servers.
It is important to think through the reconnection, retries, logs, and alerts system
Warm_up_mode, send a "fake" order to the exchange every 30 seconds to maintain activity.
JA3 fingerprint generation system