arctan(x)

chain-agnostic institutional-grade stablecoin forex-pair perpsDEX with margin rehypothecation

arctan(x)

Created At

HackMoney 2026

Winner of

Arc

Arc - Best Chain Abstracted USDC Apps Using Arc as a Liquidity Hub 1st place

Project Description

While crypto perpetuals have achieved clear product–market fit with over $1 trillion in monthly trading volume, forex and stablecoin perpetuals remain surprisingly underdeveloped, despite representing a $9.6 trillion daily FX market opportunity.

Using DeFi for forex derivatives offers compelling advantages: global liquidity access instead of fragmented regional markets; 24/7 operations; trust-minimised infrastructure; elimination of multiple intermediaries; automatic reconciliation; no minimum account size requirements typical of prime brokerage; efficient settlement; transparent position tracking; and native protocol composability.

Despite these benefits, adoption has lagged due to regulatory, technical, and market-structure constraints. These challenges are now becoming solvable through emerging infrastructure such as Circle’s institutional-grade technology stack, the fast finality of the Arc blockchain, and the StableFX forex conversion engine.

This POC for a capital-efficient, chain-agnostic, institutional-grade Forex stablepair Perps DEX demonstrates solutions to several key problems that have historically hindered institutional adoption:

✅ Unified multichain balance Chain abstraction is critical for institutional-grade infrastructure. This POC uses Circle Wallets and Circle Gateway to create a chain-agnostic interface that addresses fragmented liquidity across chains. The demo shows a unified wallet balance for USDC and EURC across Arc testnet, Base Sepolia, Avax-Fuji and Solana devnet.

✅ Cross-chain collateral rehypothecation In traditional finance, forex futures margins are typically not rehypothecated by clearing houses. DeFi coordination unlocks an opportunity to create a more capital-efficient system for institutions. This POC demonstrates how margin can be rehypothecated cross-chain from the Arc testnet contract into a lending pool on Aave on Arbitrum via CCTP/bridgekit, earning interest while positions remain open. The originating smart contract tracks margin using virtual accounting.

✅ Institutional-grade FX conversion via StableFX StableFX provides institutional-grade forex conversion through RFQ-based pricing and escrowed atomic settlement. This is particularly valuable for multi-currency collateral management, settlement conversions, batching operations, and minimizing gas costs through end-of-day settlement. The most important utility of StableFX is demonstrated when trading directly with institutional counterparties or executing large hedging orders.

How it's Made

This project uses Arc as a chain-abstracted liquidity and coordination hub to enable institutional FX trading, net settlement, and global stablecoin payouts via StableFX.

Arctan(x) uses PerpsDEX contracts on Arc, CCTP/bridgekit (for collateral bridging and rehypothecation), Circle Gateway, Circle Wallets, Stork, and StableFX to demonstrate how this stack can be applied to solving problems of efficiency and settlement faced by institutions trading in the forex and derivatives markets.

⚫ Frontend Framework

  • The demo application is built using Next.js. This handles the frontend interface, routing, and server-side rendering for the trading terminal.

⚫ User Authentication

  • For this prototype, authentication is implemented using Clerk. This allows for rapid user onboarding. A full institutional product would replace this with a custom, regulated KYC and credential management system.

⚫ Wallet Infrastructure & Chain Abstraction

  • Upon sign-up, the system programmatically creates Developer controlled Circle Wallets for the user across four testnets: Arc, Avalanche Fuji, Base Sepolia, and Solana Devnet.
  • To unify the experience, Circle Gateway is integrated. It aggregates the user's USDC from all the chains into a single balance, abstracting the underlying blockchain complexity and fragmentation - which is especially important for trading forex.

⚫ Price Data & Trading Execution

  • The trading terminal pulls live EUR/USD index prices from the Stork data feed API. This feed powers the chart and provides the execution price for all perpetual contract trades.
  • The perpetual DEX smart contract is deployed on the Arc testnet. It uses a simplified protocol-filled order book model.
  • Position size is calculated on-chain as: (Deposited Margin Value) * (Selected Leverage).

⚫ Cross-Chain Margin Rehypothecation System This is the key innovation for capital efficiency. The flow works as follows: ➡️ User margin (USDC) is held in the Arc DEX contract. ➡️ If rehypothecation is selected, the funds are transferred via Circle's CCTP to a Margin Manager contract on Arbitrum. ➡️ The Arbitrum contract supplies the USDC to the Aave lending pool to generate yield. ➡️ A virtual accounting system on the original Arc contract tracks the user's margin obligation while the physical asset is elsewhere. ➡️ Upon position close, the process reverses: funds exit Aave, return via CCTP, and settle back on Arc.

⚫ Forex Spot Conversion For currency swaps (e.g., EURC to USDC), the system integrates with StableFX. ➡️ The frontend requests a quote via the StableFX API, which taps into the Talos RFQ system. ➡️ After the user signs and funds the transaction, StableFX executes an atomic settlement using its escrow engine.

⚫ Other Notes

  • Using Circle Gateway automatically manages different blockchain finality times. This is why Base balance updates take 10-15 minutes, while Arc and Avalanche are faster.
  • The demo uses Circle Developer-Controlled Wallets for simplicity. The architecture is designed to upgrade to Circle Modular Wallets for institutional custody/multisig.
  • The perpetual contract deliberately omits liquidation logic and dynamic funding rates for this POC scope.
  • A known data limitation is that the Stork feed mirrors traditional forex market hours, so the price chart does not move on weekends.
  • USDC on Sepolia and USDC token used for the Aave testnet reserve are different addresses and incompatible, so this deposit cannot complete on testnet although the CCTP cross-chain transfer can be verified in the explorer. -I was running into issues with CCTP on Arc so I've used bridgekit.
background image mobile

Join the mailing list

Get the latest news and updates

arctan(x) | ETHGlobal