Integration Grants Application ‘26: Realyx - RWA Perpetual Futures DEX

Integration Grants Application '26: Realyx — RWA Perpetual Futures DEX


Application Introduction

1. Name of the Project

Realyx — The premier decentralized perpetual futures exchange for Real-World Assets (RWAs) and Crypto, natively built on Conflux eSpace.

2. Problem Statement & Proposed Solution

The Problem: Liquidity Fragmentation and RWA Access Barriers

Traditional Finance (TradFi) remains a “walled garden” characterized by capital-inefficient settlement cycles, high onboarding friction, and geographic exclusion for retail participants seeking exposure to marquee assets like US Equities or Global Commodities. Within the Conflux DeFi ecosystem, there is a critical vacuum for high-performance, non-custodial trading primitives that can bridge volatile crypto-native assets with stable Real-World Assets (RWAs). Existing synthetic asset protocols often suffer from:

  1. Oracle Latency: Inaccurate pricing during high volatility leads to stale-price arbitrage and protocol bleed.
  2. Solvency Risks: Lack of transparent, on-chain collateralization and robust liquidation engines to sustain market stress.
  3. Execution Friction: High latency and gas costs that preclude a competitive, low-slippage trading experience compared to centralized alternatives.

The Solution: Realyx’s High-Performance Perpetual DEX

Realyx is an institutional-grade, non-custodial perpetual futures engine engineered for the Conflux eSpace. By leveraging Conflux’s high throughput and sub-second block finality, Realyx delivers a “CEX-like” trading experience with the security and transparency of on-chain settlement.

Key technical differentiators include:

  • Pull-Based Oracle Architecture: Integration of Pyth Network’s low-latency, high-fidelity price feeds ensuring sub-second state updates and protection against MEV-related front-running.
  • Unified Liquidity Layer: A multi-asset collateral vault (VaultCore) supporting up to 30x leverage (configurable up to 100x per market) across a diverse pair spectrum including CFX/BTC/ETH and tokenized RWAs such as TSLA, NVDA, and XAU.
  • Programmatic Solvency: A strictly enforced risk management layer involving dynamic maintenance margins, multi-tier liquidations, and an insurance fund backstop to guarantee protocol-wide delta neutrality and solvency.

3. Alignment with Conflux Network

  • Ecosystem Synergy: Realyx acts as a fundamental DeFi building block. By providing a venue for RWA exposure, we attract a new demographic of traders who may not be crypto-native but are looking for tokenized exposure to traditional markets — directly expanding Conflux’s user base.
  • Economic Benefit: The protocol is designed as a liquidity magnet. The VaultCore system incentivizes liquidity providers to deposit USDT0/AxCNH/USDT/USDC to earn premiums, directly increasing the Total Value Locked (TVL) on Conflux. Furthermore, high-frequency perpetual trading generates consistent on-chain transaction volume and protocol revenue.
  • Developer Interest: Realyx is built with a modular “API-first” philosophy. Our native PostgreSQL indexer and planned SDK will allow developers to build arbitrage bots, auto-compounding vaults, and treasury management tools on top of our liquidity, fostering a richer developer sub-ecosystem on Conflux.

4. Competitive Edge

Realyx sits at the intersection of Perpetual DEXs and RWA Tokenization. Unlike existing protocols that focus on a single niche, Realyx offers a unified liquidity layer with distinct advantages:

Feature Realyx (Conflux) GMX (Arbitrum) Gains Network (Polygon) dYdX (Cosmos)
RWA Markets :white_check_mark: Equities, Forex, Commodities :x: Crypto only :warning: Limited synthetic :x: Crypto only
Oracle Pyth (pull-based, sub-second) Chainlink (push) Custom DON In-house
Position NFTs :white_check_mark: ERC-721 composable :x: :x: :x:
Market Calendar :white_check_mark: TradFi-aware scheduling :x: :x: :x:
On Conflux eSpace :white_check_mark: Native :x: :x: :x:
Max Leverage Up to 30x (configurable to 100x) 50x 150x 20x
Insurance Fund :white_check_mark: On-chain, siloed :white_check_mark: GLP-based :warning: DAI vault :white_check_mark:
Dividend System :white_check_mark: LP yield + dividends :white_check_mark: :white_check_mark: :x:

Key Differentiators:

  1. Only perpetual DEX on Conflux eSpace with RWA support — no direct competitor exists in the ecosystem.
  2. ERC-721 Position Tokens — pioneering composability for leveraged positions.
  3. MarketCalendar — proprietary TradFi-aware scheduling that automatically pauses RWA markets during weekends/holidays.
  4. Full-stack product already deployed on testnet

