Telegram has 2 ways of receiving updates, either from a webhook or a a getUpdate method. Most wrappers [0] implement the webhook strategy as its default way. In order to be able to implement Pamela as a bot we need to decide a few things:
What will Pamela do?
What will be the commands available for Pamela?
How often will Pamela be trading?
How much control will we have over Pamela through the bot?
How can we authenticate or make the bot initially private?
How will the bot work technically?
What are the features of the Telegram Bot API it will implement?
How can we simplify all that and ship the simplest bot and then improve upon?
What will Pamela do?
Pamela is a bot designed to trade cryptocurrencies at Binance exchange, it implements the Passive Aggressive Mean Reversion (PAMR) algorithm, which aims to rebalance your pre-selected coins based on the market returns.
Commands
/auth - Authenticate with binance exchange and telegram (v2)
/coins - First bot asks to choose between basecoins. Ask the rest of the coins. And if the user is updating, show the user base + current trading coins
/period - Asks user to set period (hours) if non is set, and shows current period and asks if wants to update.
/report - Reports current earnings (v2)
/status - Print current trading status (optional)
/halt - Stop trading right now
/target - Sets target portfolio for automatic lazy rebalancing. (v2)
/trade - Then the bot will ask the user to choose between ETH, BTC or BNB as base coin, and then will ask the user to choose between the available markets. And finally, the bot will ask the user what will be the period of trading. (The bot assumes the user wants to trade with the value he has already deposited into the coins he wants to trade)
How often ?
That will be for the user to decide.
How much control will we have over Pamela through the bot?
It should be able to stop trading and start trading, as well as print stuff related to his portfolio.
How can we authenticate or make the bot initially private?
We need to research ways of seeing if you can make a bot private and initally do that. But as an improvement an /auth command can be implemented.
How will the bot work?
My first proposal for us to accomplish this is to divide this problem into 3 parts:
A Trading Agent that is responsible for making all the trading decisions based on the data it receives
A Telegram bot that is used as the client, to initiate the requests that the server will receive
What features?
At first we can look for ways of making the bot private for internal testing and incompleteness. But then we can periodically use Telegram's + Crypto features to enrich the bot:
Authenticate the user and the bot on the exchange
Implement other exchanges
Implemnent other trading strategies
Allow the bot to be doing more than 1 trading session at the same time with different assets or exchanges.
Implement private features
Implement integration with real blockchains where user can see his wallet balance
A lot more hahaha
How can we simplify all that and ship the simplest bot and then improve upon?
We should make the bot as dum as possible and only implement the necessary features for him to trade and rebalance our portfolio. While also making the bot private.
We should allow the bot to trade automatically, thats when we plug the PAMR bot and allow the bot to rebalance it based on the trading period the user inputs.
We should be able to authenticate the bot and the user.
4.The bot should be able to trade on different exchanges and more than 1 trading session at the same time. Also, trading sessions should be able to be customisable.
Implement Pamela's client as a Telegram Bot
Telegram has 2 ways of receiving updates, either from a webhook or a a
getUpdate
method. Most wrappers [0] implement the webhook strategy as its default way. In order to be able to implement Pamela as a bot we need to decide a few things:What will Pamela do?
Commands
/auth
- Authenticate with binance exchange and telegram (v2)/coins
- First bot asks to choose between basecoins. Ask the rest of the coins. And if the user is updating, show the user base + current trading coins/period
- Asks user to set period (hours) if non is set, and shows current period and asks if wants to update./report
- Reports current earnings (v2)/status
- Print current trading status (optional)/halt
- Stop trading right now/target
- Sets target portfolio for automatic lazy rebalancing. (v2)/trade
- Then the bot will ask the user to choose between ETH, BTC or BNB as base coin, and then will ask the user to choose between the available markets. And finally, the bot will ask the user what will be the period of trading. (The bot assumes the user wants to trade with the value he has already deposited into the coins he wants to trade)How often ?
How much control will we have over Pamela through the bot?
How can we authenticate or make the bot initially private?
/auth
command can be implemented.How will the bot work?
My first proposal for us to accomplish this is to divide this problem into 3 parts:
What features?
At first we can look for ways of making the bot private for internal testing and incompleteness. But then we can periodically use Telegram's + Crypto features to enrich the bot:
How can we simplify all that and ship the simplest bot and then improve upon?
0 - API Wrappers: