# How to Start/Stop Order with Smart Contract

You are trading on the decentralized Godex.ai exchange which allows you to interact Start/Stop directly on the Arbitrum blockchain environment through Smart contract.

## Connect your wallet to Smart Contract

**Step 1:** Go to Godex smart contract via link - <https://arbiscan.io/address/0x2CF0a497b743472934470DaE958E81e629E92762>

<figure><img src="https://234186546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHuzJPIYAnv7s2C7QujEW%2Fuploads%2FMxfr625LLZBsB6A1DVLk%2FScreenshot%202024-11-12%20at%2016.43.02.png?alt=media&#x26;token=1b46d8ec-6e4e-417d-bb05-ca1b98c9bc79" alt=""><figcaption></figcaption></figure>

**Step 2:** Connect your wallet (Use the wallet You are trading on Godex)

<figure><img src="https://234186546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHuzJPIYAnv7s2C7QujEW%2Fuploads%2FU8va3jB7nJKbRwfSsvE0%2FScreenshot%202024-11-12%20at%2016.44.58.png?alt=media&#x26;token=ca3874ef-78a2-4834-bf58-741158ffbbc8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://234186546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHuzJPIYAnv7s2C7QujEW%2Fuploads%2FXPe9cq9rG6eRFgbVw5RT%2FScreenshot%202024-11-12%20at%2016.46.01.png?alt=media&#x26;token=768217e4-af6d-420f-ae9b-9d460492f055" alt=""><figcaption></figcaption></figure>

#### After connecting your wallet, you have become the ownership of Godex and have full rights to use it.

## Lesson 1: Create a transaction order

**Step 1:** Find the createOrder (0xaba8b0e8)

<figure><img src="https://234186546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHuzJPIYAnv7s2C7QujEW%2Fuploads%2FUJWr8NYdJ5NSWedMTAKz%2FScreenshot%202024-11-12%20at%2016.53.50.png?alt=media&#x26;token=3ff58db1-1700-426c-bc52-92194ff6a61c" alt=""><figcaption></figcaption></figure>

The parameters are as follows:

<table data-header-hidden><thead><tr><th width="168"></th><th></th></tr></thead><tbody><tr><td>amountIn</td><td>Investment amount in USDT  + 6 "0" digits (Ex: $500 = 500000000 digits</td></tr><tr><td>amountOutMin</td><td>0</td></tr><tr><td>path</td><td>["0xCC233302FC4116B0926d0BEDbc9A86fD7Ee113A6","0x4c0DeD3A1fCB7697Ad57c558Bfe55a5B41d453A6"]</td></tr><tr><td>to</td><td>Your wallet address</td></tr><tr><td>deadline</td><td><a href="https://www.epochconverter.com">https://www.epochconverter.com</a>: Get current timestamp in seconds (10 digits)</td></tr></tbody></table>

<figure><img src="https://234186546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHuzJPIYAnv7s2C7QujEW%2Fuploads%2F0vPFLkAoxxub0hMwQ1PS%2FScreenshot%202024-11-12%20at%2016.59.00.png?alt=media&#x26;token=c09b4871-18fa-4029-9a8d-db866d120665" alt=""><figcaption><p>Timestamp: is the time for you to decide to place an order. +10,000 seconds will ensure you operate for a long time.</p></figcaption></figure>

<figure><img src="https://234186546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHuzJPIYAnv7s2C7QujEW%2Fuploads%2Fin9yk4grRtCdGmauCYVM%2FScreenshot%202024-11-12%20at%2017.04.43.png?alt=media&#x26;token=0440aaa0-d91b-4f74-975f-a7aba8d390de" alt=""><figcaption></figcaption></figure>

<figure><img src="https://234186546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHuzJPIYAnv7s2C7QujEW%2Fuploads%2FtAWDtWqnhehuevt61A4R%2FScreenshot%202024-11-12%20at%2017.09.30.png?alt=media&#x26;token=8c1eebb2-2b4d-42b3-8dfa-e787754452a0" alt=""><figcaption></figcaption></figure>

## Lesson 2: Stop order

* **Step 1:** You need to find out where the newly created order is located in the blockchain.&#x20;

<figure><img src="https://234186546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHuzJPIYAnv7s2C7QujEW%2Fuploads%2FbRK8cg0ohgyYxyyZCJ8F%2FScreenshot%202024-11-12%20at%2017.13.45.png?alt=media&#x26;token=a5c3952c-fd27-4def-b063-ecad6c899611" alt=""><figcaption></figcaption></figure>

<table data-header-hidden><thead><tr><th width="133"></th><th></th></tr></thead><tbody><tr><td>address</td><td>Your wallet address</td></tr><tr><td>page</td><td>0</td></tr><tr><td>limit</td><td>10000</td></tr></tbody></table>

* **Step 2:** As of now I have 432 records. The $500 order I just created in the previous step is at order number 432.&#x20;

You need to pay attention to the bold parameters.

\[0xFb1a5c554731D2Fc73b340d4c478928231edF820,400000000,6000000000,0x4c0DeD3A1fCB7697Ad57c558Bfe55a5B41d453A6,500000000,**127897525906806751853**,0,0,**500000000**,0,**273658895**,0,0]]

\["address", "stopLoss", "takeProfit", "gdAddress", "amountIn", "amountOutStart", ""]

**amountOutStart:** Amount of collateral tokens received when creating an order

* **Step 3:** When we have enough information about the Order. We go back to Write as Proxy to Stop the Order.

<figure><img src="https://234186546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHuzJPIYAnv7s2C7QujEW%2Fuploads%2FfFBxZsVjRbsPjGnxTNVY%2FScreenshot%202024-11-12%20at%2017.24.22.png?alt=media&#x26;token=f137cd58-a752-4d2a-88f1-240e70093201" alt=""><figcaption></figcaption></figure>

<table data-header-hidden><thead><tr><th width="168"></th><th></th></tr></thead><tbody><tr><td>amountIn</td><td>Investment amount in GDX collateral token (Ex: <strong>127897525906806751853)</strong></td></tr><tr><td>amountOutMin</td><td>0</td></tr><tr><td>path</td><td>["0xCC233302FC4116B0926d0BEDbc9A86fD7Ee113A6","0x4c0DeD3A1fCB7697Ad57c558Bfe55a5B41d453A6"]</td></tr><tr><td>to</td><td>Your wallet address</td></tr><tr><td>deadline</td><td><a href="https://www.epochconverter.com">https://www.epochconverter.com</a>: Get current timestamp in seconds (10 digits)</td></tr><tr><td>index</td><td>Order number of the order being traded that needs to be Stopped <br>(ex: 430)</td></tr></tbody></table>

<figure><img src="https://234186546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHuzJPIYAnv7s2C7QujEW%2Fuploads%2FaMuBezOHmkEM8jY3w7BT%2FScreenshot%202024-11-12%20at%2017.52.59.png?alt=media&#x26;token=a11feb3f-2137-411a-aa3f-4ba0c99a909e" alt=""><figcaption></figcaption></figure>

Approve the transaction from your Wallet. Done.✔❤️