5. Existing Solutions & Feasibility Study

On Conflux: There is currently no perpetual futures DEX deployed on Conflux eSpace, let alone one supporting RWA markets. This represents a critical gap in the ecosystem’s DeFi stack.

Cross-chain competitors: GMX, Gains Network, and dYdX dominate perpetual trading on Arbitrum, Polygon, and Cosmos respectively. However, none have deployed on Conflux or offer the same RWA-focused feature set.

Feasibility Assessment:

  • :white_check_mark: Technical Feasibility: All 40+ production smart contracts compile, deploy, and execute correctly on Conflux eSpace Testnet (verified).
  • :white_check_mark: Oracle Feasibility: Pyth Network providing the critical price feed infrastructure.
  • :white_check_mark: Market Feasibility: The tokenized RWA market is projected to reach $16T by 2030 (BCG). Perpetual futures represent the highest-volume trading instrument in crypto ($150B+ daily).
  • :white_check_mark: Execution Feasibility: Full-stack product (smart contracts + frontend + backend + keeper bot) is already operational on testnet with working UI.

Project Links

Wallet

  • Conflux eSpace Address: 0xba7A2A3B65FBd55b1f6E13e871943aBB8E842b14

Business Status

Realyx is currently a community-led project originating from the Global Hackfest 2026 (Winner), with formal incorporation scheduled for Q3 2026 following the initial grant phase.


Technical Introduction

Purpose & Scope

Realyx is designed to fill the critical gap for a high-performance perpetual futures exchange in the Conflux DeFi ecosystem. The system enables non-custodial leveraged trading of both crypto-native assets and Real-World Assets through synthetic perpetual contracts settled entirely on Conflux eSpace.

System Architecture

The application utilizes a layered architecture to ensure maximum performance and security:

  1. On-Chain Layer (Conflux eSpace): 40+ production Solidity smart contracts (Solidity 0.8.24) managing margin, PnL, position lifecycle, and vault accounting.
  2. Oracle Layer (Aggregated Multi-Source): High-fidelity infrastructure integrating Pyth Network for sub-second updates, supplemented by a Native Guardian-Confirmed oracle for decentralized failover.
  3. Data Layer (PostgreSQL Indexer): A native, low-latency event indexer that tracks thousands of positions and provides instant data to the UI — powering leaderboards, analytics, and portfolio views.
  4. Market Logic Layer (Market Calendar): A proprietary system that synchronizes on-chain trading with global market hours, automatically pausing trading for specific RWAs during weekends and holidays.
  5. Keeper Layer (Automated Bot): Decentralized keeper nodes that detect order events and execute trades by injecting fresh Pyth oracle data, enabling trustless order execution.

Objectives & Success Criteria

Objective Success Criteria Timeline
Security certification Professional audit report with no Critical/High findings Month 2
Mainnet deployment All core contracts verified on ConfluxScan Mainnet Month 4
Liquidity bootstrapping $350,000+ TVL in VaultCore Month 6
Trading activity 200+ monthly active traders Month 6
Market coverage 15+ listed markets (crypto + RWA) Month 6
Test quality 85%+ smart contract test coverage maintained Ongoing

Current Deployment Status (Testnet — LIVE)

All core contracts are deployed and verified on Conflux eSpace Testnet (Chain ID: 71):

Contract Address ConfluxScan
TradingCore 0x64f277f73bfc81Ad80286a4266c0E0613d867Df3 View
VaultCore 0xB5C983d038caA21f4a9520b0EFAb2aD71DE4e714 View
OracleAggregator 0x89cC8eAbF2e967d81FD04D1023298A3bDcE67450 View
PositionToken 0x4368b5741A105c1ACE50ad98581fDa050685fa8B View
TradingCoreViews 0x944d4030CEc4Bf552d8E46dC684B70B100Eb0b86 View
MarketCalendar 0xD3c20cca25Dd8189ed6115A1b65192d831ca732F View
DividendManager 0xa5bd07176Ef68D1ec51BfCCD911d3B586a45c54F View
ComplianceManager 0xa79185D94013FaC946Ce80fDbB8E781200A28F7e View
DividendKeeper 0x28B46F65c26BDC6b9c77603B092EDdcd7EADEC82 View

