Aggregating Balances from Multiple Crypto Exchanges in a Mobile App

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Aggregating Balances from Multiple Crypto Exchanges in a Mobile App
Medium
~5 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    860
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    746
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1163
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1035
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    970
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    564

Aggregating Balances from Multiple Crypto Exchanges in a Mobile App

A trader holds assets on Binance, Bybit, and OKX — each exchange requires opening a separate app or browser tab. This wastes time and increases the risk of errors when manually calculating the total position. For a large trader, manual data collection can take up to 2 hours per day, and ticker conversion mistakes cost hundreds of dollars monthly. We solve this by creating a unified dashboard (crypto portfolio) directly in the mobile app. The user sees the total position per token and a per-exchange breakdown on one screen. Our team specializes in exchange API integration: we have delivered over 20 such projects for iOS and Android. This approach reduces data collection time by an average of 85% compared to manual monitoring, saving the trader up to $500 per month.

How the Aggregation Architecture Works

Each exchange is a separate adapter implementing a common protocol. This pattern allows adding new exchanges without modifying the aggregator's business logic. Here’s an example in Kotlin for Android:

// Android, Kotlin
interface ExchangeAdapter {
    suspend fun fetchSpotBalances(): Result<List<Balance>>
    suspend fun fetchFuturesBalances(): Result<List<Balance>>
    val exchangeId: String
}

data class Balance(
    val ticker: String,
    val available: BigDecimal,
    val locked: BigDecimal,
    val exchangeId: String
)

class BinanceAdapter(private val apiKey: String, private val secret: String) : ExchangeAdapter {
    override val exchangeId = "binance"

    override suspend fun fetchSpotBalances(): Result<List<Balance>> = runCatching {
        val timestamp = System.currentTimeMillis()
        val queryString = "timestamp=$timestamp&recvWindow=5000"
        val signature = HmacSHA256.sign(queryString, secret)
        val response = apiClient.get("/api/v3/account?$queryString&signature=$signature")
        response.balances
            .filter { it.free.toBigDecimal() > BigDecimal.ZERO || it.locked.toBigDecimal() > BigDecimal.ZERO }
            .map { Balance(it.asset, it.free.toBigDecimal(), it.locked.toBigDecimal(), exchangeId) }
    }
}

The aggregator runs all adapters in parallel using async/await (Kotlin coroutines or Swift TaskGroup), collects results, and collapses positions by ticker. In practice, with 10 exchanges, aggregation takes less than 2 seconds — 4x faster than sequential collection.

class BalanceAggregator(private val adapters: List<ExchangeAdapter>) {

    suspend fun aggregate(): AggregatedPortfolio = coroutineScope {
        val results = adapters.map { adapter ->
            async { adapter.fetchSpotBalances() }
        }.awaitAll()

        val allBalances = results.flatMap { it.getOrElse { emptyList() } }

        // Group by ticker, sum
        val byTicker = allBalances.groupBy { it.ticker }
        val aggregated = byTicker.map { (ticker, positions) ->
            AggregatedPosition(
                ticker = ticker,
                totalAvailable = positions.sumOf { it.available },
                byExchange = positions.associateBy { it.exchangeId }
            )
        }
        AggregatedPortfolio(positions = aggregated, fetchedAt = Instant.now())
    }
}

Why Error Isolation Matters

Errors from one exchange must not bring down the whole. If Bybit returns a 503, the user should see data from Binance and OKX with a label "Bybit: data unavailable". Hence Result<T> is mandatory — not optional — as the return type. On the UI: each source exchange shows a status (green/red/gray). This async aggregator yields up to 4x time savings compared to sequential collection.

Problems We Solve

Different ticker formats. Binance calls Tether USDT, some exchanges use USDT, others USDt. OKX uses TON-USDT as the trading pair for TON, with the base asset TON. Normalization is needed: an alias table and a canonical ticker for each asset. Incorrect conversion can lead to deposit loss — we eliminate this risk.

API keys and security. The user adds multiple key pairs. Each pair is encrypted separately via Android Keystore / iOS Keychain, tied to biometrics. When making a request to an exchange, the key is decrypted in memory, used, and not kept in the heap longer than necessary.

Clock drift. Binance and Bybit require the timestamp to be close to server time (±5 seconds). On the first request to each exchange, we synchronize time via their /time endpoint and keep an offset.

How It Looks in the UI

