TUTORIAL: Decentralized leveraged trading

Ready to discover how the future of leveraged trading feels? Let’s get started!

Gains Network
6 min readNov 13, 2021

First, before you can open your first trade on the platform, you will need a wallet (Metamask) connected to the Polygon (Matic) PoS chain, MATIC tokens for transaction fees, and DAI tokens (USD stablecoin) to open trades.

1. Setting up your wallet

Please download and install Metamask.
https://metamask.io/download.html

2. Adding the Polygon Network to Metamask

Go to https://gains.trade/decentralized-trading/, connect your wallet, and click on “Switch”.

If the Polygon network was already added in your Metamask, please remove it and follow the above instructions, or make sure you use the aggregated RPC (https://polygon-rpc.com) → tutorial to change your RPC.

3. Bringing funds to Polygon

From Ethereum

If you already have funds on the Ethereum Mainnet, you can send them to the Polygon PoS chain using the official bridge: https://wallet.polygon.technology/

First step is to connect your wallet by signing a message.
Then, click on the Polygon Bridge.
Choose the asset and quantity you want to send from Ethereum to Polygon.
Before bridging funds from Ethereum to Polygon, you will need to switch your selected network in Metamask to Ethereum Mainnet if you had the Polygon network selected.
It will take about 10 minutes to arrive on Polygon after you confirm the transaction on Ethereum.

From the Binance Smart Chain

If you already have funds on BSC, you can send them to Polygon using one of the exisiting bridges, generally it works like this:

Select from BSC to Polygon, and then click on “Change Chain” and confirm in Metamask.
Then select the asset and quantity you want to send to Polygon from BSC, click on “Swap”, and confirm the transaction in Metamask. The funds should arrive to Polygon within a few minutes.

Other bridges:

https://anyswap.exchange
https://rubic.exchange
https://synapseprotocol.com

From your bank account / credit card

You will need to use a centralized exchange that supports polygon withdrawals to deposit your fiat, and then convert your fiat to MATIC.

Eg. Binance, OKEX, Ascendex.

After that you can withdraw (send) your MATIC from the exchange to your Metamask wallet on Polygon.

Tip: To copy your wallet address to your clipboard, click on the highlighted part. You will need it to withdraw your funds from the centralized exchange to Polygon.

Once you have bridged funds to your Polygon wallet, you will need some MATIC for transaction fees, and some DAI to open trades.

If you don’t have any MATIC, you can swap any token to MATIC using wallet.polygon.technology/swap
And if you don’t have DAI yet, you can swap any token to DAI using quickswap.exchange

4. Opening your first trade

https://gains.trade/decentralized-trading

Before anything, you need to approve your DAI to the trading smart contract, so it can open trades using your wallet.

Please click on the “Approve” button and confirm the transaction in Metamask.

Once it’s done:

  1. Select the pair you want to trade on (left panel) → we support 36 cryptos and 10 forex pairs.
  2. Select long or short (long → win when price goes up, short → win when price goes down)
  3. Select your leverage → multiplies price moves (eg. 10x leverage → 10% move = you win 100%, liquidated at -9% price move = 90% loss)
  4. Select your collateral size — how much you want to risk (eg. 10% profit on 50 DAI collateral→ 5 DAI but on 5,000 DAI collateral → 500 DAI)
  5. Select your stop loss (closes a trade automatically past a loss threshold eg. at -20% PnL) → you can use no stop loss but your trade will be liquidated (lose whole collateral) if it reaches a -90% loss.
  6. Select your take profit (closes a trade automatically past a profit threshold eg. at +20% PnL) → an automatic take profit is set at 900% anyway because it is currently the max profit allowed on a trade.
  7. Open your trade by clicking on the button at the bottom of the right panel!

Note: Forex pairs are only open during the week (from Sunday 9 PM UTC to Friday 9 PM UTC)

Opening your first trade (eg. LONG BTC/USD 35 DAI 5x)

After a few seconds, a notification will show to confirm your trade was opened. You will also be able to see it in “your open trades” below the chart.

5. Managing your open trades

First, you will see all your open trades on all pairs in the “Your open trades” section.

Long/Short — Pair — Leverage — Collateral — Open price — Current price — Liquidation price or Stop loss — Take profit — Profit/Loss — Close

Then, if you click on the trade (everywhere but on liq/sl and tp prices), it will open a window showing the full details. You will also be able to share your trade from there.

Note: trades profits shown are always after deducting the closing fees.

If you click on your trade liquidation price / stop loss or take profit, it will open a window that lets you update your take profit / stop loss values.

Tip: You can put your Stop Loss in a profit so you at least win …%.

You can also move your stop losses and take profits directly on the chart by dragging them.

Note: To hide your trades from the chart, please click on the checkbox at the right of “Display on chart”.

Finally, to close a trade, you can simply click on the cross in the right corner.

6. Using limit orders to open trades

You can change the order type in the trading panel on the right to “Limit”, choose a price, and click on “Limit Long” or “Limit Short” to place a limit order.

This limit order will open your long/short trade once the price you set has been reached.

You can see all your open limit orders in “Your open limit orders” on the right.

As for open trades, you can click on a limit order to see its full details:

You can cancel a limit order and get the DAI from the collateral back to your wallet (without fees) by clicking the cross at the right corner.

Note: It is also possible to place a short limit order below the current price to short a bearish breakout or put a long limit order above the current price to long a bullish breakout.

7. Monitoring your trading history and performance

You can view the trading history for the whole platform, your personal trading history, the leaderboard, and your personal trading report at the bottom of the page.

--

--