Liquidity Providers
Liquidity providers earn yield by providing USDC, ETH & WBTC that can be borrowed by Margin Account
Last updated
Liquidity providers earn yield by providing USDC, ETH & WBTC that can be borrowed by Margin Account
Last updated
Traders on Sharwa can borrow up to 10x their collateral. For example, if a trader provides 10,000 $USDC, they can borrow up to 100,000 $USDC (10x leverage) from the liquidity pools. While this may seem unusual, even with 10x leverage, all debts on Sharwa are OVER-COLLATERALIZED.
Here’s how it works:
The trader provides 100 $USDC of collateral to the margin account (funds are sent from their wallet to a smart contract).
When funds are deposited into the margin account, the system allows borrowing up to 10x the capital. In this case, 1,000 borrowed $USDC are sent to the margin account.
The user’s account now holds a total value of 1,100 $USDC (collateral + borrowed tokens). At this point, the margin ratio is 110%, meaning the account is over-collateralized by 10%.
The trader decides to use the borrowed funds. Since the funds are within the margin account, they can only be used for a limited set of options—in this case, Uniswap v3. The user can swap tokens from their margin account for $WBTC, $WETH, or $USDC.
Since the user has already borrowed $USDC, they decide to bet on the rise of $ETH and swap the 1,100 $USDC to $ETH. For simplicity, let’s say they purchase 1.1 $ETH at 1,000 $USDC per $ETH.
ETH Price Change Example
If the price of $ETH drops from 1,000 $USDC to 940 $USDC, the account value will decrease accordingly.
New account value: 1,034 $USDC
Debt: 1,003 $USDC (1,000 borrowed + 3 $USDC interest)
Margin Ratio: 1,034 / 1,003 = 103%
If the margin ratio falls below 105%, liquidation occurs, and all assets in the margin account will be sold for $USDC, resulting in 1,034 $USDC.
Liquidity providers receive their 1,000 $USDC (principal) plus 3 $USDC of interest.
The remaining 34 $USDC is returned to the margin account.
With the debt cleared, the trader can withdraw funds or borrow again.
To make sure margin accounts are liquidated promptly, we’ve set up two separate liquidation systems to monitor and act on all margin accounts:
Server-Side Script: A classic script runs on a server, continuously pulling real-time data. When a margin account becomes eligible for liquidation, the script automatically triggers the liquidation mechanism.
Chainlink Automation: This decentralized solution adds another level of reliability. When a margin account is ready for liquidation, Chainlink Automation steps in and triggers the liquidation process.
The liquidation mechanism described in detail in this section.
Liquidity providers face several risks when participating in the protocol:
Technical Risks: Liquidity providers are exposed to the risk of bugs or vulnerabilities in the protocol, which could result in the loss of funds.
Bad Debt Risk: Liquidity providers may encounter bad debt if a margin account is liquidated and the amount repaid to the liquidity pools is less than the borrowed funds plus the interest.
To mitigate these risks, Sharwa employs an insurance pool In the event of bad debt, the insurance pool is used to cover the shortfall.
To reduce technical risks, we have been audited by Pashov Group. Security audits help protect the protocol from bugs and hackers, but it’s important to keep in mind that security audits do not guarantee 100% security.
To ensure margin accounts are liquidated promptly, we’ve set up two separate liquidation systems to monitor and act on all margin accounts:
Server-Side Script: A classic script runs on a server, continuously pulling real-time data. When a margin account becomes eligible for liquidation, the script automatically triggers the liquidation mechanism.
Chainlink Automation: This decentralized solution adds another level of reliability. When a margin account is ready for liquidation, Chainlink Automation steps in and triggers the liquidation process.