The main screen shows a list of assets with total positions. Tapping an asset reveals a per-exchange breakdown. An additional screen provides a breakdown by exchange: how much in USD on each. Updates via pull-to-refresh and automatically every 5 minutes while the app is active.

Exchange Protocol Comparison

Exchange Endpoint Authorization Notes
Binance /api/v3/account HMAC-SHA256 recvWindow, clock sync
Bybit V5 /v5/account/wallet-balance HMAC-SHA256 accountType: UNIFIED
OKX /api/v5/account/balance HMAC + passphrase 3 auth headers
Gate.io /api/v4/spot/accounts HMAC-SHA512

Aggregation Approach Comparison

Approach Speed Error Isolation Ease of Adding Exchange
Ours (adapters + async aggregator) High (parallel requests) Full (Result<T> per adapter) Low (single protocol)
Sequential collection Low (wait for each response) Partial (error breaks the chain) Medium (logic in one place)
Single API gateway Medium (network hop) Depends on implementation High (gateway must be maintained)

How to Add a New Exchange: Step-by-Step

  1. Study the exchange documentation: endpoints, authorization, limits.
  2. Implement a class that implements ExchangeAdapter in Swift (iOS) or Kotlin (Android).
  3. Add ticker normalization to the common alias table.
  4. Test with the real API.
  5. Integrate into the UI and release an update.

How Long Does Aggregation Take?

With 4 exchanges, the full aggregation cycle takes about 1 second. The user can force an update via pull-to-refresh at any time.

Why Choose Our Implementation

  • Over 5 years of experience in financial mobile app development.
  • We guarantee security: all API keys are encrypted on the device, never transmitted to the server.
  • Certified engineers with experience on cryptocurrency projects (iOS, Android, Flutter).

What’s Included

  • Development of adapters for 4 exchanges (or your specified list).
  • Secure key storage setup.
  • Customizable UI dashboard.
  • Push notification integration for balance changes.
  • Aggregator API documentation and user instructions.
  • One month of support after delivery.

Timeline and How to Order

Integration of three exchanges with aggregation and UI takes between 5 and 8 working days. Each additional exchange adds 1 day. Pricing is determined individually after requirements analysis. Contact us to discuss your project and get an accurate estimate. Get a consultation — just reach out. We also offer extended support and customizations upon request.

More about security

All API keys are stored only on the user’s device. On first launch, an encryption key is generated and tied to the biometric sensor. Decryption happens immediately before sending the request, after which the key is wiped. No data is transmitted to our servers.

Source: App Store Review Guidelines — sections 4.2 and 5.1 cover security and app functionality.

Mobile App Analytics: Firebase, Amplitude, AppsFlyer and Attribution

Our team regularly encounters projects where analytics is already "set up" but yields no real insights. A typical example is a startup with 50k DAU: tracking dozens of events without a single answer to the question "why don't users reach payment?". In two weeks we built a basic funnel and found that 70% of users drop off at the phone number verification screen. After fixing the bug, retention increased by 12%. The takeaway: analytics should start with specific questions, not tracking everything indiscriminately.

Why Event Taxonomy is the Foundation of Mobile App Analytics?

Firebase Analytics, Amplitude, Mixpanel — technically similar. The difference lies in what you put into them. A common mistake: events like screen_view, button_tap_1, button_tap_2 without context. A month later, no one remembers what button_tap_2 means.

Proper taxonomy: object + action + context. product_viewed, checkout_started, payment_completed with parameters product_id, category, price, source. This allows building funnels, cohort analysis, and retention without additional tracking.

We document the naming convention in a tracking plan — a document (Google Sheet or Amplitude Data Catalog) describing every event, its parameters, and triggering conditions. The tracking plan is synced with the analytics team before development begins, not after. This approach ensures that data remains interpretable months later and doesn't become a dump. Experience from 50+ projects confirms: without a tracking plan, analytics maintenance costs increase 2-3 times due to rework.

What Should You Choose for Mobile App Analytics: Firebase, Amplitude, or Mixpanel?

The table below highlights key differences between the three popular platforms. Choice depends on budget, traffic, and tasks.

Criteria Firebase Analytics Amplitude Mixpanel
Free limit Unlimited (Spark plan) Up to 10M events/month Up to 1K MTU/month (Special)
Data latency Up to 24 hours (standard) Minutes (real-time) Minutes (real-time)
Funnels and cohorts Basic funnels, limited count Deep funnels, Journeys, cohorts Funnels, Retention, Insights
BigQuery export Yes (free, raw data) Yes (subscription) Yes (Enterprise)
Session Replay No Yes (iOS/Android SDK) No
Ad integration Google Ads (native) Via Universal Links Via partners

