DeFi trading simulator powered by 1inch APIs — learn by doing.
This project is a simulation platform designed to emulate real-world decentralized token swaps using live market data from the 1inch DeFi aggregation protocol. The application provides a fully interactive frontend where users can register, log in, and simulate both classic and cross-chain token swaps. It integrates deeply with multiple endpoints from the 1inch API suite, allowing for accurate pricing, token metadata, and realistic trade execution behavior — all without moving real assets on-chain. The application Uses 1inch's swap and quote APIs to simulate token-to-token swaps within a single chain (e.g., ETH → USDT on Ethereum). It also Simulates swaps that span across chains (e.g., USDC on Polygon to ETH on Ethereum). All swap data (routes, token amounts, minimum received) is fetched live using 1inch APIs, ensuring real-time market conditions. I Integrated the 1inch Token API to dynamically load token metadata. Post-swap, the user’s simulated wallet is updated to reflect:Tokens deducted and received, Correct balances across chains and ensure precision using token decimals.
This project is a full-stack DeFi swap simulator built using React on the frontend and Node.js with Express on the backend. It integrates directly with 1inch’s Swap, Quote, Token, and Cross-Chain APIs to fetch real-time data and simulate token swaps without executing on-chain transactions. On user registration, a virtual wallet is initialized with preset balances (10 ETH + 10 USDC on Ethereum and 10 USDC on Polygon), and all swaps are processed against these balances using simulated logic. Token metadata and pricing are fetched live, and swaps reflect real-world behavior, including slippage, DEX routing, and spread — for example, a $10 USDC swap might yield $9.99 due to route inefficiencies. I implemented precise handling of token decimals using BigNumber.js to ensure accurate conversions across assets with different precision (e.g., 6 vs. 18 decimals), and built a lightweight in-memory wallet engine to simulate token behavior across chains. The project was designed to run without real wallets or gas fees, but still mirrors realistic DeFi swap mechanics for educational and prototyping purposes.