Project: Harmony Perpetual Exchange
Objective: Develop a decentralized perpetual exchange on the Harmony blockchain, forking the Jupiter Perpetual Exchange model, and supporting ONE, wETH, wBTC, USDT, and USDC.
Overview
The Harmony Perpetual Exchange will allow users to trade perpetual contracts on assets including ONE, wETH, and wBTC, using USDT and USDC as collateral for short positions. The platform will leverage Harmony's fast and low-cost transactions to provide an efficient and user-friendly trading experience.
Sections
- Introduction
- Purpose: Outline the scope and functionality of the Harmony Perpetual Exchange.
- Goals: Create a decentralized, low-latency trading platform for perpetual contracts using Harmony's blockchain infrastructure.
- Technical Background
- Architecture:
- Core Contracts: Fork Jupiter’s PositionManager and LiquidationManager smart contracts, adapting them for Harmony.
- Liquidity Pool Contracts: Implement JLP (Jupiter Liquidity Pool) contracts to manage asset pools.
- Keeper Contracts: Adapt keeper contracts for monitoring and executing trades.
- Oracles: Utilize decentralized oracles for accurate price feeds of ONE, wETH, wBTC.
- DEX Integration: Integrate with existing Harmony-based DEXes for liquidity and swap functionalities.
- Collateral and Leverage:
- Long Positions: Use the asset being longed (ONE, wETH, wBTC) as collateral.
- Short Positions: Use stablecoins (USDT, USDC) as collateral.
- Leverage Management: Support leverage ranging from 1.1x to 100x.
- Security: Implement comprehensive audits and continuous monitoring to ensure contract security and robustness.
- Front End
- User Interface:
- Trading Dashboard: Develop an intuitive interface for selecting markets, opening positions, and managing trades.
- Position Management: Display open positions, collateral values, liquidation prices, and provide tools for real-time adjustments.
- Order Placement: Facilitate seamless order placement with clear display of fees, leverage, and collateral requirements.
- User Experience:
- Fast Transactions: Leverage Harmony’s low-latency blockchain to provide quick transaction confirmations.
- Responsive Design: Ensure the interface is accessible on various devices, maintaining usability and performance.
- Additional Features:
- TP/SL Orders: Allow users to set take-profit and stop-loss orders for automated position management.
- Analytics: Provide users with detailed analytics on their trading performance and market data.
- Implementation Plan
- Phase 1: Fork and Adaptation
- Fork Jupiter Perpetual Exchange contracts.
- Modify contracts for compatibility with Harmony blockchain.
- Implement oracles for price feeds.
- Phase 2: Front-End Development
- Design and develop the trading dashboard.
- Integrate smart contracts with the front-end.
- Phase 3: Testing and Security
- Conduct thorough testing (unit, integration, and user testing).
- Perform security audits.
- Phase 4: Deployment
- Deploy smart contracts on Harmony mainnet.
- Launch the front-end application.
- Phase 5: Post-Launch
- Monitor platform performance and security.
- Gather user feedback for continuous improvement.
Conclusion
The Harmony Perpetual Exchange will leverage Harmony's efficient blockchain infrastructure to offer a decentralized, fast, and user-friendly platform for trading perpetual contracts. By adapting and building upon the Jupiter Perpetual Exchange model, this project aims to provide a seamless trading experience for users interested in ONE, wETH, and wBTC assets, with stablecoin collateral options.