Firebase Analytics — free, deep integration with Google Ads, BigQuery export for raw data. Limitations: data latency up to 24 hours, limited funnels. For startups with Google Ads traffic, it's the first choice.

Amplitude — product analytics focused on cohorts and user journeys. Journeys (formerly Pathfinder) shows actual paths between events — not assumed funnels but real routes. Session Replay records sessions for UX analysis. The free tier up to 10M events/month is enough for most products at launch.

Mixpanel — close to Amplitude, stronger in real-time segmentation. Insights, Funnels, Retention cover 90% of product analysts' tasks.

How to Solve Multi-Channel Attribution with AppsFlyer?

Knowing where a user came from is a separate task. Firebase Attribution works only within the Google ecosystem. For multi-channel attribution (Facebook Ads, TikTok, Apple Search Ads, programmatic), an MMP (Mobile Measurement Partner) is needed.

AppsFlyer is the market leader. OneLink — universal deep link working on iOS and Android, correctly attributing installs from any channel. Protect360 — built-in fraud protection (fake installs, click injection on Android). Adjust and Branch are competitors with similar features. Branch excels in deep linking; Adjust is popular in gaming.

According to Apple, with iOS 14.5, apps must obtain user permission via ATT before collecting IDFA for tracking. AppsFlyer uses probabilistic matching (IP + user agent + timing) for these users — accuracy is lower but better than nothing. SKAdNetwork and Privacy Preserving Attribution provide aggregated data from Apple with a 24-72 hour delay.

How to Set Up Crash Analytics to Not Miss Bugs?

Firebase Crashlytics is the standard for crash reporting. It automatically groups crashes by stack trace, shows affected users %, and sends velocity alerts when crash rate increases by more than 10% per hour.

Important: symbolication. On iOS, .dSYM files must be automatically uploaded with each build — via Fastlane upload_symbols_to_crashlytics or Xcode Cloud built-in. Without symbols, crashes in Crashlytics appear as memory addresses. This happens more often than expected when switching to a new CI — in one project with 500k users, we found that 40% of crashes remained unsymbolicated due to a missing CI/CD step. After automation, bug response time dropped from 3 hours to 15 minutes.

For React Native and Flutter, @sentry/react-native and sentry_flutter provide additional context: breadcrumbs, network requests before the crash, Redux/Provider state.

Below is a comparison of popular crash analytics tools to choose according to your needs.

Criteria Firebase Crashlytics Sentry Instabug
Free limit Unlimited (Spark) 5k events/month 250 MAU
Grouping By stack trace + parameters By fingerprint By stack trace + metadata
Symbolication Automatic (via file) Automatic (via CLI) Automatic
Velocity alerts Yes (by % change) Yes (by count) Yes (by threshold)
Extra context Logs, Keys, Custom Keys Breadcrumbs, User, Tags User steps, network requests
Price Free (in Firebase) Paid plans available Paid plans available

Environment Setup

Three environments with separate Firebase projects: dev, staging, production. Mixing analytics from test sessions and production is a common mistake that skews all metrics. On iOS via GoogleService-Info.plist per scheme, on Android via google-services.json in each flavor folder.

Timelines: basic analytics with Firebase + Crashlytics — 3-5 days. Full tracking plan + Amplitude/Mixpanel with funnels and cohorts — 2-3 weeks. Attribution via AppsFlyer with deep linking and fraud protection — 1-2 weeks. Cost is calculated individually based on integration complexity.

What Is Included in Our Work

As part of analytics implementation, we provide:

  • Development and approval of a tracking plan with product and marketing teams.
  • SDK integration (Firebase, Amplitude, Mixpanel, AppsFlyer) considering your stack (Swift/Kotlin/Flutter/React Native).
  • Setup of funnels, cohorts, dashboards, and alerts.
  • Automation of symbolication and .dSYM upload via Fastlane.
  • Documentation of events and parameters.
  • Team training on the analytics platform.
  • Two weeks of post-release support and tracking adjustments.

Our experience: 7 years of analytics implementation and over 80 successful projects in mobile development. We guarantee data correctness and transparency at every stage.

Contact us for a consultation on setting up analytics for your app. Request an audit of your current analytics — and we will show you which metrics you are losing.