This is an optional extension for researchers. It keeps the devnet, captured block, parent state, and order flow fixed while replacing or adding one rbuilder algorithm.
Start from configs/rbuilder/custom-algo.example.toml.tmpl. It demonstrates another ordering-builder configuration and the upstream parallel builder. Select it for both live and replay configs in .env:
RBUILDER_CONFIG_TEMPLATE=custom-algo.example.toml.tmpl
RBUILDER_BACKTEST_TEMPLATE=custom-algo.example.toml.tmpl
RBUILDER_LIVE_BUILDERS='["mgp-ordering","mp-ordering","mgp-deadline","parallel"]'Then recreate rbuilder and replay a candidate:
docker compose up -d --force-recreate rbuilder
make candidates
make backtest BLOCK=81 \
BUILDERS="mgp-ordering mp-ordering parallel default mgp-deadline"Replace 81 with a height printed by make candidates.
- Fork
hackingdecentralized/rbuilderand create a branch from the artifact's pinned Boost+ commit:
git clone https://github.com/<YOUR-ACCOUNT>/rbuilder.git
cd rbuilder
git switch -c my-algorithm db8e5b57f7d3d086131eb9f48502fde85763fae6-
Implement
BlockBuildingAlgorithm, add a variant toSpecificBuilderConfig, and wire that variant into the live builder and/or backtest dispatch. Commit and push the result. -
Copy
configs/rbuilder/custom-algo.example.toml.tmplto a new file in the same directory. Add a[[builders]]entry formy-algo, and add its name to the top-levelbacktest_builderslist. Add it toRBUILDER_LIVE_BUILDERSonly if the fork implements the live dispatch too. -
Point this artifact at the exact pushed revision in
.env:
RBUILDER_REPO=https://github.com/<YOUR-ACCOUNT>/rbuilder.git
RBUILDER_COMMIT=<FULL_40_CHARACTER_COMMIT>
RBUILDER_CONFIG_TEMPLATE=my-algo.toml.tmpl
RBUILDER_BACKTEST_TEMPLATE=my-algo.toml.tmpl- Build and verify the image metadata before running it:
make rebuild
docker image inspect "$(docker compose images -q rbuilder)" \
--format 'source={{index .Config.Labels "org.opencontainers.image.source"}} revision={{index .Config.Labels "org.opencontainers.image.revision"}}'
make up
make smoke-test- Compare the new algorithm on exactly the same replay input:
make candidates
make backtest BLOCK=81 \
BUILDERS="mgp-ordering mp-ordering parallel default my-algo"Replace 81 with a height printed by make candidates.
The command must print one result for every requested builder. Compare block profit, used orders, gas, failures, and execution time; the winner is allowed to vary by block.