> For the complete documentation index, see [llms.txt](https://build.sovryn.com/builder-portal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://build.sovryn.com/builder-portal/smart-contracts/lending-and-margin-trading-protocol/margin-trading.md).

# Margin Trading

In order to enter a trade, call `marginTrade` on the respective iToken contract. Let's say you want to trade RBTC against XUSD. You enter a BTC long position by sending either of these currencies to the iXUSD contract and a short position by sending either of them to the iRBTC contract. The process is depicted below.

<figure><img src="/files/7Iw1du8GNIYxUhyHNaIn" alt=""><figcaption><p>How to open long or short positions.</p></figcaption></figure>
