Skip to content
All case studies

Case study · Fintech

Pix payments at superapp scale

Building and evolving the Pix payment modules of a high-traffic superapp used by millions, with Coroutines, Flow and Clean Architecture.

Role
Android Engineer III → Senior Android Engineer
Company
Zup Innovation
Period
Sep 2023 – Present

Context

Zup Innovation is a Brazilian technology company that builds digital products for large clients. I work on the native Android app of a high-traffic superapp in the financial sector, where Pix, Brazil’s instant payment system, is one of the most used features. Millions of active users rely on it to move money every day.

I joined in September 2023 as Android Engineer III and was promoted to Senior Android Engineer in December 2024.

Challenge

Payments leave little room for error. Every change has to hold up on four fronts at once:

  • Security and correctness. Each flow talks to high-security REST APIs and has to handle timeouts and failures without leaving users unsure whether their money moved.
  • Performance at scale. With millions of users on every kind of device, small regressions in rendering or threading quickly turn into support tickets.
  • Many squads, one app. Features need clear boundaries so several teams can ship in parallel without stepping on each other.
  • Release cadence. A superapp ships often, so the pipeline has to be fast and dependable.

Approach

Modular payment features. I led the development of core native features as self-contained modules with explicit dependencies, which improved modularity and code reuse across flows.

Clean Architecture with MVVM. The UI is built with Jetpack Compose and only renders state. ViewModels turn user intents into that state, use cases hold the business rules, and repositories hide where the data comes from. Each layer can be tested in isolation.

Coroutines and Flow end to end. Structured concurrency keeps network and disk work off the main thread and cancels it when the user leaves a screen. Screen state is a single StateFlow, so the UI can’t drift out of sync with what the app knows.

PixViewModel.kt
@HiltViewModel
class PixViewModel @Inject constructor(
    private val sendPix: SendPixUseCase,
) : ViewModel() {

    private val _uiState = MutableStateFlow<PixUiState>(PixUiState.Editing())
    val uiState: StateFlow<PixUiState> = _uiState.asStateFlow()

    fun authorize(request: PixRequest) {
        // A payment must never be submitted twice.
        if (_uiState.value is PixUiState.Processing) return
        _uiState.value = PixUiState.Processing

        viewModelScope.launch {
            _uiState.value = sendPix(request).fold(
                onSuccess = { receipt -> PixUiState.Success(receipt) },
                onFailure = { error -> PixUiState.Failure(error.toPixError()) },
            )
        }
    }
}

Secure API integration. I work closely with product and backend teams to integrate high-security REST APIs for digital financial workflows.

CI/CD on Jenkins. I help maintain the pipelines that build, test and ship the app. Reliable automation is what makes frequent releases safe.

Mentoring. I also mentor junior engineers on Kotlin, MVVM architecture and unit testing best practices.

Architecture

module graph:appHilt · navigation:feature:pixpayments:feature:…other squads:core:networkRetrofit · TLS:core:uiCompose:feature:pix · Clean ArchitectureUI · Jetpack ComposePixTransferScreenViewModelStateFlow<PixUiState>Use casesSendPixUseCase · suspendRepositoryCoroutines · Flow · RoomHTTPSPix payment APIsREST · high securityJenkins CI/CDbuild · unit tests · release
Simplified and illustrative. Real module names and APIs are under NDA.

In this simplified view, feature modules depend on core modules but not on each other, and the app module wires everything together with Hilt. Inside a feature, dependencies point inwards: the UI knows the ViewModel, the ViewModel knows the use cases, and only the data layer knows about Retrofit and Room.

Results

  • Scalable payment modules serving a superapp used by millions of active users.
  • Better performance and stability, driven by Coroutines, Flow and Clean Architecture standards.
  • Faster release cycles, backed by robust CI/CD pipelines on Jenkins.
  • A promotion from Android Engineer III to Senior Android Engineer in December 2024.

Stack

The tools behind this work, all used in production:

  • Kotlin
  • Jetpack Compose
  • Coroutines
  • Flow
  • Hilt
  • Retrofit
  • Jenkins

Details are simplified and client names are omitted to respect confidentiality.