advertisement
How to Exploit Brainless Selling Bots with a High-Frequency Strategy in 80 Lines of Code
Observation of opportunities
Recently, I discovered that Binance has a STORJ currency exchange. It is very strange unintentionally when I was observing the market, the trading volume is very large and the trading frequency is very fast. On the minute-specific K-line in the chart below, we can see that the trading volume of each minute is consistent and the minute-specific K-line can be seen as a long lower shadow line.
Observe with Binance the 1 second K line, I discovered the end of the story, someone trades 10,000 to 20,000 STORJ every 5 to 7 seconds, regardless of the cost, and opens a small hole in the K line directly, while the price recovers in the short term. This operation was obviously caused by a robot in charge of an iceberg. This short trade lasted a long time, reaching an estimated level of $10 million and in many cases causing slippage of up to 0.1%, meaning that the executor of this strategy lost tens of thousands of dollars in slippage on the trade alone. But with such a mechanical operation and active trading, there was a clear opportunity for speculation by market makers.
A simple change to the original HF spot strategy, and within minutes I had this robot that specializes in exploiting this stupid iceberg commission selling.
strategy idea
Since the market sells at market price every few seconds, we only need to find the 10k depth in the buy order book and hang the order in front of it. So when the iceberg is sold, there is a high probability that the market maker robot can receive it, and at this time the transaction is very active, the momentary price drop also triggered some buy orders. Similarly, pending sell orders can be included in the trend, thus repeating trades. The transaction frequency is very high, even if the throughput is not great each time, the total throughput is also quite substantial. Of course, the premise of everything is to have an account with low fees, if the buying and selling fees are both 0.1%, then the space is not enough to pay the fees.
Strategy performance
The strategy works like this: at first, none of the profits were printed, so I changed it this afternoon and printed the profits; the crazy selling robots changed the volume to about 5000 at a time, so the optimal time for arbitrage is already past. At first you will probably be earning between 100 and 200 U per hour, the key is that it is risk-free and low cost. On the other hand, iceberg commission actually has a lot of skills, if you know how to write a strategy, you can spend ten minutes on FMZ to write the iceberg commission strategy that looks at the depth of the buy order to decide the order size and price, looks at the size of the active buy order to adjust the size of the pending order, and takes on market tracking and other features, easily saving tens of thousands of dollars.
Strategy source code
The strategy code is very simple, only 80 lines, which is suitable for beginners, here are some of the parameters, such as order precision, etc., fixedly written in the program, you can change the parameters as follows. It is recommended to save it, in case there are any trading pairs or the traders are out of control, you can charge them some interest at any time.
function CancelPendingOrders() {
var orders = _C(exchange.GetOrders)
for (var j = 0; j < orders.length; j++) {
exchange.CancelOrder(orders[j].Id, orders[j])
}
}
function output(){
CancelPendingOrders()
}
function GetPrice(Type, Depth) {
var sumQuantity = 0
var checkAmount = Type == "Buy"? CheckAmountBuy: CheckAmountSell
var deep = Type == "Buy"? Depth.Offers: Depth.Questions
for(var i = 0; i < Math.min(20, depth.length); i++) {
if(Type == "Buy" && deep[i].Price == lastBuyPrice && buyId){
sumAmount += deep[i].Amount - importBuy //Subtract your own pending orders here
}yes no
advertisement
Related Articles
advertisement