https://github.com/sscarduzio/cryptolambda
Periodically buy cryptocurrencies (Dollar Cost Average) in BitStamp using AWS Lambda scheduled events
https://github.com/sscarduzio/cryptolambda
aws-lambda bitcoin bitstamp cryptocurrency dollar-cost-averaging ethereum investing kms serverless serverless-framework trading-bot
Last synced: 5 months ago
JSON representation
Periodically buy cryptocurrencies (Dollar Cost Average) in BitStamp using AWS Lambda scheduled events
- Host: GitHub
- URL: https://github.com/sscarduzio/cryptolambda
- Owner: sscarduzio
- License: gpl-3.0
- Created: 2017-09-12T20:37:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-12T20:47:53.000Z (over 8 years ago)
- Last Synced: 2025-02-07T15:08:00.266Z (about 1 year ago)
- Topics: aws-lambda, bitcoin, bitstamp, cryptocurrency, dollar-cost-averaging, ethereum, investing, kms, serverless, serverless-framework, trading-bot
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 22
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://twitter.com/s_scarduzio)
# CryptoLambda
This is a Serverless app (for AWS Lambda) that runs periodically every day and buys ETH and BTC from bitstamp.
The credentials are encrypted using AWS Key Management Service (KMS).
## Credentials encryption
We will use the encryption/decryption API of AWS KMS to generate a file containing the encrypted version of our Bitstamp credentials.
After you [installed Serverless framework](https://serverless.com/framework/docs/providers/aws/guide/installation/), and cloned the project, proceed with the following steps.
1. You need to create a KMS key in AWS console (look under IAM)
2. Copy the KMS key ARN identifier (something like: `arn:aws:kms:eu-west-1:123456789012:key/xxxxxxxxxxx-xxxx-xxxxxxxxxxxx`)
3. Copy the ARN in `serverless.yml`
4. Create a string with your Bitstamp API credentials, in this form: `client_id,key,secret`
5. Encrypt the string using aws command line, or this simple npm based tool called [kms-cli](https://github.com/ddffx/kms-cli)
6. Dump the encrypted string to a file called `encrypted-secret` in the main dir
7. Configure the amounts to buy daily and your base FIAT currency in the serverless.yml
8. Everything is ready, `serverless deploy -v`
You can now test the lambda function from AWS Console, if it all works, tonight at midnight you'll have some crypto in your Bitstamp balance :)