Tron Defi Agent

Project Name: Tron DeFi Agent & Smart Contract Suite
Project Track: DeFi
Team Name: DeFi Mavericks
Team Member(s): 2 members - Abhishek (Forum Username: abhishek), Kamal Singh (Forum Username: 0xkamal7).

DevPost Project Link: Tron Defi Agent | Devpost

Project Goal:
The goal of Tron DeFi Agent & Smart Contract Suite is to simplify the interaction between users and the Tron DeFi ecosystem by providing a unified interface for executing decentralized finance (DeFi) actions (e.g., token swaps, staking, lending) while enabling AI-powered smart contract generation, editing, and deployment. Users can easily interact with existing protocols, generate contracts, and even edit them within TronIDE.

Project Value:
This project brings several key values:

  • Simplifies Access to DeFi: It unifies all DeFi activities under one platform, eliminating the need to jump between different protocols or platforms.
  • AI-Powered Smart Contract Generation: Non-technical users can generate complex smart contracts using natural language prompts, and advanced users can edit and deploy them directly on Tron.
  • Seamless Protocol Integration: Users can interact with existing DeFi protocols (Justlend, Sunswap, HTX DAO) without needing to deploy their own smart contracts.
  • Enhanced Developer Productivity: Developers can generate, edit, compile, and deploy contracts all in one platform, enabling quicker prototyping and implementation on the Tron blockchain.

Project Info:

Functionality and Fundamental Goal of the Project:

The Tron DeFi Agent & Smart Contract Suite serves as an all-in-one platform that simplifies decentralized finance (DeFi) interactions and smart contract creation for the Tron blockchain. The core functionalities of the platform include:

  1. AI-Powered Smart Contract Generation: Users can easily generate various types of smart contracts (e.g., Token, NFT, and general contracts) using simple prompts powered by OpenAI. The contracts can be edited, compiled, and deployed directly on Tron.
  2. DeFi Transaction Execution: Users can interact with multiple DeFi protocols, such as Justlend, Sunswap, and HTX DAO, to execute lending, staking, and token swaps.
  3. TronIDE Integration: The platform integrates with TronIDE, allowing users to open and edit AI-generated smart contracts, make adjustments, compile, and deploy them with ease.

Problems our App Trying to Solve?

The project addresses several key issues in the blockchain space:

  1. Complexity in Smart Contract Development: For many developers and new entrants, writing smart contracts in Solidity is a challenge. Our platform lowers the entry barrier by enabling AI-generated smart contracts through simple text prompts.
  2. Fragmented DeFi Access: Users often have to interact with multiple platforms and protocols to perform common DeFi actions like staking, lending, and token swaps. The platform consolidates these actions into one interface, streamlining user experience.
  3. High Learning Curve: For developers new to the Tron ecosystem, getting started with blockchain development can be daunting. The platform simplifies the entire process from contract generation to deployment and makes it more accessible to beginners.

Demo Video -

Integration with TRON/BTTC:

Our project integrates seamlessly with the Tron blockchain to enable users to interact with DeFi protocols and manage smart contract creation effortlessly. Key aspects of the integration include:

  1. DeFi Protocol Integration:

    • Justlend: Allows users to lend assets like stUSDT on the Justlend protocol.
    • Sunswap: Users can perform token swaps between sTRX, USDD, and other Tron tokens using Sunswap.
    • HTX DAO: Users can participate in decentralized governance actions and staking protocols via HTX DAO.
  2. Wallet Integration:

    • TronLink Wallet: The platform integrates with the TronLink wallet to allow users to manage their Tron-based accounts and interact with TRX, TRC-20 tokens (like USDD), and other blockchain features.
  3. Smart Contract Compilation & Deployment:

    • The platform allows users to generate, edit, and deploy smart contracts directly through the TronIDE integration. Users can make changes to the AI-generated contracts, open them in TronIDE for further editing, and deploy them on the Tron mainnet or testnet.

By leveraging existing smart contracts from DeFi protocols and providing seamless access to TronIDE, we ensure smooth interaction with Tron’s blockchain infrastructure without the need for new contract deployments for every user.


This project bridges the gap between DeFi users and the Tron blockchain by providing an intuitive, all-encompassing solution for interacting with decentralized protocols and developing custom smart contracts. The integration with TronLink, Justlend, and Sunswap enables secure and seamless blockchain interactions, while the AI-powered smart contract generation feature gives users the flexibility to build their own contracts without needing deep technical knowledge.

Project Website: https://tron-agent.vercel.app/
Project Test Instructions:

  1. Access the Project Website: Visit the provided link.
  2. Connect TronLink Wallet: Ensure that TronLink is installed and connected to the Tron network.
  3. Navigate DeFi Actions: Use the sidebar to access various DeFi features:
    • Send Transaction: Execute token transfers and other DeFi transactions.
    • Deploy Contract: Generate a smart contract with the built-in AI tool and deploy it using TronIDE.
  4. Test Smart Contract Deployment:
    • Select Deploy Contract.
    • Generate a contract using the prompt field, open it in TronIDE, and deploy it on Shasta Testnet.
  5. Track Transaction: Observe transactions using TronScan to verify execution.

