Sharwa.Finance Documentation
  • 💼Margin Account
    • Liquidity Providers
      • Insurance Pool
    • Liquidation
    • Fees
    • Allowed Assets
    • Security
    • Links
  • 🪙Tokenomics
    • We don't have a token
  • 🦾FOR DEVS
    • Margin Account
      • Core Contracts
        • MarginTrading.sol
        • MarginAccountManager.sol
        • LiquidityPool.sol
        • ModularSwapRouter
          • HegicModule.sol
      • Toolkits and other contracts
        • OneClick Contracts
      • HegicStopOrders
        • HegicStopOrders SDK
  • 📚Guide
    • How To Trade on Sharwa
Powered by GitBook
On this page
  • Difference Between Portfolio Margin and Isolated Margin
  • How Debt Works
  • Why is leverage on Sharwa cheaper than other perp products?
  • Example of Portfolio Margin: Leveraged Trading Without Liquidations
  • Example

Margin Account

This section covers the basics of margin account.

NextLiquidity Providers

Last updated 3 months ago

A Margin Account allows you to trade with up to 10x leverage using $WBTC, $WETH, and $USDC as collateral. A unique feature of the margin account is that it lets you use the intrinsic value of American-style options as collateral (powered by Hegic).

The key aspect of the margin account is that all assets and positions within the account serve as collateral. This type of margining is also called “Portfolio Margin.”

Difference Between Portfolio Margin and Isolated Margin

There are two types of margin:

  • Isolated Margin: Each position has its own collateral. Profits or losses from one position do not affect others.

  • Portfolio Margin: All positions within the margin account share the same collateral. Profits or losses from one position impact others.

All assets in the margin account are denominated in $USDC, regardless of whether your balance consists solely of $WBTC or a combination of $ETH, $WBTC, $USDC and option positions.

How Debt Works

To trade with leverage, users must borrow tokens from Sharwa’s liquidity pools. When borrowing funds, your debt is aggregated across all borrowed tokens and denominated in USDC.

For example, if you borrow 100,000 $USDC, 100 $ETH, and 10 $WBTC, your total debt is calculated in $USDC. We use Chainlink oracles to determine the value of margin accounts and liabilities, ensuring that asset prices cannot be manipulated.

Each margin account has a margin ratio, which determines the account’s leverage. It is calculated as:

  • The total value of a margin account in USDC consists of three parts:

    • collateral ERC-20 tokens

    • borrowed ERC-20 tokens

Traders must always monitor their margin ratio and ensure it stays above 105%; otherwise, the margin account will be liquidated.

To enhance the trading experience, Sharwa does not charge any liquidator fees in the event of liquidation (as of the time of writing this document). Instead, the trader’s margin is used solely to repay the debt, and any remaining funds are available for withdrawal.

Why is leverage on Sharwa cheaper than other perp products?

Sharwa offers lower-cost leverage because traders borrow tokens from liquidity pools rather than trading against them. In traditional perp protocols, liquidity providers take the opposite side of the trade, which increases risk and, consequently, the cost of leverage.

In contrast, Sharwa operates on a lending-based model. Liquidity providers supply capital to traders, who borrow funds to gain leverage. This structure offers two key benefits:

  • Since liquidity providers are not taking the opposite side of trades, funding costs are lower and more stable.

  • Instead of relying on volatile funding rates, liquidity providers earn yield through interest on borrowed funds, without exposure to directional trading losses. However, they still face technical risks such as bad debt.


Example of Portfolio Margin: Leveraged Trading Without Liquidations

Below is an example of how you can trade without liquidations on Sharwa.

Example

User creates a margin account on Sharwa, deposits collateral, then opens a 10x $ETH Long, and after that buys a Long Put option from Hegic

⬆️ x10 $ETH Long opened through on Sharwa:

• Collateral: 3,250 USDC

• Position Size: 10 $ETH (10x leverage)

• Direction: Long

• Entry Price: $3,250

⬇️ Purchased Long Put option on Hegic:

• Duration: 0DTE (24 hours)

• Amount: 10 $ETH

• Option Strike: $3,250

• Premium Paid: $553 ($55 per contract; based on prices from Jan 10th, 2025)

Outcome Scenarios

1. Price Increases by +10%

• Net PnL: +78% (or +$2,947)

✅ The x10 $ETH Long captures gains, minus the cost of the Long Put premium.

2. Price Drops by -10%

• Net PnL: -15% (or -$553)

✅ The put option offsets the negative PnL from 10x $ETH Long, limiting the losses and keeping the long position untouched.

3. Price Crashes by -99%

• Net PnL: Still -15% (or -$553)

✅ PnL remains same, no risk of liquidation as long as the option position is active.

In contrast to isolated margin mode, where you’re paying liquidation fees and losing potentially profitable long positions, in portfolio margin mode provided by Sharwa Margin Account and Hegic Options, you:

✅ Don’t know what liquidation is: As long as your position remains properly hedged with the option, your margin account cannot be liquidated since the payoff from the option position offsets losses from long positions.

✅ Don’t lose entries in your positions.

totalDebt=100,000+(100∗ethUsdcPrice)+(10∗wbtcUsdcPrice)totalDebt =100,000 + (100 * ethUsdcPrice) + (10* wbtcUsdcPrice)totalDebt=100,000+(100∗ethUsdcPrice)+(10∗wbtcUsdcPrice)
marginRatio=totalValueOfMarginAccountInUsdc/totalDebtInUsdcmarginRatio = totalValueOfMarginAccountInUsdc / totalDebtInUsdcmarginRatio=totalValueOfMarginAccountInUsdc/totalDebtInUsdc

collateral (ERC-721 tokens / )

💼
HEGOPS