A secure, open-source, non-custodial tool to inspect and withdraw your funds directly from Hyperliquid L1 to Arbitrum One, completely bypassing the official web frontend's geo-blocking, Cloudflare IP restrictions, or jurisdictional blocks.
When attempting to access the official Hyperliquid web app (app.hyperliquid.xyz), you might encounter:
"You are accessing our products and services from a restricted jurisdiction. We do not allow access from certain jurisdictions including locations subject to sanctions restrictions and other jurisdictions where our services are ineligible for use..."
- The Block is Only on the Website: Hyperliquid's commercial web interface employs Cloudflare geolocation filtering to comply with regional derivatives trading restrictions.
- DeFi Non-Custodial Reality: Hyperliquid is a decentralized Layer 1 appchain paired with an official smart contract bridge on Arbitrum One.
- No Protocol-Level Block: The underlying validator nodes (
api.hyperliquid.xyz) and Arbitrum bridge smart contracts do not enforce frontend geoblocks. - Cryptographic Ownership: As long as you control the private key of your Ethereum wallet, you can construct and submit signed transactions (EIP-712 standard) directly to the validator network to withdraw your assets at any time.
This repository provides both an interactive terminal wizard and a clean local browser GUI that speak directly to the Hyperliquid L1 nodes and Arbitrum bridge.
In accordance with open-source community standards, this tool is built under a strict zero-retention security policy:
- Zero Key Storage: Private keys are NEVER saved to disk, never appended to
.envfiles, never written to log files, and never stored in browserlocalStorageor session cookies. - Ephemeral In-Memory Handling: Keys are entered via masked standard terminal inputs (
getpass) or in-memory Web UI fields. Once the local EIP-712 signature is computed, the memory reference is discarded. - Local EIP-712 Signing: All signatures are generated locally on your machine using standard Ethereum cryptography (
eth_account). Your private key is NEVER transmitted over the networkβonly the resulting signature and message payload are sent to Hyperliquid's official API. - Direct RPC Communication: The tool connects solely to Hyperliquid's official validator endpoints (
https://api.hyperliquid.xyz). No intermediate servers, proxies, analytics, or telemetry are used. - Auditable & Transparent: 100% open-source Python with full automated test coverage.
hyperliquid-withdrawer/
βββ core.py # High-performance client (L1 nodes, metadata, signing & bridge)
βββ cli.py # Terminal CLI (Interactive Wizard, Read-only Status, Direct commands)
βββ web_app.py # Standalone local Web GUI dashboard (http://127.0.0.1:5000)
βββ requirements.txt # Python dependencies
βββ .env.example # Configuration template (optional defaults)
βββ .gitignore # Git ignore rules (prevents accidental key or cache commits)
βββ LICENSE # MIT Open-Source License
βββ .github/workflows/ci.yml # Multi-version CI automated test workflow
βββ tests/ # Comprehensive 30-test automated suite
βββ test_validation.py # Address validation & key sanitization tests
βββ test_client.py # Business logic, permissions, and mock bridge tests
βββ test_web_api.py # Local Flask backend endpoint tests
βββ test_live_readonly.py # Live connectivity test to Hyperliquid L1 nodes
βββ test_compilation_and_imports.py # Script compilation & subprocess import smoke tests
- Python 3.10, 3.11, 3.12, 3.13, or 3.14
- Git
git clone https://github.com/giga89/hyperliquid-withdrawer.git
cd hyperliquid-withdrawerpython3 -m venv venv
source venv/bin/activate(On Windows: venv\Scripts\activate)
pip install -r requirements.txtYou can use this tool in four ways depending on your preference:
The easiest and safest way to recover your assets. Run:
python3 cli.py wizard(or run python3 cli.py to open the main menu).
The Wizard automatically handles the full withdrawal pipeline:
- Prompts for Private Key: Securely masked input via
getpass. - Account Audit: Displays your Perpetual balance, Spot balance, open positions, active orders, and staking status.
- Cancel Open Orders: If active orders are locking up your margin, it prompts you to cancel them.
- Market-Close Positions: If active Perpetual positions are locking up margin, it offers to close them at market price to free up capital.
- Spot-to-Perp Transfer: Arbitrum bridge withdrawals are settled from the Perpetual account. If you hold USDC in Spot, it transfers it to Perpetual (
usdClassTransfer). - Bridge Withdrawal: Asks for your recipient Arbitrum One address (defaults to your own address) and submits the withdrawal (
withdraw3) directly to the Hyperliquid Bridge.
If you just want to verify your balances, open positions, or orders without providing a private key:
python3 cli.py status 0xYourEthereumAddressExample Output:
Account: 0xbe022927399F866BD840144220c32A0389B143BC
Account Overview & Liquidity
βββββββββββββββββββββββββββββ³ββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββ
β Category β Value β Notes / Action β
β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β Perp Account Value β $9.80 β Total margin + unrealized PnL β
β Perp Withdrawable (Bridge)β 9.80 USDC β Ready to withdraw to Arbitrum One β
β Perp Margin Used β $0.00 β Margin locked in active perpetual positions β
β Spot USDC Available β 0.00 USDC β Transferable to Perp to enable withdrawal β
β Total Available USDC β 9.80 USDC β Sum of Perp Withdrawable + Spot USDC β
βββββββββββββββββββββββββββββ΄ββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββ
If you prefer a visual web interface in your browser:
python3 web_app.py(or python3 cli.py web)
Open your browser to: http://127.0.0.1:5000
- Dark-Mode Modern UI: Fast, responsive interface.
- Inspect Any Address: Check balances with zero credentials.
- One-Click Withdrawals: Modal dialogs to withdraw USDC to Arbitrum One or move Spot USDC to Perp.
- 100% Local: All signing logic executes strictly on your local machine.
For advanced users or headless scripts:
-
Withdraw all available USDC to an Arbitrum address:
python3 cli.py withdraw --amount MAX --dest 0xYourArbitrumAddress
-
Transfer USDC from Spot to Perpetual:
python3 cli.py spot-to-perp --amount MAX
-
Market-close all open perpetual positions:
python3 cli.py close-positions
-
Cancel all pending orders:
python3 cli.py cancel-orders
- Destination Network: Arbitrum One (Layer 2).
- Token Received: Native USDC (
0xaf88d065e77c8cC2239327C5EDb3A432268e5831). - Bridge Network Fee: 1.00 USDC (fixed fee deducted by Hyperliquid validator bridge).
- Estimated Settlement Time: 3 to 5 minutes. Hyperliquid validators collect withdrawal requests, sign the bridge release, and execute the transfer on Arbitrum One.
- Tracking Arrival: You can monitor your incoming funds by searching your address on Arbiscan.
This repository includes a comprehensive 30-test suite covering validation, client security permissions, mock transactions, Flask web endpoints, and live L1 RPC connectivity.
pytest -vpython3 -m unittest discover -s tests -vtests/test_validation.py:- Sanitization of private key hex prefixes (
0x,0X, whitespace trimming). - Strict validation of Ethereum/Arbitrum addresses (checksum, 42-char length, hex character validation).
- Sanitization of private key hex prefixes (
tests/test_client.py:- Verifies that read-only client instances strictly reject any attempt to sign transactions (
PermissionError). - Verifies proper derivation of Ethereum addresses from private keys.
- Verifies withdrawal guardrails: rejecting invalid recipient addresses, blocking withdrawals exceeding available balance, and enforcing minimum bridge fee requirements.
- Verifies Spot-to-Perp balance transfers and error handling.
- Verifies that read-only client instances strictly reject any attempt to sign transactions (
tests/test_web_api.py:- Tests Flask web template rendering and REST API routes (
/api/summary,/api/withdraw,/api/spot-to-perp). - Verifies input validation and error responses.
- Tests Flask web template rendering and REST API routes (
tests/test_live_readonly.py:- Performs a live read-only query against production Hyperliquid L1 nodes to confirm connectivity without geo-blocking.
tests/test_compilation_and_imports.py:- Syntax-compiles every
.pyfile across the workspace. - Verifies clean subprocess imports.
- Verifies graceful pure-Python fallback operation when terminal styling libraries (
rich) are not installed.
- Syntax-compiles every
- MetaMask: Click the three dots next to your account name -> Account Details -> Show Private Key -> Enter your MetaMask password.
- Rabby Wallet: Click Manage Wallets -> select your active account -> Export Private Key. Never share your private key with anyone. This tool only uses it in local memory to compute the EIP-712 signature.
Hyperliquid accounts created or upgraded to Unified Account mode share collateral seamlessly between Spot and Perp. When Unified Account mode is enabled, internal transfers (usdClassTransfer) are disabled because your balances are already unified. The tool automatically detects this and proceeds directly to bridge withdrawal.
We strongly recommend withdrawing to your own non-custodial wallet (e.g. MetaMask, Rabby, Trezor, Ledger) on Arbitrum One. Centralized exchanges may take longer to credit bridge transactions or require specific deposit memo routing. Once the USDC is in your personal Arbitrum wallet, you can deposit to any exchange normally.
This project is 100% free and open-source under the MIT license, created to safeguard DeFi users' financial autonomy.
If this tool helped you recover your assets and you wish to support ongoing maintenance and development, tips/donations are warmly welcomed:
- Arbitrum One / Ethereum / Hyperliquid L1 (EVM):
0xD8BFC83AB8601540A2626260A0628198b9053AE7
This project is licensed under the MIT License - see the LICENSE file for details.
This software is an independent, non-custodial open-source utility provided "as is" under the MIT License, without warranty of any kind. This project is not officially affiliated with or endorsed by Hyperliquid or the Hyperliquid Foundation. Always inspect transactions and verify recipient addresses before submitting on-chain operations.