System Internals & Rendered Architecture
Visual teardown of the Meirei on-chain execution pipeline, convex rebalance optimizer, and OKX DEX routing on X Layer (chain 196).
Full End-to-End System Topology
Client Channels
- • Telegram Bot (@MeireiXLayerBot)
- • WhatsApp Cloud API
- • Trading Web Terminal
- • OKX Wallet Bridge
In-Memory Gateway
- • SHA-256 Identity Anchor
- • Token-Bucket Rate Limiter
- • Idempotency Nonce Guard
- • /freeze Circuit Breaker
Optimizer & 2FA
- • Natural-Language NLP
- • Convex Diff Engine
- • 6-Digit OTP / WebAuthn
- • Constant-Time Timing Check
OKX DEX Router
- • 8 Allowlisted xStocks
- • Multi-Pool Aggregation
- • Sponsored Paymaster Gas
- • Real-Time Tx Explorer Link
1. Autonomous Execution Pipeline
When an instruction is submitted, the Meirei state engine executes a synchronous four-stage pipeline:
Intent Parsing
Normalizes freeform natural language text into structured asset weights and single-stock trade legs.
On-Chain State Query
Queries live ERC-20 balances on X Layer via RPC node and fetches OKX DEX Aggregator depth.
2FA Challenge Gate
Intercepts execution. Requires verification of 6-digit challenge before granting signed authorization token.
Atomic DEX Broadcast
Executes swaps via OKX Aggregator router on X Layer, settling into USDG with protocol fee attribution.
2. Portfolio Optimization Formalism
Given a current portfolio vector W_c and a mandate target vector W_t, the rebalance optimizer minimizes the total number of swap transactions while observing maximum concentration constraints:
Any sleeve allocation exceeding max_single_weight automatically cascades into the liquid cash reserve asset (USDG).
3. Zero-Database In-Memory State & Cryptographic Enclaves
Meirei is engineered with a strict zero-database requirement. All user identity derivation, rate-limiting buckets, idempotency hashes, and 2FA challenge nonces reside in deterministic in-memory caches and client-side WebAuthn hardware enclaves.
- Deterministic User Profiles: User identities are derived from verified email and messaging channel identifiers using SHA-256 digests.
- Zero Server-Held Private Keys: Transactions are signed client-side via WebAuthn hardware passkeys or user-connected Web3 wallets.
- Live On-Chain State: Balances, allowances, and swap execution receipts are queried and verified directly against OKX X Layer Mainnet (Chain ID 196).
- In-Memory Idempotency: Webhook deliveries and trade requests maintain short-lived cryptographic hash sets to prevent duplicate operations.
4. Emergency Panic Circuit Breaker
If a client detects compromised communication credentials, they can broadcast the panic freeze directive (/freeze). This triggers an immediate in-memory freeze for that profile, revoking all active 2FA authorization tokens and rejecting any pending mandate execution until manual identity unfreeze is verified via the 6-digit recovery code (/unfreeze <code>).