an API server provide some utilities for crypto trade
Putting a predefined password in the header to make a simple auth.
Supported symbol, "ETHUSD", "BTCUSD", "EOSUSD"
In bitcoke, you can use any of above currencies as principal to trade. So the loss and symbol together means the amount of money that you can tolerate to loss. Based on the tolerant loss, we can calculate the stop loss price.
curl -X POST 52.78.92.80:3000/stop-loss \
-H 'Content-Type: application/json' \
-H 'Password: daxiang' \
-d '{
"amount": 200,
"buyPrice": 9670,
"loss": -0.02,
"symbol": "ETHUSD"
}'
-X POST server:port/loss \
-H 'Content-Type: application/json' \
-H 'Password': 'daxiang' \
-d '{
"amount": 200,
"buyPrice": 9670,
"sellPrice": 9900,
"symbol": "ETHUSD"