Unwinding Positions
Learn how to manually unwind and close your DeFi positions using the Gnosis Safe interface when you need to exit strategies or reclaim your collateral.
Overview
🚧 Automated Unwinding Coming Soon We're actively developing an automated unwinding feature that will handle complex positions with a single transaction. In the meantime, this guide walks you through the manual process.
Ratehopper supports multiple strategies across different protocols. When you need to unwind a position (close it and withdraw your funds), you'll need to use the Gnosis Safe interface combined with the protocol's native interface via WalletConnect.
Supported Strategies:
Simple Lending - Supply collateral with optional borrowing
Leveraged/Looping Positions - Multiple layers of collateral and debt using flashloans
Rate Arbitrage - Taking advantage of rate differences between protocols
Supported Protocols:
Aave V3 - Base network
Compound V3 - Base network
Morpho - Base network
Fluid - Base network
Moonwell - Base network
Before You Begin
Prerequisites
✅ Have your Safe wallet address ready
Find it on your Ratehopper dashboard
Example:
0x1234...5678
✅ Ensure sufficient ETH for gas
Unwinding requires multiple transactions
✅ Understand your position structure
Know which protocol(s) you're using
Identify your collateral and debt assets
Check your health factor
We provide a link to Debank to check your positions
Important Warnings
⚠️ Unwinding Order Matters: Always repay debt before withdrawing collateral to avoid liquidation
⚠️ Health Factor: Monitor your health factor during partial withdrawals - falling below 1.0 triggers liquidation so make sure you complete all the transactions in a short time
⚠️ Gas Costs: Multiple transactions are required; ensure your Safe has enough ETH
Strategy-Specific Unwinding
Simple Lending Positions (aka Advanced Strategy)
What it is: You've supplied collateral and optionally borrowed against it.
Unwinding Steps:
Repay any outstanding debt (if applicable)
Withdraw your collateral
Verify funds are back in your Safe
Leveraged/Looping Positions
What it is: Positions created using flashloans to multiply exposure (2x-5x leverage).
Contract Address: 0xba25a6bf94ceb977ca1b4823158369463e514802
Unwinding Process (Manual Method):
Leveraged positions have multiple layers of collateral and debt. You'll need to unwind them iteratively:
Withdraw a portion of collateral (keep enough to maintain health factor > 1.0)
Swap the withdrawn collateral for your debt token
Use a DEX like Uniswap or via the protocol's swap feature
Watch for slippage on large amounts
Repay a portion of your debt using the swapped tokens
Repeat steps 1-3 until all debt is repaid
Withdraw remaining collateral
Important Notes:
⚠️ Monitor health factor after each withdrawal - must stay above 1.0
⚠️ Work in smaller batches to avoid liquidation risk
⚠️ Complete all transactions quickly to minimize exposure to price movements
💡 Calculate carefully: Ensure you withdraw enough collateral to cover debt + gas + slippage
Example Unwinding Flow:
Need Help? Contact Ratehopper support for guidance on unwinding leveraged positions.
Protocol-Specific Unwinding Guides
Aave V3 Unwinding
Pool Address: 0xA238Dd80C259a72e81d7e4664a9801593F98d1c5 (Base)
Step 1: Access Aave via Safe
Visit app.aave.com
Ensure you're on Base network
Click "Connect Wallet"
Select "WalletConnect"
Step 2: Connect Your Safe
Copy the WalletConnect URI or scan QR code
Open app.safe.global in another tab/window
Navigate to your Safe
Go to Apps → WalletConnect
Paste the URI or scan the QR code
Approve the connection
Step 3: View Your Position
On Aave interface, you should see:
Your supplies (collateral deposited)
Your borrows (debt owed)
Current health factor
Step 4: Repay Debt (If Applicable)
Find your borrow position in the "Your borrows" section
Click "Repay"
Options:
Repay with your wallet assets: Use tokens in your Safe
Repay with collateral: Sell collateral to repay (be careful with slippage)
Enter amount to repay (or click "MAX")
Click "Continue"
Review transaction in Safe interface
Sign and execute
Supported Debt Assets:
USDC:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913USDbC:
0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CAEURC:
0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42cbETH:
0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22wstETH:
0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452cbBTC:
0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf
Step 5: Withdraw Collateral
Find your supply position in the "Your supplies" section
Click "Withdraw"
Enter amount to withdraw (or click "MAX")
Check health factor - must stay above 1.0 if you still have debt
Click "Continue"
Review and approve in Safe
Sign and execute
Supported Collateral Assets:
WETH:
0x4200000000000000000000000000000000000006USDC:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913USDbC:
0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CAEURC:
0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42cbETH:
0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22wstETH:
0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452cbBTC:
0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf
Compound V3 Unwinding
Comet Addresses (Base):
USDC Market:
0xb125e6687d4313864e53df431d5425969c15eb2fWETH Market:
0x46e6b214b524310239732d51387075e0e70970bfUSDS Market:
0x2c776041CCFe903071AF44aa147368a9c8EEA518
Step 1: Access Compound via Safe
Visit app.compound.finance
Ensure you're on Base network
Click "Connect Wallet"
Select "WalletConnect"
Step 2: Connect Your Safe
Follow the WalletConnect connection flow (same as Aave above)
Open Safe in another tab
Go to Apps → WalletConnect
Complete the connection
Step 3: View Your Position
On Compound interface, you'll see:
Supply Balance (your collateral)
Borrow Balance (your debt)
Current utilization
Step 4: Repay Debt (If Applicable)
Find your borrow section
Click "Repay"
Enter amount to repay (or "MAX")
Click "Repay"
Approve and sign transaction in Safe
Note: Compound V3 uses "base assets" (USDC, WETH, USDS) for borrowing. You can only borrow the base asset of each market.
Step 5: Withdraw Collateral
Find your supply section
Click "Withdraw"
Enter amount to withdraw
Important: Ensure your position remains healthy if you have outstanding debt
Click "Withdraw"
Approve and sign in Safe
USDC Market Collateral:
WETH, cbETH, wstETH, cbBTC
WETH Market Collateral:
USDC, cbETH, wstETH, cbBTC
USDS Market Collateral:
WETH, cbETH, wstETH, cbBTC
Morpho Unwinding
Morpho Blue Address (Base): 0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb
Step 1: Access Morpho via Safe
Visit app.morpho.org
Select Base network
Click "Connect Wallet"
Select "WalletConnect" or look for "Smart Wallet" option
Step 2: Connect Your Safe
Use WalletConnect to connect your Safe (same flow as above)
Or use "Smart Wallet" option if available and enter your Safe address directly
Step 3: View Your Position
Morpho shows positions by market:
Each market has specific collateral/borrow asset pairs
Markets identified by unique Market IDs
Step 4: Repay Debt (If Applicable)
Navigate to your specific market
Click "Repay"
Enter amount to repay
Approve transaction
Sign and execute in Safe
Available Debt Assets:
USDC, cbBTC, EURC, WETH
Step 5: Withdraw Collateral
In your market, click "Withdraw"
Enter withdrawal amount
Ensure position stays healthy if debt remains
Approve and execute in Safe
Available Supply Assets:
USDC, WETH, cbETH, wstETH, cbBTC
Fluid Unwinding
Vault Resolver Address (Base): 0x4F6F977aCDD1177DCD81aB83074855EcB9C2D49e
Note on Fluid
Fluid uses a vault-based system where each vault has specific collateral/debt pairs.
Step 1: Access Fluid via Safe
Visit app.fluid.instadapp.io
Switch to Base network
Connect via WalletConnect
Step 2: Connect Your Safe
Follow WalletConnect flow
Connect Safe via the WalletConnect app in Safe
Step 3: Identify Your Vault
Fluid vaults are specific to collateral/debt pairs
Example: "ETH/USDC vault"
Find the vault containing your position
Step 4: Repay and Withdraw
Navigate to your vault
Repay outstanding debt first
Then withdraw collateral
All transactions must be approved via Safe
Moonwell Unwinding
Comptroller Address (Base): 0xfBb21d0380beE3312B33c4353c8936a0F13EF26C
Step 1: Access Moonwell via Safe
Visit moonwell.fi
Connect to Base network
Use WalletConnect to connect
Step 2: Connect Your Safe
Follow WalletConnect connection process
Link your Safe via WalletConnect app
Step 3: View Your Position
Moonwell displays:
Supplied assets (collateral)
Borrowed assets (debt)
Current APYs
Step 4: Repay Debt (If Applicable)
Find your borrowed asset
Click "Repay"
Enter repayment amount
Approve and execute via Safe
Step 5: Withdraw Collateral
Find your supplied asset
Click "Withdraw"
Enter amount (watch health factor)
Execute via Safe
Advanced: Transaction Builder Method
⚠️ Advanced Users Only - Only use if WalletConnect doesn't work.
When to Use Transaction Builder
WalletConnect connection fails
Protocol doesn't support Safe integration
You need custom transaction parameters
How to Use Transaction Builder
Step 1: Open Transaction Builder in Safe
Go to app.safe.global
Navigate to your Safe
Click Apps
Search for "Transaction Builder"
Open the app
Step 2: Prepare Transaction Data
For Aave V3 Withdrawal:
For Aave V3 Repayment:
For Compound V3 Withdrawal:
For Compound V3 Repayment:
Step 3: Execute Transaction
Review all parameters carefully
Double-check addresses and amounts
Click "Create Batch" or "Add Transaction"
Sign with your wallet
Wait for other signers (if multi-sig)
Execute transaction
Verify on BaseScan
Safety Checklist
Before unwinding any position, verify:
✅ Correct Network: Ensure you're on Base network
✅ Sufficient Gas: Your Safe has enough ETH (at least 0.01 ETH)
✅ Health Factor: Current health factor is safe (> 1.5 recommended)
✅ Debt First: Always repay debt before withdrawing collateral
✅ Addresses Verified: Double-check all contract addresses
✅ Amount Correct: Verify decimal places (watch for 6 vs 18 decimals)
✅ Test Transaction: Consider unwinding partially first to test
Troubleshooting
"Transaction will fail" error
Causes:
Insufficient collateral to maintain health factor
Not enough tokens to repay debt
Protocol liquidity constraints
Solutions:
Reduce withdrawal amount
Add more collateral first
Repay more debt before withdrawing
Wait for protocol liquidity to improve
"Insufficient allowance" error
Cause: Token not approved for repayment
Solution:
First approve the token spending
Then submit repayment transaction
Health factor drops below 1.0
Immediate Action Required:
Stop withdrawing collateral
Add more collateral OR
Repay more debt
Your position may be liquidated if health factor stays below 1.0
Transaction pending for too long
Solutions:
Check gas price on BaseScan
You may need to speed up transaction (increase gas)
Or cancel and retry with higher gas
Can't find position in protocol UI
Possible Causes:
Wrong network selected
Position is in a different protocol
Using wrong Safe address
Solutions:
Verify network is Base
Check all supported protocols
Confirm Safe address on Ratehopper dashboard
View position on BaseScan directly
Best Practices
Planning Your Unwind
Calculate Total Costs
Estimate gas fees for all transactions
Factor in potential slippage
Check Market Conditions
Avoid unwinding during high volatility
Check protocol utilization rates
Ensure sufficient liquidity
Partial vs Full Unwind
Consider unwinding gradually
Test with small amounts first
Monitor health factor between steps
Execution Tips
✅ Keep ETH Buffer: Maintain extra ETH in Safe for multiple transactions
✅ Monitor Health Factor: Check after each step when partially unwinding
✅ Save Transaction Hashes: Keep records for tracking and troubleshooting
✅ Verify Each Step: Confirm success on BaseScan before proceeding
✅ Have Support Ready: Keep Ratehopper support contacts handy
Getting Help
When You Need Assistance
Unwinding complex leveraged positions
Transaction failures you can't resolve
Positions approaching liquidation
Technical issues with Safe or protocols
Support Channels
Ratehopper Support:
📧 Email: [email protected]
🆘 Emergency: Contact via Telegram for urgent issues
Protocol Support:
Safe Support:
Information to Provide
When seeking help, have ready:
Safe wallet address
Protocol and position details
Transaction hash (if failed)
Screenshots of errors
Current health factor
Related Documentation
📖 Manual Withdrawals Guide - General withdrawal instructions
🤖 Automation Features - Automated position management
📊 Understanding Rates - Rate mechanics
❓ FAQ - Common questions
Summary
Key Takeaways:
Always repay debt before withdrawing collateral
Use WalletConnect for easiest Safe integration
Monitor health factor during unwinding
Leveraged positions require special handling
Keep sufficient ETH for gas in your Safe
Test with small amounts first
Contact support for complex positions
Need help with position management? Join our Telegram
Ready to automate? Learn about AI Agents
Last updated