Feature documentation — all functionality explained
The Sharematch Web App is a lightweight, single-page internal operations tool that gives the team real-time visibility and
control over the Sharematch custodial treasury on Solana Devnet. It connects directly to the
Sharematch REST API (api.sharematch.me),
which in turn communicates with two on-chain Anchor programs: Treasury and Markets.
instance-20260306-093803 (us-central1-c).
The web container serves static files via nginx. The API container runs on port 3000 and is reverse-proxied to api.sharematch.me.The primary input at the top of the page. Enter a Sharematch User ID (UUID format) and click Look up (or press Enter). The app fires two API calls in parallel and populates the results section below.
23a81421-e3d6-acf7-d2f3-b774d6d7c242/derive (pure math, no RPC) and /balance (live Solana RPC).{
"userId": "23a81421-e3d6-acf7-d2f3-b774d6d7c242",
"userStatePda": "HxNXMtaVSs6JBJ99znmkDy5AQgPE8s3PWTKzTJCfBPgt",
"smtAta": "CxU7Nn2TzCFDQC6Awgc34Wa9yNrtEJ9DXZKyimipFRne",
"usdcAta": "9Hk3m...USDC ATA address"
}
{
"smtBalance": 1250.00,
"usdcBalance": 0.00
}
After a successful lookup, a QR code is generated client-side from the user's USDC Associated Token Account (ATA) address. Scanning it with any Solana-compatible wallet app opens a payment to that address. The address is also displayed as text and can be clicked to copy to the clipboard.
Displays the three core addresses derived for every Sharematch user. Each address links directly to Solana Explorer (Devnet) in a new tab.
| Address | Type | Description |
|---|---|---|
| UserState PDA | Program Account | The user's on-chain state account, owned by the Treasury program. Seeds: ["user", user_id_bytes] |
| SMT ATA | Token Account | Associated Token Account for SMT (Sharematch Token) owned by the UserState PDA |
| USDC ATA | Token Account | Associated Token Account for USDC owned by the UserState PDA — this is the deposit address |
Displays the live on-chain token balances for the user's SMT and USDC token accounts. Values are fetched in parallel with the derive call during lookup and formatted to up to 6 decimal places. SMT balances are shown in purple, USDC in green.
A card sitting below the user lookup form links directly to the Sharematch REST API's Swagger UI documentation
at https://api.sharematch.me/api/docs.
There is also a pill-shaped API Docs button in the top-right header for quick access from anywhere on the page.
The Swagger UI lets you browse all endpoints, inspect request/response schemas, and execute live API calls directly in the browser — useful for testing or exploring the full capability of the API beyond what the web app exposes.
Always visible at the bottom of the page. On every page load the app calls
GET /admin/treasury-balance,
which reads the operator keypair on the server, derives its SMT and USDC token accounts, and returns live balances.
A Refresh button allows re-fetching at any time without reloading the page.
| Field | Type | Description |
|---|---|---|
| wallet | string | Base58 public key of the operator wallet — currently 8BTN2sJUBYa12u9sdUc9AbMknPrTE6DHrGYoDVey7wok |
| smtBalance | number | SMT token balance held in the operator's SMT ATA |
| usdcBalance | number | USDC token balance held in the operator's USDC ATA — this is where swept deposits land |
/secrets/operator-keypair.json and returns live on-chain balances.{
"wallet": "8BTN2sJUBYa12u9sdUc9AbMknPrTE6DHrGYoDVey7wok",
"smtBalance": 0.00,
"usdcBalance": 38.00
}
After looking up a user, a Process Deposit form appears pre-filled with the user's ID and a freshly
generated deposit hash. This calls the on-chain process_deposit
instruction via the API, which sweeps USDC from the user's ATA to the treasury and mints an equivalent amount of SMT 1:1 to the user.
50). The app automatically multiplies by 1,000,000 to convert to micro-units before sending.crypto.getRandomValues(). Click Regen to generate a new one, or paste your own blake3 hash.process_deposit transaction on-chain — idempotent via a DepositReceipt PDA keyed on the hash.{
"amount": 50000000, // USDC in micro-units (50 USDC = 50,000,000)
"depositHash": "a3f1c2d4...64 hex chars" // blake3 idempotency key
}
{
"signature": "5J8xKqP...Solana tx signature"
}
| Validation | Rule | Behaviour |
|---|---|---|
| userId | Required | Error shown if no lookup has been run yet |
| amount | > 0 | Blocks submission with inline error |
| depositHash | Exactly 64 hex chars | Auto-generated if blank; validated before sending |
| Token | Mint Address | Role |
|---|---|---|
| SMT | 7oqAQc5ZSyk2JSmtS79DncwtxQBwRfgvQYCt1V9VZgmU | Sharematch's internal token. Minted 1:1 when USDC is deposited. Burned when USDC is withdrawn. Used as collateral in the Markets program. |
| USDC | 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU | Devnet USDC (test token). The external settlement currency. Held in the treasury after deposit sweeps. |
process_deposit → USDC moves to operator's treasury ATA → SMT minted 1:1 to user's SMT ATA.crypto.getRandomValues() with a Regen buttonPOST /users/{userId}/depositGET /admin/treasury-balance added to the NestJS API/secrets/operator-keypair.json and queries live Solana RPC balancesMR-Coder-Coder/sharematch-web created{ amount, depositHash }