What better way to avoid paying during the token contract settlement?

Author: The bone knife, Created: 2021-03-29 11:06:06, Updated:

I'm using it now in my rounds.

var now = new Date().getTime(); if(now%28800000 > 28790000 || now%28800000 < 300000) { Sleep(300000); }

I'm not going to lie to you. I feel that this method is stupid, and the strategy rotates 2-5 times per second during the process of running, how many times a day to execute these two lines of code in blank for these 3 settlements is a waste.

The official document of the token says: It is recommended that you retrieve the contract information every few seconds at the settlement time point: linear-swap-api/v1/swap_contract_info, when the return message returns contract_status returns a status code of 5, 6, 7, 8, and 1 in the settlement, when contract_status returns a status code of 1, the settlement is complete.

I'm going to call the interface every time I turn around, is it less efficient? So please come here and tell me if there is a better way.


More

The grassGetLastError Returns to 1056 In the wrong string, rest for a while and continues

The bone knifeUnderstood, thank you!

The grassIf you are not able to do it, you can make mistakes, reporting this error is a sign that the order was not successful.

The bone knifeBut my strategy is that if you don't pay the bill at the time of the settlement, you don't make a mistake, but you don't make a mistake.