project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

OnChain.xyz

OnChain is an innovative blockchain project that leverages the XMTP protocol to provide users with real-time cryptocurrency market information and personalized account insights. Our bot serves as a bridge between users and the complex world of cryptocurrencies.

OnChain.xyz

Created At

ETHOnline 2024

Project Description

Key Features:

  1. Real-time Market Summaries: Get up-to-date information on the top three cryptocurrencies by market cap, including prices, market capitalization, and 24-hour price changes.

  2. Market Sentiment Analysis: Stay informed about the overall crypto market sentiment with the Fear and Greed Index, helping you gauge market emotions and make informed decisions.

  3. Multi-Chain Balance Checks: Easily check your account balances across 22 popular EVM-compatible chains, including Ethereum, Binance Smart Chain, Polygon, Arbitrum, and many more.

  4. Daily Updates: Subscribe to receive daily crypto market summaries, ensuring you never miss important market movements.

  5. User-Friendly Interface: Interact with CryptoBot using simple text commands through the XMTP messaging protocol, making it accessible to both crypto novices and experts.

  6. Customizable Alerts: Set up personalized alerts for specific price movements or market events (future features).

OnChain aims to democratize access to cryptocurrency information, making it easy for anyone to stay updated on the fast-paced world of digital assets. Whether you're a seasoned trader or just getting started with cryptocurrencies, CryptoBot provides the insights you need to confidently navigate the market.

How it's Made

OnChain was developed using a combination of cutting-edge technologies and APIs, pieced together to create a seamless and powerful user experience. Here's a breakdown of the key components and how they work together:

  1. XMTP Protocol: At the core of CryptoBot is the XMTP (Extensible Message Transport Protocol) SDK. We utilized XMTP's message-kit to handle all user interactions, allowing for secure, decentralized messaging between users and our bot.

  2. TypeScript: The entire project is written in TypeScript, providing strong typing and improved developer experience. This choice enhances code quality and makes the project more maintainable as it scales.

  3. Node.js: We used Node.js as our runtime environment, leveraging its non-blocking I/O and event-driven architecture to handle multiple user requests efficiently.

  4. Redis: To manage user subscriptions and cache frequently accessed data, we integrated Redis as our in-memory data structure store. This significantly improves response times for recurring queries.

  5. CoinGecko API: For fetching real-time cryptocurrency market data, we integrated the CoinGecko API. This provides us with up-to-date information on coin prices, market caps, and other crucial metrics.

  6. Alternative.me API: To offer market sentiment analysis, we incorporated the Alternative.me API, which provides the Fear and Greed Index for the crypto market.

  7. Covalent API: For multi-chain balance checks, we leveraged the Covalent API. This allowed us to fetch account balances across 22 different EVM-compatible chains without needing to integrate separate blockchain explorers for each network.

  8. Axios: We used Axios for making HTTP requests to various APIs, appreciating its promise-based structure and wide browser support.

  9. node-cron: To implement the daily update feature, we utilized node-cron, allowing us to schedule tasks with precision.

  10. Environment Variables: Sensitive information like API keys are stored as environment variables, ensuring security best practices.

One particularly innovative aspect of our project is the dynamic chain support system. We created a flexible SUPPORTED_CHAINS array that allows easy addition or removal of supported blockchain networks. This design makes our bot highly adaptable to the ever-changing landscape of EVM-compatible chains.

A challenge we faced was managing rate limits across multiple APIs while serving numerous users. To address this, we implemented a custom queuing system that batches requests and distributes them evenly over time, ensuring we stay within API rate limits while maximizing throughput.

In summary, OnChain demonstrates the power of combining decentralized messaging protocols with traditional web technologies and blockchain APIs. The result is a user-friendly, feature-rich bot that brings complex crypto data to users' fingertips through simple text commands.

background image mobile

Join the mailing list

Get the latest news and updates