Supported Morpho Markets
Borrow Recovery currently supports:- Market ID:
0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836 - Available on: Base (Chain ID: 8453)
Each Morpho Blue market is an isolated lending pool with specific collateral and loan assets, LTV, and oracle configuration.
Understanding Morpho Positions
Position Data Structure
Morpho Blue stores position data as:Reading Position Data
The app reads your position using theposition view function:
Morpho Rescue Actions
Withdraw Collateral
Withdraw collateral from a Morpho Blue market.Select Action
In the Morpho rescue actions section:
- Set Action dropdown to Withdraw collateral
- Choose Withdraw all collateral or enter a custom amount
Execute Withdrawal
Click Execute Morpho action via KernelThe app builds withdrawal transactions using backend-compatible logic:These transactions are then wrapped in a Kernel execute call and submitted as a UserOperation.
Repay Debt
Repay borrowed assets to reduce your Morpho debt.Select Action
In the Morpho rescue actions section:
- Set Action dropdown to Repay debt
- Choose Repay all debt or enter a custom amount
Execute Repay
Click Execute Morpho action via KernelThe app builds repay transactions using backend-compatible logic:This may include:
- Token approval transaction (if needed)
- Morpho repay transaction
Code Examples
Reading Morpho Position
Fromlib/protocols/morpho.ts:
Building Morpho Withdraw Transaction
Fromapp/wallet/[index]/_components/MorphoRescueActions.tsx:
Building Morpho Repay Transaction
Fromapp/wallet/[index]/_components/MorphoRescueActions.tsx:
Market Configuration
Each Morpho Blue market has specific configuration:Best Practices
Understanding Shares vs Assets
Understanding Shares vs Assets
Handling Max Repayment
Handling Max Repayment
When using Repay all debt (
amount: "-1"):- The backend logic calculates exact debt amount
- Adds a small buffer to account for interest accrual
- Still fund 1-2% extra tokens to be safe
- Excess tokens remain in the wallet after repayment
Gas Considerations
Gas Considerations
Morpho operations are submitted as a single batched UserOperation:
- Withdraw: 1 transaction in the batch
- Repay: 1-2 transactions (approve + repay) in the batch
- More gas-efficient than separate UserOps
- The app adds a 50% buffer to gas estimates
Troubleshooting
Morpho USD fields show '—'
Morpho USD fields show '—'
This indicates a data fetching issue:
- Click Load positions again
- Check browser console for detailed error messages
- The app tries multiple fallback read methods:
- Public RPC read (backend-style)
- Wallet provider read
- Raw onchain contract read
- Ensure you’re on the correct chain (Base for the supported market)
'Insufficient collateral' error
'Insufficient collateral' error
Morpho prevents withdrawals that would exceed the Loan-to-Value (LTV) ratio:
- Reduce withdrawal amount
- Repay some debt to free up collateral
- Check current LTV vs market’s liquidation LTV (LLTV)
'Building Morpho calls failed' error
'Building Morpho calls failed' error
This occurs during transaction construction:
- Verify the wallet provider is connected
- Check that you’re on the correct chain
- Ensure the market configuration is valid
- Try switching to a different RPC endpoint
Morpho vs Aave Differences
| Feature | Morpho Blue | Aave V3 |
|---|---|---|
| Architecture | Isolated markets | Pooled liquidity |
| Interest Rate | Per-market IRM | Pool-wide rates |
| Health Factor | Implicit (LTV-based) | Explicit value |
| Rescue Flow | Single batched UserOp | 2 separate UserOps (for repay) |
| Position Data | Share-based | Direct balances |
Next Steps
Wallet Recovery
Return to the full recovery workflow
Aave Operations
Learn about Aave V3 rescue actions