Skip to content

Latest commit

 

History

244 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stability Nexus Fate Protocol

 

Static Badge

Telegram Badge    X (formerly Twitter) Badge    Discord Badge    Medium Badge    LinkedIn Badge    Youtube Badge

OpenSSF Scorecard


Fate Protocol

Fate Protocol is a decentralized, perpetual prediction market that operates continuously without expiration. It replaces traditional order books with a dual-vault system—where users buy and sell bullCoins and bearCoins—enabling speculation on market trends in a fluid, always-on ecosystem.

Built with cutting-edge Web3 technologies, Fate Protocol delivers high-performance trading experiences with gas-optimized smart contracts and pluggable oracles connected through adapters.

✨ Key Features

  • Perpetual Market: No expiration dates; users can enter or exit positions at any time
  • Dual-Vault System: Separate vaults for bullCoins and bearCoins, eliminating order book complexity
  • Dynamic Fee Structure: Fixed fees on transactions automatically balance vault reserves
  • Rebalance: Anyone can call rebalance() to move reserves between the vaults from the oracle value
  • Self-Balancing: Automated fund redistribution between vaults based on market movements
  • Multi-Chain Ready: Runs on any EVM chain with a deployment; live on a testnet today
  • Pluggable Oracles: Oracle values connect through oracle adapters
  • Gas-Optimized Contracts: Efficient smart contract design minimizes transaction costs

🎬 Video Tutorials

1. Protocol Walkthrough: Fate Protocol Walkthrough

2. Interaction Tutorial: Fate Protocol Interaction Walkthrough

Technical Architecture

Frontend

  • Next.js 15, statically exported, so the whole app runs in the browser
  • TypeScript for type safety
  • TailwindCSS with shadcn/ui components
  • Framer Motion for animations
  • Recharts for data visualization

Blockchain

  • Wagmi v2 for Web3 hooks
  • Viem for lightweight blockchain calls
  • WalletLink (@stability-nexus/walletlink) for wallet connection via EIP-6963, no relay or projectId
  • TanStack React Query for data sync

Smart Contracts

  • Networks: Testnet today, see Deployed Contracts
  • Oracles: Any IOracle, through adapters
  • Gas-Optimized: Minimal transaction costs
  • Fixed Fees: Fee rates are set per pool at creation

Performance Features

Frontend Optimizations

  • Static Export: No server; every contract read and write runs in the browser
  • Code Splitting: Automatic route-based splitting
  • Static Generation: Pre-built pages for faster loads

User Experience

  • Skeleton Screens: Immediate loading feedback
  • Optimistic Updates: Instant UI updates
  • IndexedDB: Local storage for offline capability
  • Mobile Optimized: Responsive touch interactions

Supported Networks

Live on the Sepolia testnet. Any other EVM chain needs a deployment first, listed in Deployed Contracts.


Deployed Contracts

The app uses these contracts on Sepolia (src/utils/addresses.ts):

Contract Address Etherscan
PredictionPoolFactory 0x6935432472c180238703805f9809639439b783b6 View
ChainlinkAdapterFactory 0xe6afb97bab25bb9623246cc18ce624a9821cc2bd View
NativeCurrencyHelper 0x9198c4332845aba314f164be73a00619abb46606 View

The full record, with deploy blocks and constructor arguments, is Deployments.md in Fate-Solidity.


Getting Started

Prerequisites

  • Node.js 18+
  • npm/yarn/pnpm
  • MetaMask or any other web3 wallet browser extension

Installation

1. Clone the Repository

git clone https://github.com/StabilityNexus/Fate-EVM-Frontend.git
cd Fate-EVM-Frontend

2. Install Dependencies

Using your preferred package manager:

npm install
# or
yarn install
# or
pnpm install

3. Run the Development Server

Start the app locally:

npm run dev
# or
yarn dev
# or
pnpm dev

4. Open your Browser

Navigate to http://localhost:3000 to see the application.

Test, lint and build

npm test        # unit tests (vitest)
npm run lint    # ESLint
npm run build   # static export to out/, also the type check

npm run build and npm run dev share distDir: "out". After a build, delete out/ and .next/ before going back to npm run dev, or dev will fail on the export artifacts.


Project Structure

src/
├── app/                  # Routes
│   ├── [pool]/            # Pool interactions
│   ├── createPool/        # Pool creation
│   ├── explorePools/      # Pool discovery
│   └── portfolio/         # User portfolio
├── components/             # UI components
│   ├── Explore/          # Pool exploration
│   ├── FatePoolCard/     # Pool cards
│   ├── Forms/            # Form components
│   └── ui/               # Base components
├── lib/                  # Contract Interaction logic
└── utils/                # Utilities & configs
    ├── abi/              # Contract ABIs
    └── chains/           # Chain configs

Deployment

GitHub Pages

  1. Push to main branch
  2. GitHub Actions auto-deploys
  3. Available at GitHub Pages URL

Manual Build

npm run build
npx serve out   # serve the static export

Contributing

We welcome contributions of all kinds. See CONTRIBUTING.md for development setup, coding style, and the pull request process.

Questions and ideas are welcome in our Discord channel. If you hit a bug, please open an issue with clear steps to reproduce and any relevant logs or screenshots.

© 2025 The Stable Order.

Sponsor this project

Contributors

Languages