A Node.js application that snapshots crypto assets every hour and stores them in a database. It also integrates Telegram bot as an interface to query summary of assets.
- Node.js v20.0.0+
- Postgres 14+
- Algorand
- Aptos
- Bitcoin & all Bitcoin-like chains (via Blockchair)
- Bybit (CEX)
- Cardano (via Blockfrost)
- Cosmos Hub & all Cosmos SDK chains
- Ethereum & all EVM chains
- Multiversx (formerly known as Elrond)
- Near
- Ripple
- Solana
- Install packages
npm install
- Create
env.yaml
file by cloningenv.template.yaml
and fill in the required fields.telegramBotToken
: Telegram Bot Token. Acquire token from @BotFather (https://core.telegram.org/bots/tutorial#obtain-your-bot-token).telegramChatId
: Chats to receive notifications. Acquire chat ID from @userinfobot (https://telegram.me/userinfobot).telegramWhitelistedChatIds
: Chats whitelisted to use the bot. Acquire chat ID from @userinfobot (https://telegram.me/userinfobot).
- Create
knexfile.js
file by cloningknexfile.template.js
and fill in database connection information. - Run migrations.
npx knex migrate:latest
- Run seeds.
npx knex seed:run
- Start the application.
- with pm2:
npm run pm2:start
- without pm2:
npm start
- with pm2:
Asset Queries tells the application which addresses to monitor. Currently they can only be created via SQL (under table asset_queries
).
Telegram provides a menu to list all available commands.
Returns a summary of the latest snapshot batch.
For Total Realized PnL
and PnL%
, they are only accurate if asset flows are corr
Returns the distribution and USD values of the assets in the latest snapshot batch.