Receive price updates directly to your Discord Server by installing the bot and running /sol
command.
SolanaIndexDiscord.mov
Powered by Pyth
(Website | Github) on-chain price feeds, Solana Index Discord is an index of popular Solana DeFi Tokens, benchmarked to units of SOL.
This is ready to deploy as is, but if you want to build on top of it here is how you set up the environment.
If you are looking for examples of working with pyth-client-py
you can find that code here.
sol-idx/
├── bin/
│ └── (Typescript Init AWS CDK)
│
├── lambda/
│ ├── index.py (Lambda Handler)
│ └── utils
│ ├── discord/
│ │ └── (Python logic)
│ ├── pyth/
│ │ └── (Python logic & helpers)
│ └── environment.py
│
├── lambda-layer/
│ └── (Python Dependencies)
│
└── lib/
└── (Typescript AWS Resources)
$ git clone https://github.com/bcrant/solana-index-discord.git
$ nvm install --lts
$ nvm use --lts
$ node -v > .nvmrc
$ pyenv install 3.9.5
$ pyenv virtualenv 3.9.5 solana_index
$ pyenv local solana_index
$ pip install --upgrade pip
$ pip install -r ./sol-idx/lambda-layer/requirements.txt
Set up AWS CLI if you do not already. You can pass the CDK your AWS CLI profile for secrets.
$ npm install aws-cdk-lib
$ npm install -g aws-cdk
To roll your own...
$ cdk bootstrap aws://{AWS_ACCOUNT_NUMBER}/{AWS_REGION}
$ cdk init app --language typescript
To deploy as is...
$ cdk deploy --profile {AWS_PROFILE}
For development, you may also find this useful...
$ cdk watch
And the greatest feature ever created...
$ cdk destory
-
Give it the following permissions:
bot
,activities.write
,webhook.incoming
-
Add it to your Discord Server
-
Add the API Gateway endpoint to your deployed project to the
Interactions Endpoint URL
:
- Brian Crant | LinkedIn
Shouts out to John McDonald for troubleshooting API Gateway with me on a Sunday.
![Buy us coffee](https://raw.githubusercontent.com/bcrant/diligence-doer/main/documentation/images/bmc-button.png)