Giter VIP home page Giter VIP logo

gemini-api-functions-for-aws's Introduction

The Why

Dollar Cost Averaging to reduce the impact of volatility on large purchases.

Automating your investments to free up your time for better things

Low Fees to keep more of your money

The How

  1. Follow along with this Youtube Video (Thanks @Rhett)
  2. Gather the needed resources here.
  3. Supplement the lambda functions with the ones in the repository. Check back often for updates.

Passing parameters to lambda functions

Instead of creating a lambda function for each different crypto (or price/coin combination) you can create a single Event Bridge Rule and pass parameters to the function.

The required parameters are sandbox, currency and amount. Example:

{
   "sandbox" : false,
   "currency": "BTCUSD",
   "amount": 10
}

or

{
   "sandbox" : false,
   "currency": "ETHUSD",
   "amount": 5
}

An example of all of the currently supported parameters and their applicable default values.

{
   "sandbox" : true,
   "orderFillFactor" : 0.999,
   "currency": "BTCUSD",
   "amount": 0,
   "includeFear" : false,
   "fearFloor" : 20,
   "fearMultiplier" : 1.5,
   "includeGreed" : false,
   "greedCeiling" : 80,
   "greedMultiplier" : 0.5
}

Fear and Greed Index

The Fear and Greed Index analyzes the current sentiment of the Bitcoin market and converts the data into a simple meter from 0 to 100. Zero means "Extreme Fear", while 100 means "Extreme Greed". The index is for BTC only and utilizes 5 metrics.

  • Volatility (25 %)
  • Market Momentum/Volume (25%)
  • Social Media (15%)
  • Surveys (15%) currently paused
  • Dominance (10%)
  • Trends (10%)

Hiding API keys

Instead of pasting your public and private API keys directly into the lambda function they should be stored in the AWS Systems Manager Parameter Store.

  1. Go to the AWS Systems Manager > Parameter Store https://console.aws.amazon.com/systems-manager/parameters/
  2. Click Create parameter
  3. Set the Secret name as GeminiAPISandbox or GeminiAPI
  4. Select Tier: Standard
  5. Select Type: SecureString
  6. Select Data type: text
  7. Enter your Gemini public and private key into the value box as show here

{
  "API key": "account-YourPublicKeyHere",
  "API Secret": "YourPrivateKeyHere"
}
  1. Finally, modify the Lambda function execution role to have an updated IAM Role with access to the SSM keys. This can be done by going to the Lambda function's Configuration > Permissions page, and editing the role to add the AmazonSSMReadOnlyAccess policy.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ssm:Describe*",
                "ssm:Get*",
                "ssm:List*"
            ],
            "Resource": "*"
        }
    ]
}

The Future

Submit an Enhancement Request

Bitcoin Accepted Here

bc1qqyhxl0cjj885t7aqh5fmygxxclg4xketq0suaz

bc1qqyhxl0cjj885t7aqh5fmygxxclg4xketq0suaz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.