Simple AMM
Compile and evaluate submitted Solidity strategies against the fixed simple_amm evaluator runtime. Supports deterministic seed batch evaluation, contiguous seed chunks, bytecode-size validation, and reusable build artifacts.
Current public support: shared placement on CPU workers only. Submit via POST /api/v1/recipes/simple_amm/jobs or POST /api/v1/jobs with "recipe": "simple_amm".
Compiler Profile
The sealed runtime compiles Strategy.sol with Foundry stable and this fixed profile:
| Setting | Value |
|---|---|
solc_version | 0.8.33 |
optimizer | true |
optimizer_runs | 200 |
via_ir | true |
evm_version | prague |
max_deployed_size_bytes | 24576 |
Build, validate, and eval results include compiler_profile and compiler_profile_hash.
Operations
| Operation | Description |
|---|---|
build | Compile one Solidity strategy into deterministic build outputs keyed by normalized source bytes |
validate | Validate one strategy against the sealed simple_amm guardrails and bytecode-size rules |
eval | Run one full deterministic evaluation over the requested seed window |
eval_chunk | Run one deterministic chunk evaluation over a contiguous slice of the requested seed space |
Payload Fields
| Field | Type | Required | Description |
|---|---|---|---|
operation | string | yes | One of the operations above |
strategy_ref | string | alt | Artifact ID of the Solidity source bytes or an archive containing Strategy.sol |
sol_source_b64 | string | alt | Base64-encoded Solidity source (alternative to strategy_ref) |
seed_base | integer | no | Starting seed for simulation |
start | integer | no | Start offset for chunk operations |
count | integer | no | Number of seeds to run |
steps | integer | no | Simulation steps |
per_seed | boolean | no | Return per-seed edge data |
max_deployed_size_bytes | integer | no | Override deployed bytecode-size ceiling |
chunk_index | integer | chunk ops | Zero-based chunk index |
chunk_count | integer | chunk ops | Total number of chunks for the run |
total_count | integer | chunk ops | Total seed count the chunks cover |
Provide exactly one of strategy_ref or sol_source_b64.
For eval_chunk, pass either direct start + count or chunk_index + chunk_count + total_count. total_count may also be included as metadata with direct start + count. Top-level fan_out: {"chunks": N, "total": M} expands each task with start, count, chunk_index, chunk_count, and total_count.
Examples
Validate a strategy
POST /api/v1/recipes/simple_amm/jobs
{
"payload": {
"operation": "validate",
"strategy_ref": "art_123"
},
"timeout_s": 900
}Build compiled artifacts
POST /api/v1/recipes/simple_amm/jobs
{
"payload": {
"operation": "build",
"strategy_ref": "art_123"
},
"timeout_s": 600
}The build operation publishes compiled_strategy and build_manifest artifacts keyed by the normalized source bytes.
Full evaluation
POST /api/v1/recipes/simple_amm/jobs
{
"payload": {
"operation": "eval",
"strategy_ref": "art_123",
"seed_base": 0,
"count": 1000,
"steps": 200
},
"timeout_s": 1800
}Chunked evaluation
POST /api/v1/recipes/simple_amm/jobs
{
"payload": {
"operation": "eval_chunk",
"strategy_ref": "art_123",
"chunk_index": 0,
"chunk_count": 10,
"total_count": 10000
},
"timeout_s": 1800
}Fan-out chunked evaluation
POST /api/v1/recipes/simple_amm/jobs
{
"payload": {
"operation": "eval_chunk",
"strategy_ref": "art_123"
},
"fan_out": {
"chunks": 10,
"total": 10000
},
"timeout_s": 1800
}Result Fields
build:success,source_hash,cache_hit,source_job_id,build_artifact_id,compiler_profile,compiler_profile_hash,output_tailvalidate:success,source_hash,deployed_size,compiler_profile,compiler_profile_hash,output_taileval:success,source_hash,avg_edge,mean_delta,n_seeds,bid_fee,ask_fee,deployed_size,avg_gas_per_trade,compiler_profile,compiler_profile_hash,output_taileval_chunk:evalfields pluschunk_index,chunk_count,total_count,start,count