Skip to content

abraham-ny/PolyTracker-Android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PolyTracker

Package: com.traderocker.polytracker
Min SDK: 19 (Android 4.4 KitKat)
Target SDK: 33
Language: Java (no lambdas, no view-binding, classic Android)


Overview

PolyTracker is a lightweight Android app that lets you monitor any number of Polymarket prediction-market wallet accounts in real time.
It uses only the free, unauthenticated Polymarket Data API — no login or API key is needed.


Features

Feature Details
Track unlimited wallets Add any 0x… wallet address with an optional human-readable label
Colour-coded PnL Account label is green (profit) or red (loss) based on total cash PnL
List item stats Balance · Portfolio Value · Unrealized PnL shown inline in the list
Details dialog Tap any row for Cash Balance, Portfolio, Total PnL, Realized PnL, Unrealized PnL, Open Positions, and wallet address
Auto-refresh All accounts refresh every 60 seconds in the background
Manual refresh Tap the refresh icon in the action bar to refresh immediately
Persistent storage Accounts are saved to SharedPreferences and survive app restarts
Long-press to remove Long-press a list item to confirm removal

API Endpoints Used

Endpoint Purpose
GET https://data-api.polymarket.com/value?user=ADDRESS Total holdings value (USDC)
GET https://data-api.polymarket.com/positions?user=ADDRESS&sizeThreshold=.1 Per-market positions with PnL fields

Both endpoints are public and require no authentication.


Project Structure

PolyTracker/
├── app/src/main/
│   ├── AndroidManifest.xml
│   ├── java/com/traderocker/polytracker/
│   │   ├── MainActivity.java          — main screen, dialogs, refresh logic
│   │   ├── TrackedAccount.java        — data model
│   │   ├── AccountAdapter.java        — ListView adapter with formatting
│   │   ├── PolymarketApiClient.java   — HTTP calls to Polymarket Data API
│   │   └── AccountStorage.java        — SharedPreferences persistence
│   └── res/
│       ├── layout/
│       │   ├── activity_main.xml
│       │   ├── item_account.xml
│       │   ├── dialog_add_account.xml
│       │   └── dialog_account_details.xml
│       ├── menu/menu_main.xml
│       └── values/
│           ├── strings.xml
│           ├── colors.xml
│           └── styles.xml
├── build.gradle
├── app/build.gradle
├── settings.gradle
└── gradle.properties

How to Build

  1. Clone / copy the project into Android Studio (Bumblebee or newer recommended).
  2. Let Gradle sync.
  3. Run on an emulator (API 19+) or a real device.
  4. No external dependencies — only standard Android SDK APIs are used.

Usage

  1. Tap + in the action bar to add a wallet.
  2. Enter the wallet's 0x… address (42-character hex string).
  3. Optionally enter a friendly label (e.g. "My Account" or a trader's name).
  4. Tap Add — the app immediately fetches data.
  5. Tap any row to see the full details dialog.
  6. Long-press a row (or use the Remove button in the dialog) to stop tracking.

Data Interpretation

Field Meaning
Balance Total USD value reported by /value (open positions + claimable)
Portfolio Sum of currentValue across all open positions
Total PnL Sum of cashPnl per position (realised gains – cost basis change)
Realized PnL Sum of realizedPnl per position (closed trades)
Unrealized PnL Sum of currentValue – initialValue (mark-to-market on open positions)
Open Positions Count of positions with size > 0.1

Permissions

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

No location, camera, storage, or other sensitive permissions.


Notes

  • The Polymarket Data API does not expose a raw "USDC cash balance" (uninvested USDC sitting in the wallet). The /value endpoint returns total portfolio value. The fields labelled "Balance" therefore represent portfolio value, not idle cash.
  • Refresh is staggered per-account using AsyncTask; the UI updates as each account finishes loading, so large lists don't block the UI.
  • The app targets the classic android.app.Activity and android.widget.* stack — no AndroidX, no Jetpack, no Kotlin.

About

Polymarket wallet/account watcher for android. A web and desktop version will soon be available

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages