lupoyi / ftx-keep-lending Goto Github PK
View Code? Open in Web Editor NEWFTX - lending all available balance(USD/USDT) per hour using crontab
FTX - lending all available balance(USD/USDT) per hour using crontab
Can you add a function that always check the "Estimated Next Funding Rate" of all coins, and the convert to the coin with it higher, every X minutes?
So the function should be disabled by default, and the user can set every when it has to check to find the higher next funding rate.
If it finds an higher funding rate, it should convert the current coin to the coin with higher lending rate, and lend it.
I know that it can be riskier, but user is free to enable or not this function.
I am newbie and would like to use your code, I clone the code to my ubunter server 20.04 and config the parameter as follow:
root@server:~/ftxlending/ftx-keep-lending# cat config.json
{
"FTX_API_KEY": "API",
"FTX_API_SECRET": "API",
"CRON_JOB_AT_MINUTE": 30,
"accounts": [
// {
// "subAccount": "",
// "lendingCoins": [{ "coin": "ETH", "keepBalance": 0, "minimunHourlyRate": 0.000001 }]
// },
{
"subAccount": "LENDING",
"lendingCoins": [
{ "coin": "ETH", "keepBalance": 0, "minimunHourlyRate": 0.000001 },
// { "coin": "XRP", "keepBalance": 0, "minimunHourlyRate": 0.000001 }
]
}
]
}
I run the code and the following error prompt:
root@server:~/ftxlending/ftx-keep-lending# node main.js
/root/ftxlending/ftx-keep-lending/main.js:26
const { free, total } = getBalancesResult?.result?.find((item) => item.coin === coin) || {}
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:1054:16)
at Module._compile (internal/modules/cjs/loader.js:1102:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
root@server:~/ftxlending/ftx-keep-lending#
Would you please help? Thanks.
"2021-03-05T05:30:00.428Z GME getBalance 2.92478723 => 2.92478723 freeBalance 0.00530656
ERROR! 400 { error: 'Size too large', success: false }
Size too large"
Current GME Previous Funding Rate: 199,00% / year
Estimated Next Funding Rate: 199,00% / year
Is this a bug?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.