A cryptocurrency trading bot to help you implement dollar-cost averaging (DCA) investment strategy automatically in FTX Pro exchange.
This bot allows you to configure your portfolio and place limit buy orders to purchase crypto periodically in FTX Pro. It is similar to Auto-Invest Plan in Binance or 極速定投 in Pionex but with less fees.
Node v14+
npm install
You can use this project by following two different ways:
- run it manually once if you want.
- run it automatically at a recurring cycle on how often you want to buy crypto by deploying a cron-like serverless service on AWS.
-
create
.env
in root folder and configure your FTX api secrets.Warning: do not commit your secrets in .env to git
API_KEY=YOUR_FTX_API_KEY API_SECRET=YOUR_FTX_API_SECRET
-
configure portfolio and order parameters in
parameters.js
.- set crypto symbol and percentage you want to buy.
- set how much you want to buy and stablecoin symbol that your preferred for payment.
check out that file for more details.
-
start the bot
npm start
the bot will start placing orders but only one time.
This project will deploy a cron-like serverless service running on AWS Lambda & EventBridge using Serverless Framework. The event scheduler created on AWS EventBridge will trigger our investment function which running on AWS Lambda at specific time or in specific intervals you configured.
-
configure your FTX api secrets in Serverless Dashboard parameters.
-
configure order parameters in
parameters.js
. -
create event scheduler in
serverless.yml
which is used for configuring functions to be executed at specific time or in specific intervals.example:
events: - schedule: rate: cron(0 0 ? * SAT *) # Invoke Lambda function every Saturday at 00:00:00 GMT enabled: true # set to false then re-deploy if you want to pause the bot
Detailed information about cron expressions is available in official AWS docs.
-
Deployment
npm run deploy
That’s it! Our investment function is running on a schedule, it will automatically be trigger at next scheduled time. You can also check out next 10 scheduled time on AWS EventBridge Admin.
-
How to update order parameters after deploy?
update
parameters.js
then runnpm run deploy
to redeploy. -
How to update FTX secretes?
update it on serverless dashboard then redeploy.
-
How to pause service on AWS?
disable event scheduler by switching
enabled
flag tofalse
inserverless.yml
then redeploy. -
How to remove service/stop bot on AWS?
npm run remove
No Investment Advice & Do Your Own Research
https://www.serverless.com/framework/docs
https://www.serverless.com/examples/aws-node-scheduled-cron
https://www.serverless.com/blog/cron-jobs-on-aws
https://eqolot.com/technologie/blog/running-cron-jobs-on-aws-lambda-with-scheduled-events