Fermi DEX- Docs
  • ๐Ÿ‘‹Intro to Fermi
  • Overview
    • ๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธVision
    • ๐Ÿ’กWhat we do
    • โœจFermi DEX: Features
    • ๐Ÿˆโ€โฌ›Background
  • Fermi DEX Usage Guide
    • Fermi DEX: How it works
      • ๐Ÿ“ชPosting a Limit Order
      • โœ…Finalizing Orders
      • ๐Ÿ”„Withdrawing Funds
    • ๐Ÿ› ๏ธGetting set up
      • ๐Ÿ“Getting tokens
      • ๐Ÿ”ซTrobleshooting
    • ๐ŸชTransfer Hooks Redefined
    • Custom settlement periods
  • Technical Overview
    • Overview v0.2 (DEPRECATED)
    • Technical Overview v1
      • Market Addresses (Devnet)
      • Key Structs
      • Instructions
      • Events
      • SDK
    • ๐ŸšงArchitecture
      • ๐Ÿ‘ฝJust In Time Liquidity
      • ๐ŸคMatching Logic
      • ๐Ÿ›ธLiquidity Abstraction
      • ๐ŸŒŠLiquidity Management Programs
    • ๐ŸงชTesting Locally
    • ๐Ÿ•น๏ธDemo - Fermi v0.2
    • ๐Ÿ“ฝ๏ธDemo - Fermi v1
    • ๐Ÿ“‡Github, Devnet Programs and PDAs
    • ๐Ÿ‘ฉโ€๐ŸŽคActors and Incentives
  • Use cases & Benefits
    • ๐Ÿ–‡๏ธLower Slippage than traditional DEXes
    • โ›๏ธPortfolio Margining Strategies
    • ๐ŸMarket Making on Fermi DEX
  • About us
    • ๐Ÿ‘‹Meet the Team
    • ๐Ÿ›ฃ๏ธRoadmap
    • ๐Ÿš“Next Steps
Powered by GitBook
On this page
  • Core Orderbook Functionality
  • UI Integration
  1. Technical Overview

Testing Locally

End to end tests of the Fermi DEX programs can be performed using anchor CLI

PreviousLiquidity Management ProgramsNextDemo - Fermi v0.2

Last updated 1 year ago

Core Orderbook Functionality

To test out the full functionality of Fermi DEX, you can simply follow the following steps. Below, we deep dive into each test and the steps it demonstrates.

First, in a separate terminal, run the solana local validator: solana local validator

Next, in another terminal, enable logs. This is not mandatory but would better allow you to see the execution steps of different tests in real time.

solana logs

Finally, clone the repo and run the tests!

git clone https://github.com/cryptohariseldon/Fermi-orderbook/
yarn
anchor build
anchor test --skip-local validator

This executes 5 tests, providing broad coverage of all the essential functionalities in the lifecycle of a trade. In particular, you can see that the trade creation, and trade finalisation proceeds successfully by monitoring logs on the local validator, and/or checking values of the OpenOrdersPDA for each user involved, before and after finalisation.

UI Integration

First, run the development server:

npm run dev or yarn run dev

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

To run your own version of the Fermi DEX UI, follow the following steps: First, clone the repo:

Open with your browser to see the result.

can be accessed on . This endpoint can be edited in pages/api/hello.ts

The pages/api directory is mapped to /api/*. Files in this directory are treated as instead of React pages.

๐Ÿงช
https://github.com/adarshzpatel/fermi-frontend
http://localhost:3000
API routes
http://localhost:3000/api/hello
API routes