Despite the growing popularity of decentralized finance (DeFi), executing trades remains a technically intensive process. Many users lack the tools or knowledge to interact with smart contracts directly or navigate DEX aggregators efficiently. There’s also no seamless bridge between social interfaces like Twitter and on-chain trade execution.
Solution Overview
A Twitter-based AI trading bot built using Alith by LazAI can parse user commands from tweets or DMs, validate them with business logic, and securely execute trades through linked wallets. This makes DeFi trading accessible, social, and secure.
Project Description
This project creates a smart, Twitter-integrated AI agent that listens for trade instructions via tweets or DMs, understands the intent using a large language model (LLM), validates the context, and executes the trade via a smart contract wallet. It operates securely using Trusted Execution Environments (TEEs) and optionally anchors transaction proofs on-chain.
Innovative Components
Natural Language Trading: Accepts plain English commands for trading via Twitter.
TEE-Backed Wallet Security: Uses secure enclaves for private key handling.
Agent-Oriented Execution: Built on Alith’s AI agent architecture for composability and role definition.
Verifiable On-Chain Logging: Anchors execution proofs for full transparency.
Ownable Bots: Supports identity and governance features like iDAO roles.
In order to prevent malicious commands, we put additional security flags in our llm model to limit the commands that dan be executed through tweets. Unless the flag becomes true to validate the command, the command wont go through. Additionally, we will import list of whitelisted tokens from 3rd party dex to limit the interaction with only legit tokens.
That’s a solid approach to safeguard your LLM interactions-implementing security flags adds a crucial layer of validation before executing commands. Integrating a whitelist from trusted DEXs further ensures that only legitimate tokens are involved, reducing risk significantly. Together, these measures create a robust defense against malicious inputs while maintaining functionality. Well done!
When we push the transaction through dex apis, we will have default values of slippage pre defined, at later stage more options can be given to user to define slippage right from the tweets.
To prevent Mev, We can use private rpcs provided by ankr, alchemy.
The multi hop routes are handled by dex aggregator themselves and we have little control over them.
This is a really practical and much-needed idea. Connecting Twitter UX with on-chain trading can truly lower the barrier for many retail users — especially in the current market where simplified experiences really matter. I also like the use of TEE for wallet security and on-chain logging for transparency. Excited to see how the agent evolves and how you plan to drive adoption from crypto-native + new audiences
But I think this wont work because I have already explored this idea and seen many existing teams building it . But the high Twitter API cost would make it un-feasible to execute such idea.
Twitter’s API doesn’t let you to effectively detect and then call smart contract. Plus the existing OKX solution will probably get more adoption.
Twitter API cost optimization is another debate. No one has built this on Metis yet, especially with Alith. As of now, only Bankr has a bot live on Base. I believe if executed well, Tweetrade has strong potential and adds a fun element to on-chain activity. Also, Twitter doesn’t need to call the smart contract directly. it’s just the Twitter API stream getting triggered, parsing the content, and passing it to the LLM model, then to Alith.
3 Likes
Forum Helper
🤖
Hi! I'm your AI assistant. How can I help you today?