My Gems

Your personally curated collection of favorite tokens

Secure non-custodial market-making system design (for newly launched DEX tokens)
This is a liquidity support design only. No custody, no guarantees, no price manipulation.

Transparency & compliance disclosure

  • Provides liquidity support only (tightening spreads, reducing volatility spikes).
  • No promises of price floors, pumps, guaranteed returns, or “number-go-up” outcomes.
  • Designed to avoid wash trading, fake volume, and artificial price manipulation.
  • Users remain fully responsible for their funds, strategy parameters, and jurisdictional compliance.

High-level system architecture

  • Client (browser): generates wallets locally, signs transactions locally, runs strategy/risk engine, and submits signed transactions (or “intents”) to execution routes.
  • Server (coordinator): publishes strategy templates, parameter bounds, market data aggregation, simulation/quotes, and creates unsigned instruction payloads. Never stores private keys and never holds funds.
  • Blockchain + DEX: on-chain settlement (AMM/CLOB), token accounts, transfers, and swaps/limit-orders.

Wallet flow diagram (master → sub-wallets → DEX)

(Browser only)                         (Chain + DEX)

 Master Funding Wallet (M)  ── fund caps + schedule ──►  Sub-wallets (W1..Wn)
        |                                                       |
        | distribute SOL/USDC + token (optional)                 |  execute MM cycle
        |                                                       v
        └──────────────►  Transfer instructions  ───────────►  DEX venue(s)
                                                           (AMM swap or CLOB orders)

Rules:
- Keys for M and W1..Wn are generated & stored locally (encrypted in browser storage).
- Server only returns: suggested params, quote data, unsigned instructions, and safety checks.
- Each sub-wallet has strict per-wallet caps and can be paused independently.

User-facing wallet requirements (non-custodial)

  • User selects number of sub-wallets (e.g. 3–50) to distribute activity and reduce single-wallet patterning.
  • Client-side-only wallet generation: create ed25519 keypairs in-browser; private keys never leave the device. (Optionally derive from a local BIP39 seed for deterministic recovery.)
  • Master funding wallet: user designates/creates a master wallet that distributes funds to sub-wallets with strict caps (per-wallet max SOL/USDC, per-day max top-up, and absolute max notional).

Market-making behavior (inventory-neutral)

  • Quote around mid: continuously estimate mid-price from venue best bid/ask (CLOB) or aggregated quotes (AMM), then place symmetric buy/sell quotes around mid.
  • Dynamic spread: widen spreads when volatility rises or liquidity is thin; tighten when stable and deep. Example rule-of-thumb: \(spread = base + k_1·vol + k_2·(1/liquidity)\).
  • Randomization: randomize order size + timing inside bounded ranges (with a minimum resting time) to avoid deterministic “bot signatures” while still respecting anti-wash constraints.
  • Inventory control: maintain a target inventory band and rebalance toward neutrality; never target long-term accumulation.
  • Hard limits: daily volume cap, max drawdown, max slippage, max price impact; stop trading when breached.

Risk controls (must-have)

  • Emergency kill switch: one-click stop that halts all new orders/swaps and optionally cancels open orders (CLOB) for all sub-wallets.
  • Per-wallet funding limits: cap initial funding, cap per-top-up, cap total notional exposure per wallet.
  • Max loss per session: track realized + mark-to-market P&L; pause when loss threshold is hit.
  • Slippage protection: refuse execution when quoted slippage/price impact exceeds user-defined max.
  • Venue allowlist: only trade on user-approved markets/pairs; reject unknown mints, frozen tokens, or risky programs.

MEV / sandwich protections (practical on Solana)

  • Prefer maker flow: use limit orders (CLOB) or LP-style quoting when possible, reducing swap-based exposure.
  • Private execution: optionally send transactions via private relays/bundles (e.g. Jito-style bundles) and/or trusted RPC to reduce public mempool visibility.
  • Strict quote freshness: enforce max quote age and simulate before send; reject stale routes.
  • Anti-sandwich sizing: avoid large single swaps; split into smaller clips within impact bounds.

Security considerations & threat model

  • Client compromise (malware, extension injection, XSS): mitigate with CSP, dependency hygiene, strict sanitization, and optional “session-only” key storage; warn users that device security is critical.
  • Server compromise (malicious coordinator): server must be unable to steal funds because it never sees keys. Still, protect users from malicious instructions by requiring client-side simulation and allowlisting programs.
  • Phishing / UX attacks: clearly label signing prompts; show human-readable instruction summaries; bind actions to explicit user-approved parameters (caps, venues, mints).
  • MEV / adversarial traders: mitigate with private routing, slippage bounds, randomization, and avoidance of predictable cadence.
  • Token-specific risks: freeze authorities, transfer taxes, blacklists; require on-chain checks before any trading.

Clear separation: client vs server vs chain

Client: key generation, encrypted local key storage, policy enforcement (caps/kill-switch), transaction building + signing, and audit logs.
Server: market data aggregation, parameter guardrails, quote + simulation helpers, rate limiting, and non-sensitive telemetry.
Blockchain/DEX: funds custody (user wallets), execution, settlement, and immutable on-chain history.
Note: this design intentionally avoids wash trading / fake volume. It’s suitable for legitimate liquidity support and risk-managed execution, not for “volume bots” or price manipulation.