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:

  1. Simple Lending - Supply collateral with optional borrowing

  2. Leveraged/Looping Positions - Multiple layers of collateral and debt using flashloans

  3. 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:

  1. Repay any outstanding debt (if applicable)

  2. Withdraw your collateral

  3. 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:

  1. Withdraw a portion of collateral (keep enough to maintain health factor > 1.0)

  2. 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

  3. Repay a portion of your debt using the swapped tokens

  4. Repeat steps 1-3 until all debt is repaid

  5. 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

  1. Ensure you're on Base network

  2. Click "Connect Wallet"

  3. Select "WalletConnect"

Step 2: Connect Your Safe

  1. Copy the WalletConnect URI or scan QR code

  2. Open app.safe.global in another tab/window

  3. Navigate to your Safe

  4. Go to AppsWalletConnect

  5. Paste the URI or scan the QR code

  6. 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)

  1. Find your borrow position in the "Your borrows" section

  2. Click "Repay"

  3. Options:

    • Repay with your wallet assets: Use tokens in your Safe

    • Repay with collateral: Sell collateral to repay (be careful with slippage)

  4. Enter amount to repay (or click "MAX")

  5. Click "Continue"

  6. Review transaction in Safe interface

  7. Sign and execute

Supported Debt Assets:

  • USDC: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

  • USDbC: 0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA

  • EURC: 0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42

  • cbETH: 0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22

  • wstETH: 0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452

  • cbBTC: 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf

Step 5: Withdraw Collateral

  1. Find your supply position in the "Your supplies" section

  2. Click "Withdraw"

  3. Enter amount to withdraw (or click "MAX")

  4. Check health factor - must stay above 1.0 if you still have debt

  5. Click "Continue"

  6. Review and approve in Safe

  7. Sign and execute

Supported Collateral Assets:

  • WETH: 0x4200000000000000000000000000000000000006

  • USDC: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

  • USDbC: 0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA

  • EURC: 0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42

  • cbETH: 0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22

  • wstETH: 0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452

  • cbBTC: 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf


Compound V3 Unwinding

Comet Addresses (Base):

  • USDC Market: 0xb125e6687d4313864e53df431d5425969c15eb2f

  • WETH Market: 0x46e6b214b524310239732d51387075e0e70970bf

  • USDS Market: 0x2c776041CCFe903071AF44aa147368a9c8EEA518

Step 1: Access Compound via Safe

  1. Ensure you're on Base network

  2. Click "Connect Wallet"

  3. Select "WalletConnect"

Step 2: Connect Your Safe

  1. Follow the WalletConnect connection flow (same as Aave above)

  2. Open Safe in another tab

  3. Go to AppsWalletConnect

  4. 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)

  1. Find your borrow section

  2. Click "Repay"

  3. Enter amount to repay (or "MAX")

  4. Click "Repay"

  5. 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

  1. Find your supply section

  2. Click "Withdraw"

  3. Enter amount to withdraw

  4. Important: Ensure your position remains healthy if you have outstanding debt

  5. Click "Withdraw"

  6. 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

  1. Select Base network

  2. Click "Connect Wallet"

  3. Select "WalletConnect" or look for "Smart Wallet" option

Step 2: Connect Your Safe

  1. Use WalletConnect to connect your Safe (same flow as above)

  2. 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)

  1. Navigate to your specific market

  2. Click "Repay"

  3. Enter amount to repay

  4. Approve transaction

  5. Sign and execute in Safe

Available Debt Assets:

  • USDC, cbBTC, EURC, WETH

Step 5: Withdraw Collateral

  1. In your market, click "Withdraw"

  2. Enter withdrawal amount

  3. Ensure position stays healthy if debt remains

  4. 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

  1. Switch to Base network

  2. Connect via WalletConnect

Step 2: Connect Your Safe

  1. Follow WalletConnect flow

  2. 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

  1. Navigate to your vault

  2. Repay outstanding debt first

  3. Then withdraw collateral

  4. All transactions must be approved via Safe


Moonwell Unwinding

Comptroller Address (Base): 0xfBb21d0380beE3312B33c4353c8936a0F13EF26C

Step 1: Access Moonwell via Safe

  1. Connect to Base network

  2. Use WalletConnect to connect

Step 2: Connect Your Safe

  1. Follow WalletConnect connection process

  2. 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)

  1. Find your borrowed asset

  2. Click "Repay"

  3. Enter repayment amount

  4. Approve and execute via Safe

Step 5: Withdraw Collateral

  1. Find your supplied asset

  2. Click "Withdraw"

  3. Enter amount (watch health factor)

  4. 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

  1. Navigate to your Safe

  2. Click Apps

  3. Search for "Transaction Builder"

  4. 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

  1. Review all parameters carefully

  2. Double-check addresses and amounts

  3. Click "Create Batch" or "Add Transaction"

  4. Sign with your wallet

  5. Wait for other signers (if multi-sig)

  6. Execute transaction

  7. 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:

  1. First approve the token spending

  2. Then submit repayment transaction

Health factor drops below 1.0

Immediate Action Required:

  1. Stop withdrawing collateral

  2. Add more collateral OR

  3. Repay more debt

  4. 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

  1. Calculate Total Costs

    • Estimate gas fees for all transactions

    • Factor in potential slippage

  2. Check Market Conditions

    • Avoid unwinding during high volatility

    • Check protocol utilization rates

    • Ensure sufficient liquidity

  3. 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:

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



Summary

Key Takeaways:

  1. Always repay debt before withdrawing collateral

  2. Use WalletConnect for easiest Safe integration

  3. Monitor health factor during unwinding

  4. Leveraged positions require special handling

  5. Keep sufficient ETH for gas in your Safe

  6. Test with small amounts first

  7. Contact support for complex positions

Need help with position management? Join our Telegram

Ready to automate? Learn about AI Agents

Last updated