Project Details:
The project integrates DeFi protocols like Justlend, Sunswap, HTX DAO, and supports AI-generated smart contract creation. It features an intuitive interface, powered by TronLink, for sending transactions, deploying contracts, and interacting with the Tron blockchain. Users can edit contracts within the app and open them directly in TronIDE to make final adjustments before deployment.

Smart Contract Links:
Since this project interacts with existing DeFi protocols and focuses on DeFi intents, new smart contracts are not required. However, here are contracts built and deployed using our DApp:

  1. Owner Contract (Shasta Testnet)
    Contract Address: TBA
    Description: This contract allows for setting and changing ownership of assets. Generated, compiled, and deployed using our DApp.

  2. Token Swap Contract (Shasta Testnet)
    Contract Address: TBA
    Description: A smart contract created to swap tokens using Sunswap, deployed through our AI-powered generator.

Project Milestones:

  • Week 1: Completed DeFi protocol integrations for Justlend, Sunswap, and HTX DAO.
  • Week 2: Implemented AI-powered contract generation and TronIDE integration for smart contract compilation and deployment.
  • Week 3: Finished frontend interface for DeFi actions, added support for staking, lending, and token swaps.
  • Final Week: Deployed contracts on the Shasta Testnet and finalized user testing.

The platform will continue to evolve, with future updates bringing more protocol integrations, enhanced AI functionality, and cross-chain compatibility for interacting with other blockchain ecosystems.

8 Likes

Welcome to hackaTron S7! How are you going to ensure that your project integrate smoothly with existing Tron protocols?

2 Likes
  1. How does the Tron DeFi Agent & Smart Contract Suite unify various DeFi activities, and what benefits does this provide for users?

  2. In what ways does the AI-powered smart contract generation feature lower the barrier to entry for non-technical users in the DeFi space?

  3. What role does TronIDE play in the editing and deployment of smart contracts, and how does it enhance user experience within the Tron ecosystem?

2 Likes

Welcome to hackathon S7
After reading your project i can say is innovative but I will like to know apart from Tron do you have any plans integrating with other Blockchain ecosystem.

Welcome to the Hackathon of season 7, interesting very interesting, please tell me how are you planning to manage security risk when interacting with the other blockchains, thank you

1 Like

Hi @Youngyuppie @Smart1 , To ensure that our project integrates smoothly with existing Tron protocols, we are focusing on the following key strategies:

1. Leveraging Tron’s Established DeFi Protocols

Our platform is designed to interact directly with existing DeFi protocols on the Tron network, such as Justlend, Sunswap, and HTX DAO. Instead of deploying new contracts for each DeFi action, we use the smart contracts already deployed by these protocols, ensuring full compatibility and seamless interaction. By utilizing APIs and SDKs provided by Tron for these DeFi services, we ensure that the user’s intent (like staking, swapping, lending) is executed directly on the protocols’ infrastructure.

2. Integration with TronLink Wallet

The platform integrates TronLink, Tron’s widely-used wallet, to facilitate user authentication, transaction signing, and management of tokens (TRX and TRC-20). TronLink allows smooth interaction between our DApp and the Tron blockchain, ensuring that users can connect their wallets, initiate transactions, and monitor results directly on the chain.

3. Direct Interaction via TronWeb and TronIDE

We use TronWeb, Tron’s core JavaScript library, for executing smart contract calls, transactions, and wallet integration. Additionally, our platform is integrated with TronIDE, where users can directly open, edit, compile, and deploy their AI-generated contracts. This ensures that developers can create custom contracts while maintaining full compatibility with the Tron blockchain and its ecosystem.

4. Protocol Compatibility Testing

We thoroughly test our platform’s interactions with the main Tron DeFi protocols on both the Shasta Testnet and Tron Mainnet. By conducting robust testing for token swaps, staking, and lending actions, we verify that the interactions work as intended, with no disruptions to the core DeFi services already operational on the network.

5. Ongoing Compatibility Maintenance

As Tron’s DeFi ecosystem evolves, we aim to maintain compatibility by closely monitoring protocol updates and ensuring our platform continues to work with any new changes in the underlying smart contracts or APIs. We plan to integrate future DeFi protocols as they emerge on the Tron blockchain, providing our users with an up-to-date and seamless experience.

By focusing on established standards and protocols within the Tron ecosystem, ensuring robust wallet integration, and offering smooth DeFi interaction through TronWeb and TronIDE, we ensure that our project integrates with the Tron ecosystem smoothly and efficiently.

