Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.33 KB

TOOLS.md

File metadata and controls

57 lines (41 loc) · 1.33 KB

Utility scripts

Several utility scripts are available, which run independently from R2 main application. The scripts read keys/secrets in config.json and call exchange API.

The source code is under tools directory.

getBalance - show JPY, BTC balances of each exchange in csv format

npm run -s getBalance

Example:

Exchange, Currency, Type, Amount
bitFlyer, JPY, Cash, 300000
bitFlyer, BTC, Cash, 1.234
Coincheck, JPY, Cash, 300000
Coincheck, BTC, Cash, 0.123
Coincheck, JPY, Margin, 200000
Coincheck, JPY, Free Margin, 123456
Coincheck, BTC, Leverage Position, 3.456
Quoine, JPY, Margin, 300000
Quoine, JPY, Free Margin, 123456
Quoine, BTC, Leverage Position, 0.01

closeCcPosition - close all leverage positions by market orders in Coincheck

npm run closeCcPosition

closeBfPosition - sell out all cache positions by market orders in bitFlyer

npm run closeBfPosition

closeQuPosition - close all leverage positions by market orders in Quoine

npm run closeQuPosition

clearPairs - clear open pair data in R2 internal database. This doesn't send any orders.

npm run clearPairs

closeAll - execute the three close scripts above, execute clearPairs, then show balances by getBalance.

npm run closeAll