PythonAsyncioChromium CDPAutomation

DeBank portfolio aggregator

Asynchronous data extraction tool for cross-chain portfolio monitoring with advanced anti-detection.

DeBank portfolio aggregator - image 1
1 / 3

High-Efficiency Crypto Portfolio Aggregator

Summary

I developed a high-performance data extraction tool for DeBank that monitors cryptocurrency portfolio balances across multiple blockchain networks without incurring API costs. Leveraging Python and advanced browser automation, the tool bypasses bot detection systems to deliver financial reports for hundreds of wallets within minutes.


The Problem

Managing multiple cryptocurrency wallets requires real-time visibility into asset distribution across various blockchains and DeFi protocols. However, obtaining this granular data faces two major hurdles:

  1. Prohibitive Costs: Official APIs (such as DeBank's) often feature pricing models tailored for institutions rather than individuals or small teams.
  2. Anti-Scraping Defenses: Financial platforms employ aggressive anti-bot measures (Cloudflare, fingerprinting) that make standard scraping methods unreliable and prone to blocks.

The Solution

I engineered a data extraction script based on Python and the nodriver library. Unlike traditional scrapers using easily detectable libraries (like standard Selenium or requests), this tool communicates directly with the Chrome DevTools Protocol (CDP).

It simulates organic user behavior through fingerprint randomization and dynamic IP rotation (using NordVPN). The system processes a list of wallet addresses and asynchronously fetches, processes, and aggregates data into clean Excel/CSV reports, sorting assets by value and filtering out "dust" (low-value tokens).


Key Features

  • Asynchronous Concurrency: Built on asyncio, the system utilizes Semaphores to manage resource load, allowing for the simultaneous processing of multiple wallet profiles—drastically reducing execution time compared to linear processing.
  • Advanced Anti-Bot Detection: Employs nodriver to eliminate standard WebDriver leaks. It uses randomized browser arguments and rotates User-Agents via fake_useragent to maintain unique fingerprints.
  • Dynamic IP Rotation: Integrated with nordvpn-switcher-pro to automatically change IP addresses after a specific batch of wallets (e.g., every 10 queries), preventing rate limiting and IP bans.
  • Intelligent Data Aggregation: Includes a reporting module that organizes data by Total Balance, Network, and DeFi Projects. It features noise-filtering logic to ignore assets below specified value thresholds.

Tech Stack

CategoryTechnologies Used
Core LanguagePython 3.10+
ConcurrencyAsyncio, Semaphores
AutomationNodriver (CDP based), Fake_Useragent
Network/PrivacyNordVPN Switcher Pro
Data ProcessingPandas, OpenPyXL, CSV

"The Why": Overcoming Technical Challenges

Challenge: Bypassing Behavior Analysis, Fingerprinting, and Handling Dynamic Loading

The primary technical obstacle was DeBank's ability to detect non-human traffic patterns and the specific architecture of the site. DeBank is a modern, highly dynamic application that relies on lazy loading.

Data is not served statically—the page "loads in" only during interaction. This means a standard script fetching HTML code would only see an empty skeleton or a tiny fragment of the data. To gain full insight into a portfolio, the system must physically simulate scrolling, forcing the site's engine to fetch additional records from the API.

Solution: I moved away from traditional DOM-based automation in favor of Nodriver, which operates without the characteristic WebDriver variable, making the bot nearly invisible to anti-bot systems. To further humanize the traffic and handle the dynamic nature of the site, I designed a logic enhanced by human interaction simulation:

  • Interactive Scrolling: The script performs non-linear scroll movements at varying speeds, which triggers lazy load scripts and mimics a human naturally reading the data.
  • Environment Rotation: After each batch of wallets, execution is forcibly paused to trigger a system-level VPN switch (IP change).
  • Session Reconstruction: Before resuming, a completely new browser instance is created with a unique User-Agent and modified window geometry.

This approach successfully transformed a static bot into a "moving target," achieving near 100% efficiency in data retrieval from this demanding platform.


Results and Impact

  • Cost Efficiency: Eliminated the need for paid API subscriptions, saving significant monthly operational costs for data retrieval.
  • Performance: Data collection time reduced by approximately 90% compared to manual verification.
  • Reliability: Achieved consistent data availability and accuracy by successfully bypassing the anti-bot security measures that block standard scrapers.

© 2026 Konrad Kotulski. All rights reserved.