Glossary of Terms

  • RWA (Real World Asset): Tangible or financial assets (Equities, Forex, Commodities) brought on-chain via synthetic perpetual contracts.
  • PnL (Profit & Loss): The real-time gain or loss of a position, calculated with 18-decimal precision.
  • OI (Open Interest): The total value of all open long and short positions in a specific market.
  • BPS (Basis Points): A unit of measure for fees and percentages (100 BPS = 1%).
  • TWAP (Time-Weighted Average Price): A pricing algorithm used to prevent flash-loan attacks and oracle manipulation.
  • TVL (Total Value Locked): The total USD value of assets deposited in the protocol’s vaults.

References

  1. Pyth Network Documentation — https://docs.pyth.network
  2. Conflux eSpace Developer Guide — https://doc.confluxnetwork.org
  3. BCG Report: “Relevance of On-Chain Asset Tokenization” (2022) — projects $16T tokenized asset market by 2030
  4. GMX Protocol Documentation — https://docs.gmx.io (architectural reference)
  5. OpenZeppelin Contracts v5 — used for ERC-721, AccessControl, ReentrancyGuard base implementations

Technical Proposal

Functional Overview

Core On-Chain Components (7 Production Contracts)

1. TradingCore — The Central Trading Engine

  • Handles creation, validation, and execution of market and limit orders
  • Manages position lifecycle: open → modify → close/liquidate
  • Enforces leverage limits, margin requirements, and market exposure caps
  • Supports up to 20 concurrent active markets

2. VaultCore — The Liquidity Engine

  • Serves as the universal counterparty to all trader PnL
  • Manages LP deposits, share issuance, and asynchronous withdrawal queues
  • Contains the Insurance Fund — a dedicated subset of liquidity to backstop systemic risk
  • Implements cooldown periods on large withdrawals to prevent “bank runs”

3. OracleAggregator — The Deterministic Pricing Router

  • Integrates Pyth Network’s pull-based oracle for sub-second price updates
  • Validates price freshness, confidence intervals, and TWAP deviations
  • Multi-tier circuit breakers: Price Drop, Volume Spike, TWAP Deviation, Oracle Failure, Utilization, Emergency
  • Guardian-confirmed fallback oracle for decentralized failover

4. PositionToken (ERC-721) — Composable Position NFTs

  • Each open trade mints a fully transferable ERC-721 token to the trader’s wallet
  • Enables position transfers between wallets without closing trades
  • On-chain metadata reflects market, direction, entry price, and leverage
  • Enables future integration with lending protocols and secondary markets

5. MarketCalendar — TradFi-Aware Scheduling

  • Automatically pauses RWA markets during weekends and global holidays
  • Configurable per-market schedule (crypto markets run 24/7)
  • Prevents stale-price trading during off-hours

6. DividendManager — LP Yield Distribution

  • Manages protocol revenue distribution to liquidity providers
  • Automated dividend calculations and claims

7. TradingCoreViews — Read-Only Query Layer

  • Gas-optimized view functions for frontend data fetching
  • Aggregates position, market, and protocol state queries

Supporting Libraries (24 Specialized Libraries)

The protocol is built on 24 purpose-specific libraries ensuring separation of concerns:

Library Purpose
TradingLib Core trade execution logic
LiquidationLib Multi-tier liquidation engine
PositionMath 18-decimal precision calculations
FundingLib 8-hour funding rate settlements
FeeCalculator Dynamic maker/taker fee computation
CircuitBreakerLib 6-type circuit breaker system
OracleAggregatorLib Multi-source price aggregation
EmergencyPauseLib Emergency protocol pause mechanisms
EmergencyPriceLib Emergency pricing fallbacks
FlashLoanCheck Flash loan attack detection (30-block interval)
WithdrawLib Asynchronous withdrawal processing
ConfigLib Market parameter validation
MonitoringLib Protocol health monitoring
GlobalPnLLib Global PnL accounting
HealthLib Position health factor computation

Multi-Tier Order Engine

  • Market Orders: Instant execution using real-time Pyth oracles via keeper bots
  • Limit Orders: Automated “Increase” and “Decrease” orders executing at price targets
  • Stop-Loss / Take-Profit: Native triggers embedded in position metadata
  • Trailing Stops: Dynamic stop-losses that track favorable price action

Fully Tokenized Trading Positions (ERC-721)

Realyx pioneers fully tokenizing every trading position:

  • Transferable Alpha: Transfer open positions between wallets without closing
  • Composable DeFi: Standard NFTs integrate with lending protocols and secondary markets
  • On-Chain Metadata: Each token reflects market state, direction, entry price, and leverage

Security Architecture

