Contents

Guides · For borrowers

Open a position

This guide takes you from holding IMD or sIMD to holding borrowed imdUSD, in two steps: Deposit (lock for sIMD, lockIMD for IMD) and Borrow (draw). For why the numbers work the way they do, see How imdUSD holds a dollar.

Before you start

  • A wallet holding IMD or sIMD on the same chain as the vault, and a little ETH for gas. Your collateral is held as sIMD either way: deposit IMD and the vault stakes it for you.
  • The terminal open at /terminal/ with the wallet connected (Use the terminal).
  • Prices live: the price line on the Oracle tab (and above the Position tab's actions) must not say borrowing is paused. Borrowing is refused while a price is out of date or the main and spot prices disagree; the line then offers Update price to buy a fresh one with your own IMD. Depositing is not refused.
  • The vault address, 0x0b69F8DA8D8cE521d74Ea69a7A3475B77302EF82. Check it against Contracts and addresses before approving anything.

Steps

  1. Approve. In Position, choose Deposit, pick the token you hold (IMD or sIMD) and enter the amount. The first button reads "Approve IMD" or "Approve sIMD". It approves the vault to take exactly that amount, as a separate transaction.
  2. Deposit. Press the button again, now labelled "Review deposit", and confirm. With sIMD the vault calls lock(amount) and pulls your sIMD. With IMD it calls lockIMD(amount): it pulls your IMD, stakes it in the staking vault and credits the sIMD it receives. Either way your position grows by sIMD. You owe nothing yet, and while you have no debt you can withdraw at any time.
  3. Check what you can borrow. Can still borrow is the most imdUSD you could take at the current price without going below the minimum ratio mat. Do not borrow all of it: both the IMD price and mat move, so a position at the limit can become unsafe without you doing anything. See Manage and protect a position.
  4. Borrow (draw). Choose Borrow, enter an imdUSD amount below the maximum and confirm. The vault checks your new debt against mat and the total against the debt ceiling line, then mints the imdUSD to you.
  5. Read the result. Collateral ratio, Liquidation price and Accrued debt update. Note your liquidation price.

Your debt is what you borrowed plus the stability fee (duty), which builds up every second even if you do nothing.

What can block it

RevertWhereCauseRecovery
ZeroAmountDeposit, BorrowAmount is zeroEnter a positive amount
ERC20InsufficientAllowance / ERC20InsufficientBalanceDepositApproval is smaller than the amount, or you hold too little of the tokenApprove the exact amount again; lower the amount
CollateralNotWrappableDeposit IMDThe vault's collateral is not a staking-vault shareDo not use this contract
UnexpectedCollateralReceivedDepositThe token delivered a different amount than requestedThe vault refuses such tokens; there is no recovery for that token
StaleFeedBorrowThe IMD/ETH, network health, spot or ETH/USD price is older than its maximum ageWait for a fresh price; check the Oracle tab
PriceDivergenceBorrowThe main and spot prices differ by more than skewWait for them to agree
InvalidPriceBorrowA price reads as zeroWait for a valid price
UnsafeCollateralRatioBorrowYour debt after borrowing would be above what mat allowsBorrow less, or Deposit more
DebtCeilingReachedBorrowTotal principal would pass the ceiling lineBorrow less; wait for others to Repay
NotInitializedBorrowThe stablecoin is not linked to this vaultDo not use this contract

Nothing is sent when a check fails; the note under the button names the figure that blocked you.

What you now hold

You hold imdUSD in your wallet and a position in the vault. To end it, Manage and protect a position shows how to Repay and Withdraw.

Sources: src/CDPVault.sol, web/src/Panes.tsx