CoinGecko’s Onchain Wallet endpoints allow developers to track balances, trades, token transfers, and profit or loss for the same wallet address. Together, the four data sets provide a broader view of holdings, transaction activity, and trading performance across supported networks.
Developers can also merge trades and transfers into a time-sorted wallet activity feed while keeping profit and loss information separate. The tools target portfolio dashboards, tax applications, and wallet analytics services that require more than a current balance.
A wallet balance shows what an address holds, while trade and transfer records show how those holdings have changed. CoinGecko states that users need an API key on its Analyst plan or above to access all four endpoints covered in the workflow.
The Token Balances by Wallet Address endpoint returns assets held by one wallet across one or more networks. Developers can provide several networks through a comma-separated list.
For example, Ethereum, Base, and Arbitrum can appear in one request.
This structure removes the need to query each blockchain RPC separately and then manually combine the results. Each holding includes price_usd and value_usd. Therefore, applications can calculate portfolio values without connecting to another price source.
The endpoint also supports filters designed to improve the quality of returned holdings. Developers can use token_type to distinguish native assets from non-native tokens, including ERC-20 or SPL assets.
Meanwhile, value_usd_min and reserve_in_usd_min can exclude low-value holdings and low-liquidity spam tokens. The response also includes a networks array showing the USD value and holding count for each blockchain.
For the example wallet, a balance request covering Ethereum, Base, and Arbitrum produces a single data object. That lets applications review the wallet’s chain distribution before examining individual tokens.
CoinGecko’s Trades by Wallet Address endpoint retrieves swap history for a wallet on a specified blockchain. It supports more than 250 networks, including Ethereum and Solana.
Each trade contains a kind field that classifies the transaction as a buy or sell. The response also provides price_from_in_usd, price_to_in_usd, and volume_in_usd.
As a result, trade values can come directly from the response. A separate historical pricing feed is unnecessary for calculating the USD value of those swaps. Users can request a fixed period of up to 30 days by providing both from and to. Without those parameters, the endpoint returns the most recent seven days by default.
For larger histories, applications can use the next_cursor value in the response metadata to request additional pages. The Token Transfers by Wallet Address endpoint adds movements that a trade-only history would miss. These include sends, deposits, airdrops, and other token movements. Every transfer contains a direction and token amount.
An out direction means the wallet appears as the sending address, while in means it appears as the receiving address. CoinGecko’s workflow keeps both records and labels each activity by type. One swap may therefore create one trade record and two transfer records representing the assets that moved.
Developers can run the trade and transfer functions separately for each blockchain. They can then merge all results and sort them by timestamp to create one multichain wallet activity feed.
Read More: How Bitcoin Payment APIs Work, Where Businesses Can Use Them
The PnL by Wallet Address endpoint adds another layer by returning realized and unrealized profit and loss. Unlike individual activities, these figures represent aggregated performance totals.
The endpoint supports multiple networks in one request when those chains belong to the same virtual machine family. Ethereum, Base, and Arbitrum can therefore appear together since they use the EVM framework.
Solana requires a separate request as it belongs to another environment. Its trading history can still use network="solana" before the application requests its PnL separately.
The response includes total_realized_pnl_usd and total_unrealized_pnl_usd across the requested networks.
A networks array then breaks performance down by blockchain. CoinGecko also provides a token_stats array for token-level PnL information. Therefore, applications can display overall performance alongside chain-specific and asset-specific results.
PnL remains separate from the chronological activity feed since the two data types serve different purposes. Trades and transfers represent timestamped events, while realized and unrealized PnL represent calculated totals.
Running the described activity_feed.py workflow prints the wallet’s portfolio value, merged activity feed, and PnL summary. It also provides the network-level performance breakdown.
CoinGecko’s four wallet endpoints combine portfolio balances, trades, transfers, and PnL into one workflow. Developers can track multichain holdings and merge timestamped activities while keeping performance totals separate. The structure provides the core data needed for portfolio dashboards, tax tools, and wallet analytics.
Join our WhatsApp Channel to get the latest news, exclusives and videos on WhatsApp
_____________
Disclaimer: Analytics Insight does not provide financial advice or guidance on cryptocurrencies and stocks. Also note that the cryptocurrencies mentioned/listed on the website could potentially be risky, i.e. designed to induce you to invest financial resources that may be lost forever and not be recoverable once investments are made. This article is provided for informational purposes and does not constitute investment advice. You are responsible for conducting your own research (DYOR) before making any investments. Read more about the financial risks involved here.