Security is a core protocol pillar, embedded throughout every layer:

Access Control (Role-Based):

  • 7 distinct roles: ADMIN, OPERATOR, GUARDIAN, ORACLE, LIQUIDATOR, KEEPER, TRADING_CORE
  • Strict separation of privileges — keepers cannot modify parameters, guardians cannot execute trades

Circuit Breakers (6 Types):

  • PRICE_DROP — halts on extreme price movements
  • VOLUME_SPIKE — halts on abnormal volume patterns
  • TWAP_DEVIATION — halts when spot deviates from TWAP
  • ORACLE_FAILURE — halts on oracle staleness/confidence degradation
  • UTILIZATION — halts when vault utilization exceeds safe thresholds
  • EMERGENCY — manual guardian-triggered halt

Anti-Manipulation:

  • FlashLoanCheck enforces a 30-block minimum interval between position open/close
  • TWAP-based pricing prevents single-block manipulation
  • Pyth confidence interval validation rejects low-quality price data

Solvency Protection:

  • Insurance Fund with configurable target/minimum ratios
  • Multi-tier liquidation with escalating incentives (near-threshold → medium-risk → deeply-underwater)
  • Asynchronous withdrawal queue with cooldown periods
  • Bad debt tracking and claim system

Test Coverage:

  • 81 test files across 4 categories: Core (16), Security (4), E2E (1), Fuzz (1), plus scenario, mock, and wrapper tests
  • Coverage target: 90%+ maintained across all production contracts

Legal & Licensing

  • Smart Contracts: MIT License (open-source)
  • Regulatory Positioning: Realyx offers synthetic perpetual contracts — users never take custody of underlying RWAs. Positions represent price exposure only, settled in stablecoins.
  • Disclaimer: All RWA market names (e.g., TSLA, NVDA) represent synthetic price feeds from Pyth Network oracles. Realyx does not tokenize, custody, or offer securities.

Non-Functional Overview

  • Usability: Mobile-first responsive design featuring “One-Click” trading and real-time data updates.
  • Performance: Backend-indexed state allows the UI to load complex portfolios in <1.5 seconds. Server-side caching for global metrics (TVL, Volume, OI).
  • Reliability: Multi-provider oracle failover (Pyth → Guardian). Serverless-compatible architecture with REST polling fallback when WebSockets are unavailable.
  • Implementation: React + Vite frontend, Express + PostgreSQL backend, Solidity 0.8.24 smart contracts with Hardhat toolchain, automated keeper bot for order execution.
  • User Interface: Professional-grade trading terminal with TradingView-style charts, real-time position tracking, advanced order panels, and comprehensive portfolio analytics. Live demo: https://realyx.vercel.app

Total Budget

Grant Size Requested: $30,000

Budget Breakdown

Item Milestone Cost Details
Professional Smart Contract Audit MS1 $7,000 Third-party security firm
UI/UX v2.0 Overhaul MS1 $3,000 Professional redesign + responsive implementation
Bug Bounty Reserve MS1 $2,000 Community security testing program
Infrastructure (6 months) MS2 $3,000 Dedicated RPC nodes, PostgreSQL hosting, Vercel Pro
Liquidity Bootstrapping MS2 $4,000 Initial vault seeding + trading competition prizes
Marketing & Community Launch MS2 $3,000 Content creation, KOL partnerships, AMAs, social campaigns
Multi-Collateral Integration MS3 $3,000 USDT0/AxCNH smart contract integration + testing
Cross Margin Engine MS3 $2,000 Development + comprehensive testing
Copy Trading + Referral System MS3 $2,000 On-chain referral + social copy trading features
Contingency & Operational MS3 $1,000 Unforeseen costs, gas fees, tooling
Total $30,000

Development Roadmap

Milestone 1: Security & Polish (Month 1–2)

  • Deliverable: Professional Audit Report & UI v2.0 Launch
  • Requested Funding: $12,000
  • Focus: Remediating internal findings, optimizing the liquidation engine, and completing the high-performance UI overhaul
  • Verification:
    • Publicly accessible audit PDF on GitHub
    • GitHub repository with test coverage (verified via solidity-coverage)
    • Updated demo deployed at realyx.vercel.app

KPIs:

Metric Target
Audit findings (Critical/High) 0 unresolved
Test coverage ≥90%
Bug bounty participants 10+

