Inspiration

The decentralized finance (DeFi) landscape is rapidly evolving, with perpetual contracts and leverage trading gaining widespread traction. However, current platforms often face challenges around customizability, security, and governance. Inspired by the modular design of Uniswap v4’s hook manager and the growing need for a fully decentralized governance-driven exchange, we built Trade Run — a decentralized futures and perpetuals exchange that gives users more control over liquidity pools and risk management.

What it does

Trade Run is a decentralized platform for trading futures and perpetual contracts with up to 10x leverage. It allows users to engage in perpetual trading without the need for intermediaries, ensuring security, transparency, and flexibility. The platform introduces a hook manager for perpetual pools, similar to the concept used in Uniswap v4, which allows developers and users to introduce custom hooks that define specific trading behaviors or liquidity management strategies. Trade Run is fully governed by its community, enabling token holders to vote on critical decisions, such as fee structures, supported assets, and upgrades on protocol. Users can get the goverence tokens in 3 ways 1)Merkel Airdrops 2)Presale 3) Staking LP tokens of trade pools

How we built it

We developed Trade Run using the following components: Smart Contracts: The perpetual pools and futures contracts are powered by custom smart contracts, deployed on Ethereum, that leverage modular hook systems to allow flexibility. Hook Manager: Inspired by Uniswap v4, we designed a hook manager to give users full control over customizing the behavior of their liquidity pools. This allows for strategies like dynamic fees, automated rebalancing, and tailored risk management. Governance: The platform operates under a fully decentralized governance model where token holders can vote on key parameters and system upgrades. Frontend: Built using Next.js, wagmi, viem, ether.js, mongo db , experess.js, bootstrap, typescript with integration for real-time data visualization and trading interfaces. For data representation in pie charts I have used 'pie-charts' library.

Challenges we ran into

One of the major challenges was ensuring the security and flexibility of the hook manager without sacrificing performance. We had to carefully design the modular hooks to avoid vulnerabilities while maintaining scalability. Additionally, creating a robust governance system that balances decentralization with efficiency was a complex task, especially in a highly dynamic trading environment like perpetual futures.

Accomplishments that we're proud of

Successfully implemented a hook manager that allows for a high degree of customizability and modularity, empowering users to design their own liquidity strategies. Developed a fully functioning governance system where users have a direct say in the platform's future development and operation. Built a secure and efficient platform for perpetual futures trading with real-time market data and up to 10x leverage.

What we learned

We learned the importance of balancing flexibility with security, especially when building modular components like the hook manager. Additionally, creating a decentralized governance system requires not only technological solutions but also a deep understanding of how communities engage with DeFi platforms.

What's next for Trade Run

Expanding the Hook Ecosystem: We plan to collaborate with developers and the community to expand the number of available hooks, allowing for more complex trading strategies and liquidity management options. Scaling the Governance System: Improving governance participation mechanisms, making it more accessible and incentivizing more users to take part in critical decision-making. Cross-Chain Integration: Exploring integrations with other blockchain ecosystems, such as Solana or Layer 2 solutions, to increase scalability and reduce trading fees.

tools used

Chainlink: I have used Chainlink for automation and price feed, which having secure mechanism to interact with smart contracts onchain. SafeERC20: To transfer ERC 20 tokens used this library to call the functions at low level. The state variables are updated before the transfer of the tokens because to avoid re-entrancy attacks.

NOTE : This project interface is not completed completely. Due to my semister examinations I have completed upto 80% of work. Documentation link: https://ramachandrareddy.netlify.app/blogs/trade-run You can read the complete documentation at here.

Share this project:

Updates