1 Like

Hi @Okorie , Thank you for your interest in our future plans! Along with our focus on the Tron ecosystem, we indeed have plans to expand and integrate with other blockchain ecosystems to enable cross-chain functionality. This will allow our platform to support decentralized finance (DeFi) actions and smart contract generation across multiple blockchains.

Expansion into Other Blockchains:

  1. Cross-Chain Compatibility: TRON’s ecosystem already supports cross-chain activities, particularly with the BitTorrent Chain (BTTC), which connects Ethereum, Binance Smart Chain (BSC), and TRON. We plan to leverage this interoperability to allow our users to interact with multiple blockchains seamlessly.

  2. Interoperability with EVM-Compatible Chains: Since TRON’s TRON Virtual Machine (TVM) is fully compatible with the Ethereum Virtual Machine (EVM), we plan to integrate with other EVM-compatible chains like Ethereum, BSC, Polygon, and Avalanche. This will enable users to deploy and manage smart contracts across a variety of ecosystems, providing more flexibility and functionality.

  3. Scaling Solutions: We are also exploring integrating Layer-2 solutions and cross-chain bridges, which will further enhance the scalability and speed of transactions, providing a smoother user experience while maintaining low costs.

This multi-chain vision aligns with the overall goal of building a platform that allows users to interact with decentralized finance protocols and smart contracts across different blockchain ecosystems, creating a more interconnected and versatile experience for both developers and users.

Thank you for the question! When interacting with other blockchains, managing security risks is crucial to ensure the integrity of users’ assets, data, and transactions. We are addressing security at multiple layers to ensure a safe and secure interaction across blockchains. Here’s how we plan to manage security risks:

  1. All smart contracts generated and deployed through our platform will undergo rigorous automated security audits using tools like MythX, Slither, or OpenZeppelin Defender to check for vulnerabilities like reentrancy attacks, overflows, and underflows. Additionally, we encourage developers using our platform to submit their contracts for third-party audits before deploying on mainnets.

  2. Multi-Signature Wallets and Governance:

For high-value or sensitive cross-chain interactions, we will integrate multi-signature wallets to ensure that no single actor can unilaterally execute transactions. This provides an extra layer of security by requiring multiple approvals before any critical actions are taken.

  1. User Education and Transparency:

We will educate users on best practices for interacting with DeFi protocols and cross-chain operations. Transparency will also be maintained by providing users with transaction details, gas fees, and potential risks before confirming actions.

1 Like

Thanks for the warm response and clarification.

1 Like

You are welcome to the hackathon session 7
Taking the step to simplify access to DeFi through AI-powered smart contract generation and seamless protocol integration sound so innovative but I have questions to ask on this approach;

  1. How will this AI-powered smart contract generation work in practical sense?
  2. How will you assure the accuracy of this AI in understanding complex DeFi terms and requirements?
  3. For users who are less knowledgeable in the technical system, will you include a safeguard tutorial to ensure that they don’t accidentally create faulty or insecure smart contracts when using natural language prompts?

Welcome to Hackathon Season 7, after a careful read I see this is an ambitious and practical approach to simplifying access to DeFi protocols and smart contract creation within the Tron ecosystem.
For cross-chain compatibility, how do you plan to manage security risks when interacting with other blockchain ecosystems?

Welcome to Grand hackathon S7
How can the non technical users go through this without any barrier

1 Like

Welcome to hackathon season 7
After reading your project, my thought is that your goal of simplifying the complexities of decentralized finance and smart contract creation on the Tron blockchain present an ample opportunity especially for anyone who wants to build on Tron network. It is another wonderful step towards widespread adoption of the Tron blockchain.

Can you please tell me the security measures you have developed to ensure that the AI-generated smart contracts are safe and free from attacks?

1 Like
  • Is there any plan for long term development and growth of your platform.

  • Can you outline the process in terms of reducing environmental impact in your platform, and what steps do you have in place in terms of dispute.

1 Like

welcome team, have a simple question does this platform differentiate itself from other platforms for smart contracts?

2 Likes

Thank you for your reply to me, I will like to know how are you going to be educating you’re users on all the best practice for securing their contract and their funds, thank you

1 Like

I liked the project Idea. As a developer I am curios to know how you guyz were abe to integrate other protocols with your product? Did you use tron box tool or any other similar tool?

1 Like

Hey excited to see you building on tron, I tried testing Tron Defi Agent. the LLm throws an error: “Sorry, I encountered an error. Please try again.”. Any idea what went wrong?

1 Like

Have you abandoned this project because I noticed that you didn’t even try to answer even a single question from the community.

Hey @Nweke-nature1.com so basically our Idea is to let the non technical users write the type of contract that they want to create and we will generate those contracts using AI for them.

We are also looking forward to have editable templates for the users to choose from.

1 Like