I made an Open Source AI Crypto Trading Bot for your crypto portfolio
Ive always been passionate about automating manual tasks, which led me to develop a fresh concept for portfolio management. Having worked on bots and crypto trading bot platforms like Aesir for several years, I wanted to create a tool positioned between manual and algorithmic trading.
I came up with Cryptocurrency GPTan AI assistant designed to streamline your trading experience, enabling you to use natural language to access account information, place trades, close orders, and more.
Heres a demonstration of how it works:
Right now, the tool expects a simple text prompt inside a box, and because its connected to Binance, TradingView and Brave APIs it can do a bunch of things such as:
- Manage your crypto portfolio and account
- Plot charts for your for pretty much any coin or asset
- Support you in researching coins and crypto projects
To build this tool, I used Astro, TypeScript and Javascript, and the tool can easily run on your local machine, and will create a simple UI you can interact with on localhost:3000. The tool is Open Source and available on GitHub.
Main CryptocurrencyGPT Features
Live Market Data
CryptocurrencyGPT has access to live market data. Under the hood it uses the Binance API in order to fetch live information about the current price of any cryptocurrency available on the exchange.
Not only that, but because it has access to historical candlestick data from the Binance API, you can now easily find out what the price of Bitcoin (or any other coin) was on a specific day, without having to check the charts:
Ability to browse the Internet
In addition to access to live market data, CryptocurrencyGPT is also able to browse the Internet and search for recent information that the original model is not aware of. Naturally, this can be used to return any kind of information, not only related to crypto, similar to the GPT in Bing Search.
I personally find it very useful when it comes to summarizing the most recent news in crypto, all in one place. Not to mention that I dont to open up Edge for that.
Cryptocurrency GPT has access to the Brave Search API in order to return relevant and up to date information, instead of making stuff up.
Can buy and sell cryptocurrency for you
Using the Binance API, it can easily place buy and sell orders on your behalf.
Heres an example of it placing a Sell market order for $20 of Bitcoin
And then buying $15 worth of Matic, one prompt later.
In addition to placing orders on our behalf, it can also summarise your recent transaction information based on an asset of your choice:
It can plot charts
Naturally, I left the coolest bit of functionality for last. CryptocurrencyGPT uses Tradingview charts in order plot any historical cryptocurrency data on a chart. It sources its own historical data using the Binance API and then plots the chart using the TradingView Lightweight charts Library for plotting market data.
Heres an example for MATIC
And another one for Bitcoin
Now that you know what it does, you might want to set it up on your machine and play around with it. Heres how to do that:
How to setup and use Cryptocurrency GPT
CryptocurrencyGPT is open source and available on GitHub.
Once you cloned or downloaded the Repo, there are a few requirements you must install before you can use it:
CryptocurrencyGPT is built using an Astro project that uses node.js and npm so youll need to install npm if thats not installed on your machine.
- Naturally, youll need an OpenAI API Key and Organization ID.
- Youll also Need a Brave Search API key
- Finally, to perform actions on your Binance account youll need to provide it with a Binance API key and secret.
Note that in order for the Binance API to work, you need to either whitelist your IP, or disable IP restriction. Remember to also enable Spot Trading, but DO NOT enable withdrawals, for security reasons.
Note that you might want to create a brand new Binance account if you dont want to experiment on your main account. Use my referral code to get 5% off your trading commission.
Once you have gathered all of these requirements, open the .env.example located in the root directory of the project and add the required keys in the correct variables:
OPENAI_ORG_ID="ORG_ID"OPENAI_API_KEY="OPENAI_API_KEY"BRAVE_API_KEY="BRAVE_API_KEY"BINANCE_API_KEY="BINANCE_API_KEY"BINANCE_SECRET="BINANCE_SECRET"
Now install the project requirements using npm i.
From here, you should just be able to run npm run dev from your command prompt / terminal and you should be able to access CryptocurrencyGPT at http://localhost:3000
Thats it really! You now have your own AI cryptocurrency assistant.
If you like this project, please remember to give this article plenty of claps, follow me, and maybe share with others, it helps.
Considerations
One key consideration to take into account is that this AI trading bot does not autonomously place trades on your behalf, but rather acts as a natural langauge Interface between you and your exchange and its primary purpose is a more natural interaction and portfolio management flow.
Consider the following:
- Log into trading platform -> Navigate to the Trade page -> Navigate to your desired pair -> Place an order
- Launch CryptocurrencyGPT -> Ask it to buy Bitcoin
Its significantly quicker and easier to manage one or multiple portfolios in this manner.
The main limitation however, is that right now, it can only perform single actions. For instance, you can ask the AI crypto trading bot to place a buy order, or a sell order, or to plot a chart for you but you cannot ask it to Buy you Bitcoin every time price drops by more than 10%.
This is something that Im looking to add in a future update of this tool the ability to build and launch simple crypto trading bots using natural language.
You can play around with cryptocurrencyGPT here.
Finally, if youre into Algorithmic tradingcheck out algorithmic cryptocurrency trading platform Aesir! Aesir is a state-of-the-art trading platform that allows you to build complex crypto trading bots and maximise your gains.
Enjoyed this article?
Sign up to the newsletter
Youll receive more guides, articles and tools via e-mail. All free of course. But if you value this blog and its educational resources, you can subscribe to become a paid member for only $3 a month. This will keep the website open and free.
The post I made an Open Source AI Crypto Trading Bot for your crypto portfolio appeared first on cryptomaton.
Read more: https://www.cryptomaton.org/2024/12/08/i-made-an-ai-crypto-trading-bot-for-your-crypto-portfolio/
Text source: Automated Cryptocurrency Trading