Skip to content

FlipBot is a Telegram-based bot designed to provide a user-friendly interface for interacting with the Chainflip ecosystem. It aims to simplify cross-chain operations, wallet management, and DeFi interactions for users of all experience levels, leveraging the power of the Chainflip SDK.

License

Notifications You must be signed in to change notification settings

KiwiProtocol/Flipbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Flipbot

FlipBot is a Telegram-based bot designed to provide a user-friendly interface for interacting with the Chainflip ecosystem. It aims to simplify cross-chain operations, wallet management, and DeFi interactions for users of all experience levels, leveraging the power of the Chainflip SDK. FlipBot is an innovative Telegram chat bot that offers a comprehensive set of features for managing various aspects of DeFi operations in the Chainflip Ecosystem. It integrates multichain wallet management, Chainflip Account Management, cross-chain messaging, and cross-chain swaps, all powered by the Chainflip SDK.

Key Features

  1. Wallets Manager

    • Create new wallets for EVM, Bitcoin, and Polkadot networks
    • Import existing wallets
    • View wallet balances
    • Deposit and withdraw funds
  2. Chainflip Account Manager

    • Fund Chainflip accounts with $FLIP tokens
    • Redeem previously funded $FLIP from Chainflip accounts
  3. Cross-chain Swap

    • Perform instant asset swaps across multiple chains
    • Support for both deposit channel and vault contract methods
  4. Cross-chain Messenger

    • Send messages across different blockchain networks

Supported Networks and Assets

  • Networks: Ethereum, Polkadot, Bitcoin, and Arbitrum
  • Assets: $ETH, $FLIP, $USDC, $DOT, $BTC, $arbETH, $arbUSDC, and $USDT

Innovation

FlipBot's innovation lies in its seamless integration of the Chainflip SDK within a user-friendly Telegram interface. This approach democratizes access to complex cross-chain operations, making them accessible to a wider audience. By abstracting away the technical complexities, FlipBot allows users to perform advanced DeFi operations with simple text commands.

Chainflip SDK Integration

The Chainflip SDK is deeply integrated into FlipBot's core functionalities:

  1. Swap Operations: The SDK is used to fetch quotes, request deposit addresses, and execute swaps via both deposit channels and vault contracts.

  2. Cross-chain Messaging: Leverages the SDK's capabilities to send messages across different blockchain networks.

  3. Account Management: Utilizes the SDK for funding and redeeming Chainflip accounts.

Backend Architecture

The backend of FlipBot is built using Node.js and leverages several key libraries:

  1. Telegraf: For handling Telegram bot interactions
  2. Ethers.js: For Ethereum and EVM-compatible blockchain interactions
  3. Bitcoinjs-lib: For Bitcoin-related operations
  4. Polkadot.js: For Polkadot network interactions
  5. Chainflip SDK: Core component for all Chainflip-related operations

Key components of the backend include:

  • Conversation State Management: Tracks the state of user interactions for multi-step operations.
  • Wallet Model: Defines the schema for storing wallet information in the database.
  • Network-specific Handlers: Custom logic for different blockchain networks (EVM, Bitcoin, Polkadot).
  • SDK Integration: Wrapper functions around Chainflip SDK methods for seamless integration with bot commands.

User Interface

FlipBot's user interface is entirely text-based, leveraging Telegram's chat interface. The bot uses a combination of text messages and custom keyboards to guide users through various operations:

  1. Welcome Message: Introduces users to FlipBot's capabilities and presents main menu options.

  2. Custom Keyboards: Dynamically generated based on the current context, offering relevant options to users.

  3. Step-by-step Guidance: For complex operations, the bot breaks down tasks into simple steps, prompting users for necessary information.

  4. Informative Responses: Provides clear feedback on operation success or failure, including transaction hashes and deposit addresses where relevant.

  5. Error Handling: Gracefully handles errors and provides user-friendly error messages to guide users.

Workflow Examples

  1. Creating a Wallet:

    • User selects "Wallets Manager" > "Create Wallet"
    • Bot prompts for network selection
    • User selects network
    • Bot generates wallet and displays address and private key
  2. Performing a Cross-chain Swap:

    • User selects "Cross-chain Swap" > "Swap Via Deposit Channel"
    • Bot displays available wallets
    • User inputs swap details (source/destination chains, assets, amount)
    • Bot fetches quote using Chainflip SDK
    • Bot provides deposit address to user
    • User deposits funds
    • Bot confirms successful swap
  3. Sending Cross-chain Message:

    • Similar to swap workflow, with additional step for message input
    • Bot uses SDK to include message in the swap transaction

Conclusion

FlipBot represents a significant step forward in making cross-chain DeFi operations accessible to a broader audience. By combining the power of the Chainflip SDK with the ubiquity of Telegram, it offers a unique and user-friendly solution for interacting with the Chainflip ecosystem. The modular backend architecture and intuitive text-based interface provide a solid foundation for future enhancements and expansions of FlipBot's capabilities.

About

FlipBot is a Telegram-based bot designed to provide a user-friendly interface for interacting with the Chainflip ecosystem. It aims to simplify cross-chain operations, wallet management, and DeFi interactions for users of all experience levels, leveraging the power of the Chainflip SDK.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published