Why a general language model should not control execution

A language model can help summarize research or explain an event, but an external model call adds variable latency and can return different wording for the same input. Those properties make it a poor place to enforce order limits or transaction validity. Keep the order path deterministic and use a model, if at all, for a narrow, measurable classification task with a defined fallback.

Keep these responsibilities separate

  • Timing: Measure the complete event-to-confirmation path; do not assume a model or provider has a fixed response time
  • Risk: Enforce position, exposure, and loss limits in ordinary code, not in a prompt or model response
  • Inputs: Validate market data and timestamps before scoring; a model cannot make stale or incomplete data current
  • Fallback: Define what happens when a feed, model, or RPC provider is unavailable

What is JEV AI?

In this architecture, JEV AI is the signal-scoring component between event collection and execution. Keep the model’s role narrow: it may rank or classify a validated event, while deterministic checks decide whether the resulting action is permitted. Measure the actual model and hosting latency in your deployment; do not assume a benchmark from another environment will carry over.

JEV terminal simulation

Illustrative output only. Sample market figures and decisions are not live trading data.

npm run agentic-trader
Simulation

Deterministic Rule Engine

Explicit, versioned rules check order size, aggregate exposure, token constraints, and loss limits. The model cannot change them. A rule can reduce some risks, but no guardrail makes a speculative trade safe.

Micro-Model Signal Classifier

A small classifier may score validated features such as liquidity changes or holder concentration. Test the score against a held-out dataset and compare it with a simple baseline before allowing it to influence a live decision.

Streaming Blockchain Interface

A streaming provider can deliver account and transaction updates with lower polling overhead. Coverage, delay, and availability depend on the provider and configuration; do not describe a feed as guaranteed pre-confirmation visibility.

Bot Architecture

A useful reference design separates four responsibilities. They can be separate services or modules in one application; splitting them only helps when the operational boundary justifies the added complexity:

System Components

Chain Watcher: Receives configured chain events and attaches source timestamps
JEV Signal Engine: Validates event fields and returns a score with a model version and explanation of the features used
Risk Gate: Deterministic layer that validates every buy signal against hard-coded portfolio rules before allowing execution
Execution Engine: Builds, simulates, and submits a transaction through the configured provider, then tracks its final status

Signal Pipeline (simplified):

// Chain Watcher emits a raw event
const event = {
  tokenMint: '<validated mint address>',
  liquidity: '<value with quote currency and timestamp>',
  holderDistribution: '<validated feature set>',
  observedAt: '<source timestamp>',
};

// JEV signal engine scores it
const verdict = await jevAI.classify(event);
// Example output only; a score is not proof that a trade is worthwhile.
// { action: 'REVIEW', modelVersion: 'example' }

// Risk gate validates before execution
if (riskGate.approve(verdict, portfolioState) && userHasConfirmed) {
  await executionEngine.submit(event.tokenMint, validatedOrder);
}

Deterministic Risk Management

Keep the model and the risk gate separate. The gate should receive a proposed order and the current portfolio state, validate the configured limits, and reject anything it cannot verify. A failed or missing check should stop the order rather than silently fall through.

Controls to configure and test

  • Order size: Set an explicit per-order and total exposure ceiling for the account
  • Loss handling: Define what pauses new orders and who can resume them
  • Token checks: Define concentration and contract checks, and document their blind spots
  • Liquidity: Require a quote in the expected currency and reject stale or missing data
  • Event age: Reject events outside a configured freshness window; this does not identify every scam
  • Pause condition: Stop new orders when configured drawdown or provider-health limits are reached

Entry Signal Design

Candidate features should be treated as hypotheses, not reliable predictors. Define how each feature is calculated, check that its data was available at the time, and test it on periods excluded from model development:

Liquidity Velocity

Measure changes in pool depth over a documented window. A sharp increase may be temporary or concentrated, so pair it with checks for who supplied liquidity and whether it can be removed.

Wallet Distribution Score

Examine concentration across known holders and related addresses. Address counts alone can be misleading because one owner may control many wallets.

Social Momentum Proxy

Transaction activity is not the same as genuine demand. Wash activity, bots, and coordinated wallets can create a misleading spike; use this feature only with explicit caveats and validation.

Execution Layer

Measure each step separately: event receipt, feature preparation, scoring, simulation, submission, and confirmation. A fast submission does not guarantee inclusion or a favorable fill. Retry logic must also avoid sending duplicate orders when the first response is delayed.

Transaction Submission Strategy:

const submissionConfig = {
  // Illustrative settings; tune and validate them for the deployed strategy.
  // A bundle or provider route does not guarantee MEV protection.
  jito: {
    enabled: true,
    tip: '<configured tip limit>',
    bundleSize: 1,        // Single tx bundle for speed
  },
  // Fallback: direct RPC if Jito landing fails
  rpcFallback: {
    enabled: true,
    computeUnitPrice: '<configured limit>',
    retries: '<bounded retry policy>',
  },
  // Confirmation policy must distinguish timeout from a failed transaction.
  confirmationTimeout: '<configured duration>',
};

How to measure performance

End-to-end latency

Report event receipt through confirmed status, with percentiles, date range, provider, and network conditions. Do not report model inference time as transaction latency.

Signal evaluation

Define the outcome and time horizon before evaluating a signal. Include failed and unfilled orders, fees, and adverse price movement; avoid cherry-picking successful examples.

Operational and risk metrics

Track rejected orders, stale data, failed confirmations, maximum drawdown, and the number of times a safeguard paused trading. Publish results only with a reproducible method.

No architecture guarantees an edge or bounds every loss. This separation makes the system easier to inspect and test: the model proposes, the risk gate checks, and the execution service reports what actually happened.

If you are building a similar system or want Flowtency to develop a custom meme coin trading infrastructure for your fund or protocol, get in touch with our team.