Skip to content

Rename OrderBook to Raindex#2526

Merged
thedavidmeister merged 73 commits into
mainfrom
rename-orderbook-to-raindex
May 20, 2026
Merged

Rename OrderBook to Raindex#2526
thedavidmeister merged 73 commits into
mainfrom
rename-orderbook-to-raindex

Conversation

@thedavidmeister
Copy link
Copy Markdown
Contributor

@thedavidmeister thedavidmeister commented Mar 27, 2026

Summary

Comprehensive rename of "OrderBook" / "orderbook" to "Raindex" / "raindex" across the entire codebase and dependent repositories.

What changed

  • ~10,000+ string references renamed across all crates, packages, subgraph, Solidity, CI, docs
  • Struct fields, variable names, function names, type names, error variants
  • ob_id struct field → raindex_id (~300 usages)
  • All ob abbreviation variable names → descriptive raindex* names
  • Directory renames: src/concrete/ob/src/concrete/raindex/, test/concrete/ob/test/concrete/raindex/
  • packages/orderbookpackages/raindex (directory rename)
  • SvelteKit route params: [orderbook][raindex]
  • Nix commands: ob-rs-testraindex-rs-test, ob-ui-components-preluderaindex-ui-components-prelude, rainix-ob-cli-artifactraindex-cli-artifact
  • Subgraph schema: Orderbook entity → Raindex, all orderbook fields → raindex
  • Goldsky subgraph name: ob4raindex
  • Rainlang sub-parser word: "orderbook""raindex" (breaking for existing expressions)
  • Sub-parser pointers regenerated (new bytecode hash and deployment address)
  • Gas snapshot regenerated
  • Audit markdown files deleted (all findings triaged, remaining items in GitHub issues Test: spender != pool path in GenericPool _exchange #2533-Add zero-address guards for decoded spender/pool in LibGenericPoolExchange #2539)

Companion PRs (merged)

Breaking changes

Surface Change Impact
YAML config Version bumped to 6. orderbooks:raindexes:, orderbook:raindex: All .rain frontmatter and standalone YAML configs must be updated
DB schema orderbook_address columns → raindex_address across all tables (including PRIMARY KEYs). DB_SCHEMA_VERSION bumped 2→3 Existing local databases are incompatible — requires fresh sync
Remote DB dumps Column names changed in dump SQL Remote dumps must be rebuilt before local clients can bootstrap
Subgraph schema Orderbook entity → Raindex, all orderbook fields → raindex on every entity (Vault, Order, Trade, Deposit, Withdrawal, etc.) Subgraphs need redeployment. All existing queries using old field names break
Goldsky deployment ob4raindex New subgraph instances deployed. Old ob4-* endpoints stop updating
REST API "orderbook" field → "raindex" in TakeOrdersReadyResponse. Doc strings updated ("the raindex contract") API consumers parsing that field break
npm package @rainlanguage/orderbook@rainlanguage/raindex All importers must update package.json and imports. Not an in-place upgrade — new package name
WASM/JS API classes OrderbookYamlRaindexYaml, OrderbookYamlErrorRaindexYamlError, getOrderbookByAddress()getRaindexByAddress() All JS/TS consumers of the WASM API must update class and method names
WASM getters .orderbook().raindex() on RaindexOrder, RaindexVault, TakeOrdersInfo; .orderbookAddress.raindexAddress on DeploymentTransactionArgs All code accessing these properties must update
JSON serialization "obId""raindexId" on sync status; "orderbookAddress""raindexAddress" on vault/order objects; "orderbook""raindex" on trade/order objects All consumers of serialized JSON (frontend, tools, API clients) must update field names
Rainlang word Sub-parser word "orderbook""raindex". Sub-parser bytecode and deterministic deploy address changed Existing compiled expressions unaffected. Source .rain files using orderbook() must update. New sub-parser must be deployed
Webapp URLs /orders/[chainId]-[orderbook]-[orderHash][raindex], same for vaults Bookmarked URLs break
CLI ob-addr alias → raindex-addr Scripts using old alias break
Nix commands ob-rs-test, ob-ui-components-prelude, rainix-ob-cli-artifact renamed CI/scripts referencing old names break
UI labels "Orderbook" → "Raindex" in webapp Visual change for users

Intentionally preserved

  • Deprecated IOrderBookV1-V5 Solidity interfaces in lib/rain.raindex.interface/src/interface/deprecated/ — historical ABIs for backwards compatibility
  • 1 historical comment in crates/settings/src/local_db_manifest.rs documenting the DB column rename
  • raindexs in GraphQL codegen — The Graph framework naively appends s to entity names

Migration checklist

  • Rebuild remote DB dumps with new schema (raindex_address columns)

  • Deploy new sub-parser contract (bytecode changed)

  • Deploy new Goldsky subgraphs (raindex-*)

  • Update subgraph URLs in all strategy YAML configs

  • Update rain.strategies registry to version 6 with raindexes: keys

  • Update RAINLANG_URL in packages/webapp/src/lib/constants.ts to new strategies commit

  • Update external .rain strategy files: orderbooks:raindexes:, orderbook:raindex:, version: 6

  • Update external .rain source using orderbook() word → raindex()

  • Update any API consumers parsing old JSON field names

  • Update any JS/TS code using OrderbookYamlRaindexYaml, .orderbook().raindex(), etc.

  • Publish new @rainlanguage/raindex npm package

  • Coordinate npm publish — consumers must explicitly switch from @rainlanguage/orderbook to @rainlanguage/raindex

  • Merge Rename ob-yaml.md to raindex-yaml.md specs#52 (rename ob-yaml.md → raindex-yaml.md)

  • Verify Vercel project configs point to packages/raindex (not packages/orderbook)

  • Users clear local DB cache (fresh sync required)

  • Manual end-to-end verification by @Siddharth2207 before merging

  • Manual end-to-end verification by @hardyjosh before merging

  • Manual end-to-end verification by @findolor before merging

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Rebranded project from "Rain Orderbook" to "Raindex," updating package names (@rainlanguage/raindex), Rust crate identifiers, CI/CD workflows, configuration files, and build processes throughout the repository.
  • Documentation

    • Updated developer guides, architecture documentation, setup instructions, and implementation guidelines to reflect the project rebranding.

Summary by CodeRabbit

  • Chores
    • Rebranded project naming from "Rain Orderbook" to "Raindex" across packages, crates, and documentation.
    • Updated npm package names, build commands, and workspace dependencies.
    • Updated CI/CD workflows, GitHub Actions, and development configurations.
    • Updated gas snapshots and test references for new contract naming.

Review Change Stack

thedavidmeister and others added 8 commits March 25, 2026 23:33
Rename all Solidity source contracts, libraries, and scripts from
OrderBook naming to Raindex naming. File renames and content updates
for src/abstract/, src/concrete/, src/lib/, src/generated/, and
script/.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Content and file renames for all test utility, abstract, concrete,
and lib test files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update root Cargo.toml, crate Cargo.toml files, and all Rust source
files. Rename crate names from rain_orderbook_* to raindex_*. Update
settings crate types (OrderbookCfg -> RaindexCfg, etc.), YAML keys,
module declarations, and file names.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename YAML config keys (orderbooks -> raindexes) and bump spec
version from 5 to 6. Fix remaining Orderbook type references in
js_api yaml module and settings crate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update import paths, YAML key strings, and constant prefixes that
were missed in the initial Rust rename pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update foundry.toml, flake.nix, .gitignore, .devcontainer.json,
package.json, README.md, AGENTS.md, copilot instructions, and
GitHub workflow files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename directory, update package.json names and URLs, update build
scripts (wasm crate name, wbg json), ARCHITECTURE.md, README.md,
test files, and ui-components dependency reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename Svelte components (DropdownOrderbooksFilter ->
DropdownRaindexesFilter, ListViewOrderbookFilters ->
ListViewRaindexFilters), update imports, types, and variable names.
Update ui-components and raindex package dependencies and URLs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 27, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR performs a comprehensive, repository-wide rename from "Rain Orderbook" to "Raindex" across Rust crates, npm packages, Solidity bindings, CI/CD workflows, configuration, and documentation. Workspace dependencies, crate names, package references, generated bindings, CLI implementations, and all related workflows and documentation are systematically updated to use the new raindex namespace.

Changes

Orderbook → Raindex Repository-wide Rebranding

Layer / File(s) Summary
Workspace configuration and Cargo dependencies
Cargo.toml
Workspace exclude list reformatted and all [workspace.dependencies.*] entries renamed from rain_orderbook_* to raindex_* (bindings, common, cli, subgraph_client, app_settings, quote, test_fixtures, math, js_api, rest_api) while preserving path references.
Solidity bindings crate rename
crates/bindings/Cargo.toml, crates/bindings/src/lib.rs, crates/bindings/ARCHITECTURE.md
Package name and description changed from rain_orderbook_bindings to raindex_bindings; generated Solidity module switched from OrderBook (OrderBookV6.json) to Raindex (RaindexV6.json); exported event constant renamed ORDERBOOK_EVENT_TOPICSRAINDEX_EVENT_TOPICS; architecture documentation updated with IRaindexV5/Raindex binding examples.
CLI crate rename and workspace dependencies
crates/cli/Cargo.toml
Crate name and description updated from rain_orderbook_cli to raindex_cli; all workspace dependency references switched from rain_orderbook_* to raindex_*.
Chart command implementation rewiring
crates/cli/src/commands/chart.rs
Imports updated to raindex_* crates; generated dotrain templates renamed from orderbooks/orderbook to raindexes/raindex with subgraph paths changed to raindex-flare; test setup and all test cases updated to use LocalEvm.raindex and raindex_subparser fields.
Local DB pipeline modules
crates/cli/src/commands/local_db/, including bootstrap.rs, executor.rs, cli.rs, pipeline/runner/environment.rs, pipeline/runner/export.rs, README.md
All imports switched from rain_orderbook_common::local_db to raindex_common::local_db; identifier types renamed OrderbookIdentifierRaindexIdentifier; struct field names changed ob_idraindex_id, orderbook_keyraindex_key, orderbook_addressraindex_address; CLI report rendering, error messages, and test fixtures updated to match raindex terminology.
npm-package-release workflow
.github/workflows/npm-package-release.yml
Workflow retargeted from @rainlanguage/orderbook to @rainlanguage/raindex: repository consistency checks now validate ./packages/raindex/package.json; npm blacklist runs against packages/raindex; package hash detection, versioning, dependency updates, tarball creation, publishing, and git commit/tag/release naming all updated to raindex namespace.
CI/CD workflows updated for raindex paths
.github/workflows/rainix.yaml, test-ui-components.yaml, test-webapp.yaml, vercel-*.yaml, deploy-subgraph.yaml, manual-sol-artifacts.yaml
All workflows updated to target packages/raindex instead of packages/orderbook; Nix task names changed from ob-rs-test to raindex-rs-test; subgraph deployment environment variable updated from ob4 to raindex; secrets/deployment configuration simplified.
Documentation and configuration files
README.md, .gitignore, .devcontainer.json, AGENTS.md, Cargo.toml (metadata), .github/copilot-instructions.md, ai_commands/*, crates/bindings/ARCHITECTURE.md
Core branding updated throughout: README project title/terminology and DEPLOYMENT_SUITE mappings, build artifacts in .gitignore redirected to raindex paths, dev container name updated, agent instructions updated with raindex package/build commands, AI task docs retargeted to packages/raindex, and bindings architecture documentation updated with raindex type names.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • This PR directly implements the code/artifact renames that support repository rebranding and deployment tracking, addressing the systematic rename objectives for the Raindex project.

Suggested reviewers

  • 0xgleb

Poem

🐰 From OrderBook to Raindex we hop,
The rename train just won't stop!
Packages dance, workflows aligned,
A cleaner brand, organized and refined—
Raindex reigns, config takes flight! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and directly summarizes the primary change: a comprehensive rename of OrderBook to Raindex across the entire repository.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rename-orderbook-to-raindex

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

thedavidmeister and others added 21 commits March 30, 2026 17:48
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add vm.assume guard to LibOrder.testHashNotEqual (A10-1)
- Fix stale NatSpec referencing onlyValidTask in RaindexV6FlashBorrower (CR-3)
- Mark already-fixed items (CR-2, A14-3) in triage
- Create GitHub issues for 17 remaining findings (#2533-#2539)
- Zero PENDING items remain in triage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All findings triaged — remaining items tracked in GitHub issues
(#2533-#2539) with claude-audit label.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… crates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
RaindexV6 confirmed at 23,437 bytes — identical to pre-rename.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The rainlang word "orderbook" is now "raindex" — this is a breaking
change for existing rainlang expressions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix "raindexs" → "raindexes" spelling in test descriptions
- Rename OB_NPM_PACKAGE → RAINDEX_NPM_PACKAGE in CI
- Rename ob-addr CLI alias → raindex-addr
- Update ob-yaml.md URLs → raindex-yaml.md
- Fix "order book" → "raindex" in NatSpec comments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ob-rs-test → raindex-rs-test
- ob-ui-components-prelude → raindex-ui-components-prelude
- rainix-ob-cli-artifact → raindex-cli-artifact

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…call

Three CI compile failures from the previous merge:
- crates/common/.../status/wasm.rs: test fns and ClientStatusBus call sites
  still referenced ob_id; renamed to raindex_id alongside the existing
  with_raindex_id constructor
- crates/common/.../trades/mod.rs:271: get_trade_detail was calling
  get_raindex_client (returns ClientRef, no Result) when it needs the
  subgraph client; switched to get_raindex_subgraph_client
- flake.nix test-js-bindings: dropped npm run format-check (script was
  removed earlier in the no-consumer-prettier migration)
gildlab and others added 4 commits May 19, 2026 11:01
…aindex

Resolves 37 conflicts:
- UD deletes: dropped vercel-preview-pr-target.yaml (removed in #2573) and
  the leftover js_api/gui/{deposits,select_tokens}.rs (logic moved to
  common/raindex_order_builder/ via #2479).
- UU code conflicts: kept the orderbook->raindex rename across crates,
  packages, and Solidity while taking in main's new functionality
  (multi-subgraph trades_list/trades_count, GUI->OrderBuilder rename,
  BaseRainterpreterSubParser->BaseRainlangSubParser, ContextProfile::Gui
  ->ContextProfile::Builder, get_orderbook_yaml->get_raindex_yaml,
  Orderbook::multicallCall->Raindex::multicallCall).
- Lockfiles: Cargo.lock regenerated via cargo generate-lockfile;
  package-lock.json via npm install --package-lock-only.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Previous merge regenerated Cargo.lock and package-lock.json from scratch,
which drifted significantly from main (newer alloy stack, mixed solar-*
versions, and an out-of-sync npm tree that failed npm ci on CI).

Reset both lockfiles to main's, then reapplied the workspace renames:
- Cargo.lock: rain_orderbook_* -> raindex_* (and rain-orderbook-api ->
  raindex-api) for the renamed workspace crates.
- package-lock.json: packages/orderbook -> packages/raindex and the
  @rainlanguage/orderbook -> @rainlanguage/raindex package id.
Apply the rename pattern to new code from main PRs #2570-#2572
(getTrades filters) and resolve eight unresolved conflict markers in
packages/raindex/test/js_api/builder.test.ts.
gildlab added 2 commits May 19, 2026 19:36
…t/order_trade.rs

Commit cd18389 wiped this file from 990 lines to 0 (impl block deleted),
which broke crates/subgraph/src/raindex_client/performance.rs:12 since it
calls order_trades_list_all on RaindexSubgraphClient. Restore the file as
it was at cd18389^ and re-apply OrderbookSubgraphClientError -> Raindex
rename.
@thedavidmeister
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

… tests

Three rust unit tests in crates/common/src/raindex_order_builder/state_management.rs
were stale relative to YAML rename + spec version bump:

- SERIALIZED_STATE constant (line 402): the base64 blob encodes the YAML
  fixtures in raindex_order_builder/mod.rs which got rename-edited
  (orderbooks: -> raindexes:, etc.). Updated to the new value produced
  by serialize_state() with the current fixtures.

- test_new_from_state_invalid_dotrain: inline dotrain had version: 5,
  which now fails at the spec-version check ("expected 6, found 5")
  before the test could reach the dotrain-mismatch assertion. Bumped
  to version: 6 so parsing proceeds; the dotrain is still distinct from
  get_yaml() so DotrainMismatch still fires as expected.
Same root cause as the rust state_management fix: the SERIALIZED_STATE
encodes YAML fixtures that got rename-edited (orderbooks: -> raindexes:),
so the produced base64 blob no longer matches the constant. Updated to
the actual value produced by builder.serializeState() with current
fixtures.
Root package.json had prettier deps removed in an earlier branch commit
but npm install wasnt re-run, leaving the entries in package-lock.json.
Re-run picked up the change.
@thedavidmeister
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

✅ Actions performed

Full review triggered.

@thedavidmeister thedavidmeister merged commit 40cd096 into main May 20, 2026
17 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Tip

For best results, initiate chat on the files or code changes.

SIZE=L

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants