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
- 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.
- 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 callslockIMD(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. - 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 andmatmove, so a position at the limit can become unsafe without you doing anything. See Manage and protect a position. - Borrow (
draw). Choose Borrow, enter an imdUSD amount below the maximum and confirm. The vault checks your new debt againstmatand the total against the debt ceilingline, then mints the imdUSD to you. - 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
| Revert | Where | Cause | Recovery |
|---|---|---|---|
ZeroAmount | Deposit, Borrow | Amount is zero | Enter a positive amount |
ERC20InsufficientAllowance / ERC20InsufficientBalance | Deposit | Approval is smaller than the amount, or you hold too little of the token | Approve the exact amount again; lower the amount |
CollateralNotWrappable | Deposit IMD | The vault's collateral is not a staking-vault share | Do not use this contract |
UnexpectedCollateralReceived | Deposit | The token delivered a different amount than requested | The vault refuses such tokens; there is no recovery for that token |
StaleFeed | Borrow | The IMD/ETH, network health, spot or ETH/USD price is older than its maximum age | Wait for a fresh price; check the Oracle tab |
PriceDivergence | Borrow | The main and spot prices differ by more than skew | Wait for them to agree |
InvalidPrice | Borrow | A price reads as zero | Wait for a valid price |
UnsafeCollateralRatio | Borrow | Your debt after borrowing would be above what mat allows | Borrow less, or Deposit more |
DebtCeilingReached | Borrow | Total principal would pass the ceiling line | Borrow less; wait for others to Repay |
NotInitialized | Borrow | The stablecoin is not linked to this vault | Do 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