DeFi Protocol Connection from Mobile Wallet

NOVASOLUTIONS.TECHNOLOGY 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 1 servicesAll 1735 services
DeFi Protocol Connection from Mobile Wallet
Complex
from 1 week to 3 months
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing DeFi Protocol Connection in Mobile Wallet

DeFi from a mobile wallet isn't opening a WebView with a dApp. It's direct interaction with smart contracts: calling Uniswap Router methods, Aave LendingPool, Compound cToken. The interface is built on JSON ABI; transactions are signed locally; data is read via RPC without intermediaries.

Architecture: ABI-First Approach

Each DeFi protocol is a set of smart contracts with public ABI. The app's job: encode the call per ABI, sign the transaction, send it. For EVM, the web3swift (iOS) or web3j (Android) library provides EthereumContract for dynamic ABI interaction.

// iOS — call Uniswap V3 QuoterV2 for a quote
let quoterABI = try! EthereumContract(json: quoterV2ABI)
let result = try await quoterABI.read(
    "quoteExactInputSingle",
    parameters: [tokenIn, tokenOut, fee, amountIn, sqrtPriceLimitX96] as [AnyObject],
    transactionOptions: nil
)

For Solana and its protocols (Raydium, Orca, Jupiter), Anchor SDK generates IDL (Interface Definition Language), similar to ABI. SolanaSwift + Anchor allow typed program instruction calls.

Uniswap V3: Swap via Router

Uniswap V3 is the most complex of popular protocols to integrate on mobile. SwapRouter02 (0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45) accepts ExactInputSingleParams:

// Android — encode exactInputSingle call
val function = Function(
    "exactInputSingle",
    listOf(
        DynamicStruct(
            Address(tokenIn),
            Address(tokenOut),
            Uint24(fee),         // 500, 3000 or 10000
            Address(recipient),
            Uint256(amountIn),
            Uint256(amountOutMinimum), // accounting for slippage
            Uint256(BigInteger.ZERO)   // sqrtPriceLimitX96
        )
    ),
    listOf(Uint256())
)
val encodedData = FunctionEncoder.encode(function)

Before swapping, you need approve to SwapRouter: ERC-20 approve(routerAddress, amountIn). Without it, the swap transaction fails with TransferHelper: TRANSFER_FROM_FAILED.

For quotes: QuoterV2.quoteExactInputSingle (read-only, off-chain). Never use onchain Quoter for realtime UI—it's eth_call, which hammers the node.

Aave V3: Supply and Borrow

Aave Pool (0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2 on Mainnet) accepts supply(asset, amount, onBehalfOf, referralCode). Logic:

  1. Approve Pool on amount of token.
  2. Call supply—get aToken in return.
  3. For borrowing—check getUserAccountData, ensure healthFactor > 1.5 before recommending a borrow amount.

HealthFactor below 1.0 means liquidation. A mobile app must display HealthFactor in real time and warn as it approaches 1.1.

WalletConnect for dApp Browser

If the wallet wants external dApp connection via mobile browser—WalletConnect v2 SDK (com.walletconnect:walletkit for Android, WalletConnectSwift for iOS). The protocol establishes an encrypted channel between dApp and wallet. Wallet receives sign requests, shows transaction details to the user, signs locally, returns the signed hex.

State Management and Protocol Data Cache

DeFi data updates every block. Uniswap pool rate, Aave interest rates—read via Multicall3 every 12–15 seconds. Store in reactive state (Combine on iOS, Flow/StateFlow on Android). On RPC error, graceful degradation: show last known data with timestamp.

Typical Problems

Don't hardcode slippage tolerance. 0.5% for stablecoin pairs, 1–3% for volatile. Too low: transaction always reverts on volatile market. Too high: sandwich attack eats the difference.

Gas estimation for DeFi can miss: Uniswap V3 at some routes consumes 200k–500k gas. Multiply estimation by 1.3, not 1.1.

Timeline: 1–3 months depending on protocol set. One protocol (e.g., Uniswap V3 swap only): 1–2 weeks with testnet testing. Full DeFi hub with Uniswap + Aave + Compound: 2–3 months.