Skip to content

Striker Market Case Study

Striker Market is a Vercel-hosted sample application that shows how a tenant-owned consumer product can integrate with FWallet without sharing the FWallet admin dashboards with end users.

The sample uses FWallet for wallet creation, signed money movement, tenant operations, request logging, observer monitoring, settlement decisions, and payout demos.

What the Demo Shows

ViewPurpose
MarketsUser-facing match markets and position placement.
WalletDemo deposits, balance changes, and wallet actions.
PositionsUser positions, exposure, and settlement history.
OwnerTenant-owner operating view for liquidity, P&L, and collected fees.
OperatorOperational controls for fixture phase, settlement, and payout decisions.
ObserverRead-only monitoring for request logs, signing diagnostics, and demo health.

The live demo runs at https://fwallet-api-striker-market.vercel.app.

Architecture

Browser
-> Striker Market Next.js app on Vercel
-> /api/demo/* route handlers
-> @f-wallet/node SDK and HMAC signing helpers
-> FWallet API
-> PostgreSQL ledger, workflow cases, request logs, and tenant accounts
Shared demo state
-> Vercel KV or Upstash Redis
-> positions, wallet actions, settlements, P&L, payout decisions, activity history

Striker Market is intentionally separate from the FWallet dashboards:

  • Consumer actions stay inside the Striker product.
  • Server-side route handlers own FWallet API calls and signing secrets.
  • Tenant admins still use the FWallet tenant dashboard for developers, treasury, analytics, approvals, and request logs.
  • Super admins still use the FWallet admin dashboard for organization, fee, platform analytics, and cross-tenant controls.

Required Environment

FWALLET_API_BASE_URL=https://staging-api.fwallet.co.ug
FWALLET_STRIKER_KEY_ID=ak_...
FWALLET_STRIKER_SIGNING_SECRET=...
FWALLET_STRIKER_OBSERVER_KEY=fwk_test_...
STRIKER_DEMO_RESET_TOKEN=...
KV_REST_API_URL=...
KV_REST_API_TOKEN=...

KV_REST_API_URL and KV_REST_API_TOKEN can also be supplied as UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.

SDK Usage

The sample depends on the published Node package:

{
"dependencies": {
"@f-wallet/node": "0.1.0"
}
}

Use @f-wallet/node for server-side integrations that need HMAC signing. Use @f-wallet/typescript for fetch-based TypeScript clients, @f-wallet/react for React Query helper hooks, and the language-specific SDKs listed in the SDK overview.

API Calls in the Demo

Demo actionFWallet behavior
Create or load demo walletCreates or reads tenant-scoped wallets through the wallet APIs.
Place a positionPosts a signed transfer-like wallet movement with an idempotency key.
Deposit demo fundsRecords a demo wallet funding event through the deposit or wallet action route.
Settle a marketPosts settlement movements and records P&L in shared demo state.
Request payoutCreates a payout approval case and moves funds to suspense.
Approve payoutSettles approved funds from suspense into payout clearing.
Observer request logReads FWallet request logs with a restricted observer key.
Signing diagnosticVerifies HMAC headers, nonce, timestamp, content hash, and signature path.

Financial writes are idempotent. Route handlers should create deterministic idempotency keys from the demo action, fixture, wallet, and user position so browser retries do not duplicate ledger entries.

Demo Flow

  1. Open the live demo.

    Go to fwallet-api-striker-market.vercel.app.

  2. Create a wallet and fund it.

    Use the Wallet view to add demo funds. The UI shows the user-facing balance and activity history.

  3. Place a market position.

    Open Markets, choose a fixture, and place a position. The app signs the server-side request and records the action with an idempotency key.

  4. Move the fixture through phases.

    Use Operator controls to open, lock, settle, and clear payout decisions. Operator state is shared through Redis.

  5. Review owner analytics.

    The Owner view shows tenant P&L, collected fees, liquidity, payout exposure, and settlement outcomes.

  6. Inspect observer signals.

    The Observer view surfaces request logs, signing diagnostics, and operational health without exposing write controls.

Resetting the Demo

Authorized operators can reset the shared demo state:

Terminal window
curl -X POST https://fwallet-api-striker-market.vercel.app/api/demo/reset \
-H "Authorization: Bearer $STRIKER_DEMO_RESET_TOKEN"

This resets local demo state such as positions, settlement results, wallet actions, P&L, payouts, and activity history. It does not require deleting ledger records. Ledger corrections should always be posted as new entries, not by mutating old financial records.

Reproducing Locally

Terminal window
bun install
bun run dev:striker

The app runs on http://localhost:3004.

For local FWallet API calls, set FWALLET_API_BASE_URL to the target API and provide either staging credentials or a local tenant key. Keep signing secrets in your local shell, Vercel environment variables, or Vault; do not commit them.