# Paper trade on Devnet

## For Developers

Go to the [README](https://github.com/OptiFi-Team/optifi-sdk/blob/dev/README.md) file in the optifi-sdk repo. It includes test scripts for trading options and running an OMM on OptiFi exchange.&#x20;

## For Users

* [Trading Options](#trading-options)
* [Stake to Earn on OMM](#stake-to-earn-on-amm)

### Trading Options

1\. Firstly, you will need [Sol Faucet](https://solfaucet.com/) to explore OptiFi Devnet. Simply enter your address and click **DEVNET** button to get fake SOL.

2\. Go to [OptiFi homepage](https://www.optifi.app/):

![](https://1179375515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHtSx0tled0WtDBZ2uaLl%2Fuploads%2FsFtUoW9zh8Vsr7hf1Obn%2Fimage.png?alt=media\&token=6c59db99-be47-4d1c-ae68-7de898dee110)

3\. Click [Start Trading](https://devnet.optifi.app/options) button to launch app. You should be able to see the following page:

![](https://1179375515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHtSx0tled0WtDBZ2uaLl%2Fuploads%2FidmysuvBq8TZeNr5x7HU%2Fimage.png?alt=media\&token=c7ee18a8-d1d5-453c-b7b9-312fbfac96a5)

4\. Click **Select Wallet** button. Connect your Solana Wallet such as [Phantom](https://phantom.app/) or [Solflare](https://solflare.com/), and please check you are in the **Devnet** Network.

![](https://1179375515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHtSx0tled0WtDBZ2uaLl%2Fuploads%2FS8zHaHg5s4CWEAXGD8Rz%2Fimage.png?alt=media\&token=29b7b768-106f-49c6-a2ed-ee6c52d52b00)

5\. Deposit some USDC to the user's margin account by clicking the **Deposit** button, and enter the amount to deposit. For testing USDC airdrop, click the **Get USDC** button, and you will get 100,000 USDC deposited. And you can click the **Withdraw** button to get USDC tokens back to your wallet.

![](https://1179375515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHtSx0tled0WtDBZ2uaLl%2Fuploads%2FLJ61AK1J51R8kGB78u9W%2Fimage.png?alt=media\&token=e9cf6248-d93c-4ca1-a2e2-0b17aaeb5a98)

6\. Select an underlying asset such as BTC, and pick an instrument (a call option or put option) in the list to trade

![](https://1179375515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHtSx0tled0WtDBZ2uaLl%2Fuploads%2FpKDBftFdVtbGy8j5q06X%2Fimage.png?alt=media\&token=77d89be4-0d10-43b8-8f18-44e48aaad39b)

7\. Enter the order size and price, confirm in the pop-up window, and then approve the transaction in your wallet. Please note that you need to approve multiple transactions if it’s your first time to trade on the select market. Please wait for a minute to proceed with initializing the data.

![](https://1179375515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHtSx0tled0WtDBZ2uaLl%2Fuploads%2F58CpjhnckJBMMrDHEmcL%2Fimage.png?alt=media\&token=393a037c-749b-4764-9444-e2bbfd0d8f8f)

8\. You should be able to see the order under the **Open Orders** tab if it has not been filled, and you can cancel an order by clicking the **Cancel** button.

![](https://1179375515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHtSx0tled0WtDBZ2uaLl%2Fuploads%2F27sGEP7cT95zpXrXL4SE%2Fimage.png?alt=media\&token=182f08b4-10e1-4c41-b33d-797db62ea1f3)

9\. If the order is filled, you should be able to see your positions under the **Positions** tab.

![](https://1179375515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHtSx0tled0WtDBZ2uaLl%2Fuploads%2FEwtePc1YJlhVDmcbohHW%2Fimage.png?alt=media\&token=8f4b4ab1-ae02-4867-ba8b-539e856044b6)

10\. And you can retrieve your USDC and instrument tokens back once your order is filled by clicking the **Settle All** button under the **Unsettled Funds** tab. Or you can choose to do nothing and passively wait for settlement to be done by our OptiFi crankers.

![](https://lh5.googleusercontent.com/xl6CE790Vf2sqEUHLfAWIbm6DGdoRq-txuHb42wNtj3kMbiX6O3RbIwNj_bq_r-Uzs58_mFmX9tXF1WM1vMlK_WnkUImmSL_moG1ypSdECcJu1lIh-VF-fTieu5SAljgJO-AJjZ8)

11\. You can see all your transactions in the **Order History** at the bottom of page.

![](https://lh4.googleusercontent.com/YwyJIDdH4X0L2Gp7KOeaCz1H0klvaFrQuuF1dpieJ9hCdFJeUNTunH9qnlojWOSKhwdwGZH_pJbHyAoRewDj2fFBs9BQd0VOxESWq0VYaiM2t78dYqS9o_k1HMyRsKE0qjDmJ7_d)

12\. When you have long/short positions for an option, you can just wait for the expiry to come, and the OptiFi crankers will execute the fund settlement automatically for all users.

### Stake to Earn on OMM

Users can also stake USDC to OMM vaults to earn profits:

1\. Click the hamburger button at the top left of the homepage, and select OMM. It will redirect you to the [OMM page](https://devnet.optifi.app/amm).

![](https://1179375515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHtSx0tled0WtDBZ2uaLl%2Fuploads%2FP6RaPSuvZIVVp0IsnCBU%2Fimage.png?alt=media\&token=ca32ecec-eac7-4466-af5a-c0ec8f1c4d7d)

2\. At the left hand side, you can choose either the OMM which trades BTC options or the one trading ETH options. Select **Deposit** to proceed.

![](https://lh6.googleusercontent.com/7NNp4HKMSzh3udcd9Dmp144jA3lX-zNDij6cecraMRLQT3E7dGAzcJF8gSkg5i1P3mw1bgPQCJfHylhdVBpALkn2awwrsSuA_uk5V29HHMczVqYrd3dNxW4zMGbTxn90JB1wsrM8)

3\. After deposit, you will receive some LP tokens representing your shares of the OMM pool. And you can check the transition record in the **Transaction History** table.

![](https://lh5.googleusercontent.com/Bdmmv27fADxramc_shCzJ_c7BKPwrK81L20gE6NPK_37_bPEkclTjEBDsbyxUOk2JmykjFyLNzCUe8D14Rxr-_8BLn-qevAscm_8ilF6LuIYzDrt3Aw2pLLojBT0YlJXWZ4UWJQV)

4\. The OMM will use the fund in its liquidity pool to trade options on markets, and make profits from it. When you want to withdraw your liquidity from the OMM pool, you can go to the **Withdraw** section and enter the amount to withdraw. It will burn your LP tokens and send USDC tokens back to your wallet according to the amount of burned LP token.

![](https://lh5.googleusercontent.com/ymoeB2VuSJRGScU5vlSWJ_woCipp1mn5PiX5TSsbKKCLHW7bOF6t2mRnQO1qGX7flpTJLy2r3ISLV0dm0Y0jgdjba4b1-IfH9yu1-lZgzyBryvDyVJj-Mq_hvKiENqfqHs63JOaV)