Milestone 2: Mainnet Launch (Month 3–4)

  • Deliverable: Deployment on Conflux eSpace Mainnet & Liquidity Genesis
  • Requested Funding: $10,000
  • Focus: Launching the Vault with initial liquidity, listing 10+ markets, and initiating the first protocol trading competition
  • Verification:
    • All contracts verified on ConfluxScan Mainnet
    • Public liquidity dashboard showing real-time TVL
    • Trading competition

KPIs:

Metric Target
TVL $100,000+
Active markets 10+
Daily active traders 50+
On-chain transactions 1,000+/week

Milestone 3: Ecosystem Expansion (Month 5–6)

  • Deliverable: Multi-collateral Support, Cross Margin, Copy Trading & Referral Launch
  • Requested Funding: $8,000
  • Focus: Integration of USDT0/AxCNH collateral, launching the Cross Margin engine, social copy trading, and deploying the multi-tier on-chain referral system
  • Verification:
    • Multi-collateral deposits functional on mainnet
    • Referral tracking dashboard live
    • Copy trading feature operational

KPIs:

Metric Target
TVL $350,000+
Monthly active traders 200+
Active markets 15+
Referral signups 100+
Community members 4,000+

Decentralization Roadmap

Realyx is committed to progressive decentralization:

  1. Phase 1: Guardian Era (Current) — Oversight by the founding team and trusted ecosystem Guardians to ensure security during early growth.
  2. Phase 2: DAO Transition — Launch of the Realyx DAO for community-led parameter updates, asset listings, and treasury management.
  3. Phase 3: Full Autonomy — Protocol parameters and treasury fully controlled by smart-contract-based governance.

Risk Assessment & Mitigation

Risk Probability Impact Mitigation
Smart contract vulnerability Medium Critical Professional audit (MS1), bug bounty, 81-file test suite, circuit breakers
Oracle manipulation Low High Pyth confidence checks, TWAP validation, flash loan detection (30-block interval)
Low initial liquidity Medium Medium LP incentive program, initial vault seeding from grant funds, trading competitions
Regulatory uncertainty for RWA Medium Medium Synthetic contracts only (no custody), ComplianceManager for geo-restrictions, legal counsel
Solo developer risk Medium Medium Modular architecture enables parallel contributions, planned DAO contributor program, comprehensive documentation

Team

Amir M.P. — Founder, Lead Full-Stack Developer & Architect

  • Role: Lead Full-Stack Developer & Protocol Architect
  • Experience: Solidity developer with deep experience in DeFi protocol design, high-performance indexing systems, and full-stack web3 development. Proven track record on Conflux:
    • :trophy: Global Hackfest 2026 Winner (Realyx)
    • :trophy: 2x Conflux Bounty Winner
  • Technical Scope: Designed and implemented the entire Realyx stack — 40+ Solidity contracts, 24 libraries, React frontend, Express backend, PostgreSQL indexer, and automated keeper bot
  • GitHub: https://github.com/AmirMP12
  • Twitter/X: @AmirMP99

Planned Team Expansion

  • MS1: Onboard one UI/UX contributor for the v2.0 redesign
  • MS2: Onboard Marketing and Business development manager to support growth and partnerships
  • MS3: Open DAO contributor roles for frontend and SDK development

Terms of Use

I agree to all of the following terms of use in applying to a Conflux Ecosystem Grant:

  1. I have read and understood the Conflux Grants Ecosystem Overview.
  2. I have read about and understood that the Conflux Technical Grants are subject to a No-Sale rule.
  3. I agree to provide KYC information to the Conflux Foundation for the sake of overall ecosystem security.
  4. I understand that I will be required to follow public grant reporting requirements.

Dear @AmirMP ,

Thank you for submitting your application for the Realyx grant. I will review it in detail and follow up with any questions. You can expect to hear back from us on a decision timeline within the coming month.

Thanks again for your interest and for contributing to the Conflux ecosystem.

Best regards,

Máté
Head of Grants | Conflux Network

1 Like

Thanks for the response. The proposal has now been updated and I would appreciate it if you could review it at your convenience. Thank you

Realyx Protocol — V2

Proposal v2 — updated with expanded feature detail and official product links.

Where We Are

Hi @Mate_Conflux, It’s been more than two months since our first proposal, and we’ve been waiting on feedback throughout that period. Rather than stand still, we kept building. This V2 reflects the next steps for the protocol: an updated feature set delivered against our roadmap — and then some.

The protocol has matured well beyond the original scope, and we’re now completely ready to launch. Our immediate path is a testnet phase soon, followed by mainnet. The sections below document the full, current feature set that powers that launch.


Official Links

