Skip to content
All tools
Tool

Plan a shred-to-land latency budget

Add detection, decode, decision, signing, submission, and landing ranges, then calculate slack against an opportunity deadline.

StageBestTypicalBad dayShare of typical

Network to your box

Distance from Frankfurt. The part you buy.

Kernel and socket

Worse under load, and worse again with a small buffer.

Deshred and decode

Usually the largest line, and usually yours to fix.

Your decision

Strategy, risk checks, whatever you do with it.

Submit

Back out to a leader or an RPC.

Typical path

5.95 ms

best 2.05 ms, bad day 28.50 ms

9.05 ms of slack typically, but you miss the deadline on a bad day.

Biggest line: Deshred and decode, at 3.0 ms. Spend your effort there. Shaving a millisecond off the largest stage is worth more than eliminating the smallest one entirely, and switching feed providers to save a fraction of a millisecond will not rescue a budget that a slow decoder is blowing.

The bad day column is a bound, not a forecast. Adding the worst case of every stage assumes they all have their bad day at the same moment, which is pessimistic. It is the right kind of pessimistic for planning and the wrong kind for a promise, so do not quote it as an expected latency. If you want a real distribution, join the same event across stages in your own telemetry rather than adding quantiles.

6 rows expose the whole path

The latency-budget planner gives detection, decode, decision, signing, submission, and land their own rows. Each row accepts low, typical, high, start boundary, end boundary, sample window, and evidence source.

The output shows local processing, end-to-end time, slack against an opportunity deadline, and the stage contributing most variance. It prevents a sub-millisecond decode claim from standing in for transaction execution.

Method

For planning ranges, let L_i, M_i, and H_i be the low, typical, and high estimate for stage i.

text

low_total = sum(L_i)
typical_total = sum(M_i)
high_total = sum(H_i)

typical_slack = opportunity_deadline - typical_total
high_slack = opportunity_deadline - high_total

Positive slack means the modeled path completes before the deadline. Negative slack shows the amount by which it misses. The component calculates local total through submission separately from total including land.

Adding p95 values does not produce a statistically valid end-to-end p95 unless dependence and distributions meet strong conditions. The simple sum is labeled a conservative planning view. When raw samples exist, join stage timestamps for the same event and calculate the end-to-end distribution directly.

If only separate empirical distributions exist, Monte Carlo can draw one value from each and sum them. Independent draws are a model assumption. Shared load can correlate decode, decision, and submission tails, so the tool accepts paired samples or a correlation warning.

Define every boundary

Detection might begin at kernel packet arrival and end when a candidate program match exists. Decode might end when all transaction fields required by the strategy are available. Decision ends with an immutable action or rejection. Signing begins after that action and ends with signed bytes.

Submission can end at local socket send, relay acknowledgement, leader acknowledgement, or another named point. Those are not interchangeable. Land ends when the transaction is observed at processed, confirmed, or finalized commitment under the user's definition.

The page rejects unnamed latency rows. A number without start and end boundaries cannot be reproduced.

Worked arbitrage example

Assume a desk enters these typical values:

text

detection = 0.6 ms
decode = 1.2 ms
decision = 0.8 ms
signing = 0.15 ms
submission = 5.0 ms
land = 180.0 ms
opportunity deadline = 250.0 ms

Local time through submission is:

text

0.6 + 1.2 + 0.8 + 0.15 + 5.0 = 7.75 ms

Total through land is:

text

7.75 + 180.0 = 187.75 ms

Typical slack is:

text

250.0 - 187.75 = 62.25 ms

The same plan uses high values of 1.0, 2.0, 1.5, 0.3, 12, and 450 milliseconds. High total is 466.8 milliseconds. High slack is negative 216.8 milliseconds. The strategy fits at the typical modeled path and misses badly in the high path.

That result points to landing variance, not decode. Cutting decode from 1.2 to 0.6 milliseconds adds 0.6 milliseconds of slack. Cutting typical land from 180 to 120 adds 60 milliseconds. The table makes optimization priority visible.

