# Testing Locally

## 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.&#x20;

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.\ <br>

<figure><img src="/files/bYLXLXp1mIGAQxqqJKx2" alt=""><figcaption></figcaption></figure>

## UI Integration

To run your own version of the Fermi DEX UI, follow the following steps:\
First, clone the repo: <https://github.com/adarshzpatel/fermi-frontend>

First, run the development server: &#x20;

`npm run dev or yarn run dev`

Open [http://localhost:3000](http://localhost:3000/) with your browser to see the result.

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

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on <http://localhost:3000/api/hello>. 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 [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fermi-dex.gitbook.io/fermi-dex-docs/technical-overview/testing-locally.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
