Inspiration

We wanted to explore what decentralized derivatives could look like on a chain purpose-built for oracles. æternity’s built-in oracle mechanism, micro-block architecture, and near-instant confirmations make it perfect for event-driven markets. While most prediction markets mimic Polymarket’s categorical yes/no style, we thought: what if traders could bet on whether a price touches a level or races between barriers-just like real barrier options on Wall Street? That challenge, and the lack of modern tooling for Sophia smart contracts, became our inspiration.

What it does

AERace is a live on-chain platform for touch and race markets-think binary options that settle when a price barrier is hit. Users can: • Connect an æternity wallet and view active markets • Place “Touch Up” or “Touch Down / No-Touch” bets on short-term outcomes • Watch odds and pool sizes update dynamically • Claim payouts when the oracle settles the market

Owners can launch new markets, configure oracle fees, and trigger settlement through an integrated oracle responder. Everything runs against real æternity testnet contracts in real time.

How we built it

We combined a Sophia v6 smart-contract stack with a React + TypeScript frontend powered by the æpp SDK v13. • The core contracts (BarrierOptions and ExchangeOracle) handle market creation, bet pooling, and oracle-driven settlement. • AEproject was used for local compilation and deployment; we had to pin Node 16 and Docker images to stay compatible with the legacy compiler. • The frontend implements wallet detection, contract guards, and dynamic odds math, and visualizes live market data from CoinGecko APIs. • A small Node.js oracle responder simulates off-chain price feeds and posts responses back to the contract.

We also built a bootstrap script that seeds demo markets and liquidity so judges can see live pools immediately.

Challenges we ran into • Wrestling with older Sophia syntax—no emit, indentation errors, and the need to rewrite everything with datatype event + Chain.event. • Managing compiler mismatches between AEproject v5 and the newer SDK v13. • Debugging wallet injection loops and “compiler not ready” errors in browser contexts. • Integrating legacy FATE 6 contracts into a modern React pipeline while maintaining type safety. • Designing a clean UX that hides blockchain latency behind responsive UI feedback.

Accomplishments that we’re proud of • A fully functional, testnet-deployed barrier-options engine built entirely in Sophia. • Seamless wallet integration and on-chain settlement demonstrated live. • Automatic market bootstrapping and oracle simulation for hackathon demos. • A polished trader-first UI that feels like a real exchange, not a developer sandbox. • Overcoming multiple compiler and SDK version conflicts in less than 48 hours.

What we learned • æternity’s oracle system is exceptionally well-suited for financial primitives when you structure the TTL and fee logic carefully. • Legacy compilers can still be powerful if you respect their syntax constraints. • Building UX around blockchain readiness (wallet → compiler → contract guards) massively improves reliability. • Collaboration between product, contract, and frontend layers is crucial when every bug might originate in a different runtime. • We gained a deeper understanding of barrier-option math and how to express it in a trustless environment.

Mathematically, we modelled payoff as a binary function

P(x, B) = \begin{cases} 1, & \text{if } \exists t \le T: S_t \ge B \ 0, & \text{otherwise} \end{cases}

where S_t is the asset price and B the barrier—mirroring traditional one-touch options but settled via oracles.

What’s next for AERace • Live oracle feeds: integrate the oracle responder with real-time AE/USD data. • Multi-asset expansion: support BTC, ETH, SOL, and other markets natively. • Analytics dashboards: show pool depth, odds evolution, and user P&L curves. • Mainnet deployment: migrate contracts to production with verified sources on æScan. • DeFi composability: open the protocol for liquidity providers and market-making bots.

Our end goal is to make AERace the foundation for a full suite of on-chain derivatives—fast, transparent, and oracle-powered on æternity.

Built With

Share this project:

Updates