Opportunity deadline needs evidence

An opportunity lifetime can be measured from signal-ready time until expected value crosses zero, a price limit fails, or a competing state change lands. It is not always one slot. Different sizes and routes can have different deadlines.

Record the outcome after each submitted event. Group opportunity decay by strategy, market, leader, fee, time of day, and contention where sample size permits. A fixed 250-millisecond deadline can be a useful first model and a poor production model.

No public Solana mempool supplies a universal pending-to-inclusion timer. A shred observation is already in a proposed block. Reaction time begins at that observation, while the response normally competes for a later position.

Separate controllable and external stages

Detection, decode, decision, and often signing are mostly controlled by the user's host. Submission crosses a service or network boundary. Landing depends on leader scheduling, policy, account locks, priority fees, compute, validity, competition, and forks.

Coloring stages by owner prevents the wrong optimization. A team can tune receive queues while also recognizing that a distant submit path dominates. It can choose a slower signer for security and see the exact slack cost.

The Frankfurt feed origin affects arrival geography. It says nothing about the next leader or outbound submission path. Measure both directions rather than treating region as a constant latency deduction.

Import measured events

CSV import accepts event ID and timestamps for packet arrival, candidate detection, decode complete, decision complete, signing complete, send, acknowledgement, landed observation, and commitment. The component checks monotonic order and reports missing stages.

Event IDs matter because sums across unrelated medians can describe no real event. Joined samples show whether packet bursts create decision and submission tails together. Report p50, p95, p99, maximum, sample count, and capture dates.

Use monotonic clocks inside a process or host. Cross-host stages require synchronized clocks and an uncertainty estimate. Negative stage times usually reveal clock or join errors and remain visible rather than being clamped to zero.

Failure paths consume a budget too

Add deadlines for missing-shred recovery, remote signer timeout, submission retry, blockhash refresh, and reconciliation. A retry can improve land probability while extending age or duplicating exposure if identity rules are wrong.

Rejections should have latency histograms. A risk check that times out after 100 milliseconds can block safer candidates behind it. Fail closed within a bounded interval and keep unrelated markets independent.

Expected value can combine land probability and outcome, but the planner does not turn milliseconds into profit without user inputs. A faster path with higher failure cost can be worse.

Limitations

Planning ranges are not guarantees. Low and high values depend on hardware, geography, program mix, packet loss, recovery, signer policy, leader path, and network state. The example is illustrative.

Summing percentiles can overstate or understate the true end-to-end percentile. Joined production samples are preferred. Monte Carlo output inherits its distribution and correlation assumptions.

Seeing a shred first does not guarantee landing first. The tool quantifies that distinction but cannot predict leader admission, competing private routes, forks, or strategy profit.

The planner does not send transactions or benchmark the user's host. Its output is an explicit hypothesis. Instrument the actual boundaries and replace every estimate with a dated measurement.

How it works out the answer

For stages i with low, typical, and high milliseconds, compute path totals by summing like quantiles only as a planning bound, then compute slack = opportunity_deadline − total. For measured samples, estimate total latency by joining the same event across stages or by Monte Carlo sampling from empirical stage distributions with preserved correlation where available.

Questions

Why does the planner keep landing separate from submission?
Submission ends at a named outbound milestone, such as relay acknowledgement. Landing requires leader inclusion and execution. Leader timing, fees, account conflicts, compute, validity, competition, and forks create a wider distribution. Combining the stages would let a fast local number conceal the main execution uncertainty.
Can I add six p95 stage values to get end-to-end p95?
Not as a statistically exact result. Stage tails can be correlated, and the sum of separate p95 values is not generally the p95 of their sum. Use event-level joined timestamps when possible. The component labels summed quantiles as planning bounds and supports empirical end-to-end samples.
What does negative latency slack mean?
Negative slack means the modeled path finishes after the entered opportunity deadline by that amount. It does not prove every trade fails. It shows that the stated assumptions do not fit the target at that planning point and identifies which stage or variance contributes most.