Surface URL Description
Landing realyx.xyz Marketing site, protocol overview, and onboarding entry point.
App app.realyx.xyz Trading interface — markets, positions, vault/LP, copy trading, referrals.
Docs docs.realyx.xyz Developer & user documentation, API reference, and integration guides.

Trading Engine

The TradingCore contract is the central upgradeable perpetual futures engine.

  • Perpetual futures on RWA and crypto markets, keyed by market address.
  • Configurable leverage per market, from 1x up to a hard ceiling of 100x (default/recommended start is 10x). Leverage stored as a 1e18-scaled value for full-range precision.
  • Margin model: cross-margin vs isolated-margin selected globally (crossMarginByDefault, default cross). Every position is stamped with the active flag; portfolio risk aggregation only spans cross-margin positions.
  • Long and short positions.
  • Minimum position size enforcement (rejects dust-sized positions).
  • Per-market trading gating (markets can be closed; see Market Calendar).
  • View helpers delegated to TradingCoreViews for richer reads.

Order Types & Execution

Order types (DataTypes.OrderType):

  • MARKET_INCREASE — open/increase at market (always mints a NEW position).
  • MARKET_DECREASE — reduce/close at market.
  • LIMIT_INCREASE — open/increase at a trigger price.
  • LIMIT_DECREASE — reduce/close at a trigger price.

Time-in-force directives (DataTypes.TimeInForce):

  • GTC — Good-Til-Cancel (default; rests on the book until filled or cancelled).
  • IOC — Immediate-Or-Cancel (any unfilled portion cancelled next keeper cycle).
  • FOK — Fill-Or-Kill (fully filled in one cycle or entirely cancelled).
  • POST_ONLY — placed only if it would not immediately execute (rejects if it would cross the book).

Advanced order features:

  • Reduce-only orders — guaranteed never to increase position size.
  • Bracket orders — stop-loss and take-profit prices applied automatically to the newly minted position when an increase order fills.
  • Iceberg ordersvisibleSize < sizeDelta fills only the visible slice per keeper cycle.
  • TWAP execution — sliced execution honoring a configurable twapInterval (minimum seconds between slices; default 30s).
  • Slippage protectionmaxSlippage / minReceive per order; deadline expiry checks.
  • Subaccount delegation — orders can be placed on behalf of a delegating owner who pays collateral and receives the position (foundation for copy trading).
  • Keeper-driven order execution (executeOrder) with on-chain price refresh via Pyth update data.

Position & Risk Management

  • Stop-loss, take-profit, and trailing stop (basis-points trailing) per position.
  • Keeper-executed stop-loss / take-profit triggers (executeStopLossTakeProfit, batched).
  • Health-factor model with tiered thresholds (near-risk, medium-risk, liquidatable).
  • Portfolio risk limits (PortfolioRiskLib) — aggregate cross-margin exposure checks; reverts on portfolio risk violations.
  • Flash-loan / same-block manipulation protection (FlashLoanCheck, commit-block minimums).
  • Position state machine: NONE → OPEN → CLOSED / LIQUIDATED.
  • Dust handling and cleanup utilities for residual positions/balances.
  • Global PnL accounting and protocol-health gating (blocks unsafe actions when unhealthy).

Liquidations

  • Keeper liquidation (liquidatePosition) and permissionless liquidation (liquidatePositionPermissionless).
  • Liquidation rewards paid to liquidators; keeper fee accrual and withdrawal.
  • canLiquidate view returning liquidatable status and health factor.
  • Liquidation-specific collateral haircuts.
  • Liquidations refuse to run against an active manual price override (oracle-override safety).
  • Bad-debt detection and routing to the insurance tranche when collateral is insufficient.

Funding

  • Periodic funding with an 8-hour funding interval.
  • Configurable cap on funding intervals settled per call (setMaxFundingIntervals) so dormant/paused markets can be caught up by a guardian.
  • Funding accrual integrated into position health and PnL.

Collateral

  • Canonical USDT0 settlement collateral path (6 decimals). USDT0 is the protocol’s main settlement asset.
  • Current state: only USDT0 is active for trading. Alt-collateral open/close/liquidate is intentionally disabled (AltCollateralDisabled) pending an end-to-end fee + repay redesign — other tokens can be registered but are not yet tradeable as margin.
  • CollateralRegistry — a basket of collateral tokens (for future multi-collateral support) with:
    • Dynamic per-token haircuts (base, liquidation, max cap).
    • Utilization-based and volatility-based haircut adders.
    • Per-token oracle-based valuation.
    • Per-token maximum protocol exposure caps.
    • Smart routing hooks (CollateralRouterLib).
  • Supported collateral types enumerated (DataTypes.CollateralType): USDC, USDT0, AXCNH, MULTI.

Vault, LP & Insurance

VaultCore is a unified USDT0 vault.

  • LP liquidity provision — deposit USDT0, mint shares; share-based accounting with dead-shares anti-inflation protection and minimum initial deposit.
  • Provides borrow/repay liquidity to TradingCore (borrow/repay hooks).
  • Insurance tranche — separate insurance deposits to absorb bad debt.
  • Bad-debt governance — claim lifecycle with approval, rate limiting, and a dedicated insurance-fund circuit breaker.
  • Withdrawal queue — cooldown-gated withdrawal requests, batched processing (with gas-per-withdrawal and batch-size bounds).
  • Utilization caps, per-market and per-collection exposure caps, and reservation buffers.
  • Emergency mode (bounded to a max duration, default 7 days) with escape timelock.
  • LP-exit safety: blocks exits when trader PnL cannot be fully priced (unreadable oracle on an OI-bearing market).
  • Slippage protection on deposits/withdrawals; donation accounting (recordDonation).
  • 48h timelocks for sensitive setters (setTradingCore, treasury changes).

Oracle & Price Integrity

OracleAggregator — Pyth-backed, per-market pricing.

  • Primary source: Pyth price feeds per market address.
  • Optional secondary source (RedStoneAdapter) for an independent cross-check covering crypto + RWA on Conflux eSpace. When no secondary is wired (the default), behaviour is single-source and MIN_ORACLE_SOURCES is 1.
    • Per-market opt-in (setCrossCheckEnabled) with configurable max deviation (crossSourceMaxDeviationBps); reverts DeviationTooHigh on divergence.
    • Secondary wrapped in try/catch so a faulty feed degrades to single-source cleanly.
    • RedStone pull-oracle model with keeper-pushed, on-chain-verified (≥3 unique signers) cached prices.
  • TWAP ring buffer with warm-up minimum data points; TWAP-vs-spot deviation guards on open/close/liquidate.
  • Per-feed staleness and confidence gates.
  • Sequencer uptime / grace-period checks.
  • Reports a valid source count (1 or 2) for future multi-source raises of MIN_ORACLE_SOURCES.

Circuit Breakers & Emergency Controls

  • Breaker types (DataTypes.BreakerType): PRICE_DROP, VOLUME_SPIKE, TWAP_DEVIATION, ORACLE_FAILURE, UTILIZATION, EMERGENCY.
  • Breaker states: INACTIVE → TRIGGERED → COOLDOWN, with configurable windows and cooldowns.
  • Emergency manual price override — guardian-set, quorum + 24h delay, short-circuits all other oracle logic.
  • Global pause and per-market emergency pause (EmergencyPauseLib).
  • Insurance-fund circuit breaker in the vault.

RWA-Specific Features

  • MarketCalendar — trading hours and holidays per RWA market:
    • Open/close times with timezone offsets.
    • Per-day-of-week trading-day flags.
    • Holiday calendar.
    • 24x7 market support.
    • getNextOpenTime lookahead (guards against all-days-closed misconfiguration).
  • Markets can be gated closed; trades revert with MarketClosed outside trading windows.
  • RWA-contracts timelock surface for sensitive RWA configuration changes.

Dividends / Corporate Actions

DividendManager — corporate actions for RWA markets.

  • Cumulative-index dividend model: longs receive dividends, shorts pay.
  • Per-share distribution with precision-floor (MIN_DIVIDEND_PER_SHARE) and ceiling (MAX_DIVIDEND_PER_SHARE) sanity bounds.
  • Rolling-window distribution cap (maxDividendPerWindow) to bound the blast radius of a compromised manager role.
  • Settlement integrated into position close/PnL (DividendSettlementLib).
  • DividendKeeper — trusted keeper to trigger distributions from off-chain corporate-action data.

Social / Copy Trading

CopyRegistry — on-chain registry for social copy trading.

  • Lead traders self-register with a profit-fee percentage (capped at 20%) and metadata URI.
  • Copiers signal follow via on-chain events to drive the off-chain CopyBot.
  • Non-custodial: copier funds stay in their own TradingCore balance; the CopyBot operates as a subaccount mirroring orders. No funds are pooled.
  • Lead-trader draining/deregistration with batched copier cleanup.
  • Profit-fee settings stored on-chain; fee claims handled by the backend engine.

Referral Program

ReferralRegistry — on-chain referral hub.

  • Affiliates claim human-readable, case-insensitive codes (4–16 chars).
  • Traders bind once to a referrer code.
  • Tiered fee structure — volume thresholds unlocking discount (trader) and rebate (affiliate) basis points.
  • On-chain tier progression: per-trade volume fed back from TradingCore, with O(1) lookups and cached qualified tiers.
  • Self-referral blocked; code transfers allowed for key rotation.

Compliance

AllowListCompliance (implements IComplianceManager).

  • Admin-managed whitelist of permitted addresses.
  • Country/jurisdiction blocking per address.
  • Batch whitelist updates.
  • TradingCore enforces compliance checks on entry (ComplianceCheckFailed).

Keeper Network & Automation

KeeperNetwork module coordinating automation.

  • Executes pending orders with bundled Pyth price-update data.
  • Executes batched stop-loss / take-profit triggers.
  • Drives liquidations (keeper and permissionless paths) with pre-liquidation oracle refresh.
  • Keeper fee accrual and withdrawal.
  • Pausable, role-gated, reentrancy-guarded.

Position NFTs

PositionToken — ERC721 representing trading positions.

  • Each open position is a transferable NFT.
  • Transfer hooks update exposure/ownership tracking in TradingCore.
  • Per-owner position enumeration.
  • Contract-recipient whitelist for safe transfers.
  • Transfer fees intentionally disabled (machinery retained for future use); minting restricted to canonical mint path.

Upgradeability & Governance

  • Core contracts are UUPS upgradeable (TradingCore, VaultCore, OracleAggregator, CopyRegistry, DividendManager, MarketCalendar, PositionToken, ReferralRegistry, compliance, keepers).
  • 48-hour upgrade timelock on implementation changes (propose → wait → execute), with proposal/cancel events.
  • Linked-library changes are treated as security-critical as implementation upgrades and go through the same timelock.
  • Role-based access control (AccessControlled base, OpenZeppelin AccessControl) with dedicated roles (operator, trading-core, manager, minter, upgrader, distributor, keeper, etc.).
  • Storage gaps reserved for future upgrade safety.
  • RedStoneAdapter intentionally non-upgradeable (hot-swappable peripheral via setSecondarySource).

Backend & Infrastructure

Express + TypeScript API layer over indexed on-chain data.

Indexing engine:

  • Reorg-aware, idempotent chain indexer (single DB writer worker) into PostgreSQL.
  • SQL-based volume metrics: cumulative volume, sliding-window 24h volume, per-market volume.
  • Indexed event store for leaderboards and history.

REST API (/api, mirrored under /api/v1):

  • Markets (OI, funding, price hints) and per-market price history.
  • User open positions and trade history.
  • Protocol stats (totalMarkets, volume24h, totalOpenInterest, totalLiquidations) and daily metric history.
  • LP real-yield breakdown — APR by source (borrow/trading fees, funding, liquidations) + 30d APR history.
  • Public transparency / status feed — overall and per-component health (oracle, RPC, indexer, vault), uptime, vault solvency & insurance-fund metrics.
  • Leaderboard by volume/PnL.
  • Insurance / bad-debt claim events.
  • On-chain referral stats per wallet.
  • Pyth price refresh and manual index sync endpoints.

Copy-trading social API (/api/v1/social): top traders by ROI, trader profiles, copier following lists, aggregated copied PnL, cache refresh.

Auth & internal:

  • EIP-712-signed tiered API keys.
  • Keeper-failure webhook (broadcast to user WebSocket) + historical keeper failures.
  • Guarded debug/diagnostics and sync endpoints.

Real-time & ops:

  • Native WebSocket broadcaster for live updates.
  • Read-through response cache (Redis or in-process LRU+TTL) with single-flight de-dup.
  • Read-replica routing for heavy reads; health-routed RPC pool with automatic failover.
  • Prometheus metrics on a separate internal port; liveness/detailed health endpoints.
  • Graceful shutdown for clean rolling deploys.
  • Deployable via Docker, Kubernetes, or Railway (separate API / indexer / WebSocket services).

Realyx — RWA perpetual futures on Conflux eSpace. Landing: realyx.xyz · App: app.realyx.xyz · Docs: docs.realyx.xyz

Thank you for submitting your project’s proposal to the Conflux Grant Program. Unfortunately, your proposal did not pass the grant committee’s decision. We greatly appreciate the effort and innovation behind your project, and we encourage you to keep exploring future opportunities within the Conflux ecosystem.