Yellow-powered seamless trading with swipe mechanics for rapid positions
Swipe right to go long, left to short, all powered by super-fast Yellow / ERC7824 backbone.
We've taken the head-scratching complexity of DeFi and transformed it into a thumb-flicking good time, without sacrificing the serious security your digital assets deserve. No more squinting at intimidating trading interfaces or drowning in jargon!
Just swipe, confirm, and watch your positions like you're checking your crush's Instagram stories.
TradeLayer is built on React and Next.js with TypeScript for type safety. UI components are styled using Tailwind CSS, with shadcn/ui providing a consistent design system. The application is fully responsive, functioning across desktop and mobile devices.
We implemented a custom React hook (useMetaMask) that manages wallet connections, handles account changes, and facilitates transaction signing. This hook includes:
Communication with Yellow Protocol's infrastructure occurs via:
The application employs a dual-key security model, MetaMask Key: Handles primary transaction authorization and wallet authentication Participant Key: Locally stored session key that manages trading permissions This separation provides enhanced security without sacrificing user experience.
Application state is managed through react context for global state (wallet, trading positions, etc.), local component state for UI interactions, and custom hooks that abstract service interactions
The distinctive card-swiping interface is built with custom touch and mouse event handlers, direction detection for long/short position creation, position management through the trading service layer and real-time price updates via WebSocket