How It Works
UnitFlow is a client-side application that communicates directly with smart contracts on Arc Testnet. There is no centralized backend for trading; all smart contracts operation, all swaps, liquidity operations, and token deployments are on-chain transactions signed by the user's wallet.
System Architecture
The platform is composed of three layers:
- Landing Page — handles community onboarding, Discord/X OAuth verification, NFT minting, and the ranking system.
- DEX Application — the main trading interface. Handles swaps, liquidity, pools, bridge, token factory, analytics and more!
- Smart Contracts — deployed on Arc Testnet. Include the AMM factory, routers, NFT contract, token factory, CCTP bridge contracts, etc
User Journey
Visit the Landing Page
Users land on unitflow.finance and learn about the project.
Complete Onboarding
Verify Discord membership and follow @unitflowFinance on X via OAuth2 flows.
Mint Genesis NFT
After both verifications, mint the Genesis Pass NFT on Arc Testnet.
Earn Activity NFTs
Post on X mentioning UnitFlow, verify the post, and mint Activity NFTs daily.
Access the DEX
Connect wallet to the DEX. The NFT gating system checks for ≥1 Genesis NFT and ≥60 Activity NFTs.
Trade & Provide Liquidity
Swap tokens, add liquidity, explore pools, bridge USDC, or deploy tokens.
Swap Flow
When a user initiates a swap:
- The UI checks whether a direct pool exists between the two tokens.
- If no direct pool exists, the multi-hop router builds a graph of all available pairs and finds the best route (up to 3 hops).
- The estimated output amount is fetched from the on-chain quoter contract.
- The user approves the input token (ERC-20 approval) if not already approved.
- The swap transaction is submitted to the Swap Router contract.
- The UI waits for the transaction receipt and shows the result.
Liquidity Flow
- User selects two tokens and enters amounts.
- If the pool does not exist, it must be created first via the Factory contract.
- The UI calculates the optimal ratio based on current pool reserves.
- Both tokens are approved, then the Liquidity Router mints LP tokens to the user.
- LP token balances are tracked and displayed in the "My Pools" view.
Data Sources
Pool data, TVL, and volume statistics are fetched from multiple sources depending on the protocol version:
| Version | Data Source |
|---|---|
| v2.5 | Envio indexer / HyperRPC / direct RPC calls |
| V3 | GraphQL subgraph |
| V4 | GraphQL subgraph |
PoolDataContext) to avoid redundant RPC calls across components.