Working with Margin Account
Last updated
Last updated
Arkis Margin Accounts are smart contracts that hold both your collateral and your borrowed assets. Through the Arkis Portal, you can inspect every detail of your account, perform permitted trades via WalletConnect, and — when you’re ready — close the account to settle your loan and reclaim your collateral.
Once you’ve opened a loan, navigate to the Borrowed -> Opened in the Arkis Portal to see all your Margin Accounts. For each account, ,you’ll see:
Account Address The on-chain Ethereum address of your Margin Account. Click to copy or view on Etherscan.
Risk Factor Your current collateral coverage ratio (Stress-Tested Portfolio Value ÷ Borrowed Amount).
RF >> 1.0 = healthy
RF ≈ Margin Call RF = at margin call level
RF < 1.0 = subject to liquidation
Stress-Tested Value The total value of assets in the Margin Account, adjusted for stress tests, based on the configured stress multipliers for each asset within a specific Liquidity Pool.
Total Accrued Interest The sum of interest owed to the Liquidity Pool.
By clicking on a specific Margin Account, a user is navigated to a dedicated page for interaction with the Margin Account.
Within this section a user can:
Trade through Margin Account.
Close Margin Account (i.e repay the loan).
Your Margin Account functions like a normal wallet—except that all actions are constrained by the Compliance Manager whitelist. To trade:
Go to the protocol page you want to interact with (Pendle, for example) and find Wallet Connect in Connect section.
Copy QR Code symbols
Connect Margin Account
Navigate back to the Arkis Portal, click Trade with Wallet Connect, and paste the copied symbols into the window, and click Connect
Once you click Connect, you will see that the Margin Account was successfully connected to the external dApp.
Navigate back to the Pendle dApp.
Once you navigate back to Pendle, you will see that you have connected a wallet with the address of your Margin Account. You can now interact with the protocol on behalf of Margin Account.
Now you can interact with the dApp as if it were your own wallet. You can view analytics, close positions, enter and exit positions, and swap, unless this action is whitelisted.
Initiate a Trade
Within the Pendle app, choose a market you want to interact with (make sure PT/LP assets are whitelisted in the Liquidity Pool the Margin Account borrowed from) and click Swap.
Navigate back to the Arkis Platform, and you will see a transaction pop-up from our wallet that originated the loan.
You can now sign a transaction from your wallet on behalf of Margin Account.
Once the transaction is signed, you will see that the Swap happened on the Margin Account. You can check the Margin Account state by pasting its address to DeBank or Etherscan.
Below the Trade with Wallet Connect button, you can find "Close Credit Account," which refers to repaying the loan and closing the Margin Account.
To repay the loan (close Margin Account), the Margin Account address must have the borrowed amount of the asset plus accrued interest.
By clicking "Close Credit Account" an Asset Manager is navigated to the page to initiate the process of the Margin Account loan repayment.
However, if the Margin Account does not contain enough borrowed asset tokens and accrued interest (also in borrowed asset tokens), the Proceed button will be disabled.
There are two ways how an Asset Manager can get Debt + Accrued interest to the Margin Account:
Direct deposit to the Margin Account address the necessary amount of tokens (48.81413 USDT in this example). - The Arkis team recommends this option as the fastest and easiest to implement.
Sell, exit from available positions on the Margin Account, and swap them to the necessary amount of Total Debt.
Once the Margin Account has the necessary amount of borrowed tokens, the Proceed button will become active.
Once an Asset Manager signs the transaction to close the Margin Account, the protocol does the following:
Analyses the amount of borrowed assets (Total Debt + Accrued Interest) to be sent into the liquidity pool. Please note that the protocol will only take the total debt plus the interest amount. Any surplus will be returned to the wallet of the Asset Manager who originated the loan.
All other whitelisted assets (tokens, PT, LP positions) within the Margin Account will be transferred back to the Asset Manager's wallet.
Why is this important?
As you can see, when Margin Account is closed, the protocol takes only what Margin Account owes to the Liquidity Pool, the rest is returned to Asset Manager's wallet.
If an Asset Manager wants to liquidate Margin Account portfolio themselves (using other protocols, or some specific techniques) or don't want to exit positions at all to close the loan - they only need to send borrowed amount + interest to the Margin Account address and they will get everything else back to their own wallet once Close Margin Account procedure is successfull.