Skip to content

Conversation

@hardyjosh
Copy link
Contributor

@hardyjosh hardyjosh commented Nov 6, 2025

Motivation

Solution

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • New Features

    • Added three new trading strategies: Claims, Fixed-Spread, and Folio Rebalancer
    • Expanded network support to include Base, Polygon, and Flare alongside existing networks
    • Integrated Pyth-based price feeds for enhanced pricing across strategies
  • Improvements

    • Updated system to version 4 with improved infrastructure
    • Added local database caching capability for better performance

@coderabbitai
Copy link

coderabbitai bot commented Nov 6, 2025

Walkthrough

This pull request updates the strategy registry to reference a newer commit (8fdd42b) for five existing entries (fixed-limit, auction-dca, grid, dynamic-spread, canary), adds three new registry entries (claims, fixed-spread, folio), and bumps configuration schema version from 3 to 4 across multiple strategy files. New configurations activate networks (flare, base, polygon) and introduce local-db-remotes for raindex with corresponding orderbook and deployer address updates. Three new strategy files are added: claims (merkle-based verification), fixed-spread (Pyth price-based trading), and folio (portfolio rebalancing).

Changes

Cohort / File(s) Summary
Registry Updates
registry
Updated five existing strategy entries (fixed-limit, auction-dca, grid, dynamic-spread, canary) to point to commit 8fdd42b; added three new entries (claims, fixed-spread, folio) with the same commit URL.
Configuration Schema
settings.yaml
Bumped version from 3 to 4; activated networks (flare, base, polygon); added local-db-remotes with raindex configuration; updated subgraphs, orderbooks, and deployers entries across all active networks.
Version 4 Updates (Core Strategies)
src/fixed-limit.rain, src/grid.rain, src/canary.rain
Bumped version from 3 to 4; introduced top-level local-db-remotes with raindex; added local-db-remote references to orderbooks and metaboards; updated orderbook addresses and deployment-blocks for multiple networks.
Version 4 Updates (Complex)
src/auction-dca.rain, src/dynamic-spread.rain
Bumped version from 3 to 4; added local-db-remotes, raindex-subparser updates; new public orders for base-pyth, base-pyth-inv, polygon; updated scenario bindings; revised calculation logic (trade-epochs, variable-component) and IO constraints; replaced max-value with uint256-max-value in several paths.
New Strategy: Claims
src/claims.rain
New configuration file implementing merkle-based claim verification with get-leaf-node, check-claim, verify-proof, calculate-io, handle-io, and handle-add-order functions; defines networks, orderbooks, deployers, scenarios, and GUI metadata.
New Strategy: Fixed-Spread
src/fixed-spread.rain
New configuration file defining a fixed-spread trading strategy on Base network using Pyth price feeds; includes pyth-price-baseline calculations, orderbook/deployer definitions, scenario wiring, and GUI bindings with token presets.
Documentation
src/fixed-spread.md, src/folio.md
Added markdown documentation describing fixed-spread strategy (trading at premium/discount to benchmark price) and folio rebalancer (maintaining equal-weight portfolio distribution).
New Strategy: Folio
src/folio.rain
New configuration file for portfolio rebalancing with base network, orderbook, deployer, and scenario definitions; includes IO calculation logic and GUI metadata with threshold and fee parameters.

Sequence Diagram(s)

sequenceDiagram
    participant Order as Order Request
    participant LeafCalc as get-leaf-node
    participant ClaimCheck as check-claim
    participant ProofVerify as verify-proof
    participant CalcIO as calculate-io
    participant HandleIO as handle-io
    
    Order->>CalcIO: start calculation
    CalcIO->>LeafCalc: compute leaf hash<br/>(from leaf-index, counterparty,<br/>expected claim amount)
    LeafCalc-->>CalcIO: leaf-node
    CalcIO->>ClaimCheck: verify claim<br/>(check claimed-key == 0)
    alt Claim Valid
        ClaimCheck-->>CalcIO: "Claimed"
    else Claim Invalid
        ClaimCheck-->>CalcIO: fail
    end
    CalcIO->>ProofVerify: validate merkle proof<br/>(against root and leaf-node,<br/>8 proof components)
    alt Proof Valid
        ProofVerify-->>CalcIO: "Proof"
    else Proof Invalid
        ProofVerify-->>CalcIO: fail
    end
    CalcIO-->>Order: output<br/>(expected-amount, 0)
    Order->>HandleIO: process output
    HandleIO->>HandleIO: decrease output vault<br/>by expected-amount
    HandleIO->>HandleIO: mark leaf-node<br/>as claimed
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Registry and configuration updates are straightforward but repetitive across multiple files.
  • New strategy files (claims.rain, fixed-spread.rain, folio.rain) require careful review of new configuration, bindings, and computation logic.
  • Logic changes in auction-dca.rain and dynamic-spread.rain (trade-epoch calculations, saturating-sub to max-based logic, max-value to uint256-max-value replacements) require verification for correctness.
  • Merkle verification implementation in claims.rain requires careful inspection of the cryptographic flow and IO handling.

Areas requiring extra attention:

  • Trade-epoch and variable-component calculation changes in auction-dca.rain and dynamic-spread.rain for correctness of the new max-based approach
  • New orderbook addresses and deployment-blocks across multiple networks (flare, base, polygon, arbitrum) for accuracy
  • Merkle proof verification logic and claim state management in claims.rain (get-leaf-node, check-claim, verify-proof functions)
  • Pyth price feed bindings and baseline calculations in fixed-spread.rain and auction-dca.rain for correct price derivation

Possibly related PRs

  • Update Base Network Public Rpc #24: Updates the same registry entries (fixed-limit, auction-dca, grid, dynamic-spread, canary) to reference different commit hashes, directly related to this PR's registry changes.
  • Update registry hash #27: Modifies both registry and strategy file configurations with version/commit updates, overlapping changes.
  • Update settings yaml #38: Updates settings.yaml network, orderbook, and deployer configurations, directly related to configuration schema changes in this PR.

Suggested reviewers

  • findolor
  • 0xgleb

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Local db remote settings' accurately summarizes the main change: introducing local-db-remotes configuration across multiple strategy files and settings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch local-db-remote-settings

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/fixed-limit.rain (1)

98-112: Fix address inconsistencies in fixed-limit.rain and update dynamic-spread.rain.

Several deployer address issues were identified:

  1. Arbitrum address mismatch: fixed-limit.rain uses 0x5e9e22154d71f9fd4b5fd1ee36852a4c9fcdcc9e but settings.yaml specifies 0xb1869a4FA6436832bb0AD5420170B8CF17CaF934. These should match.

  2. Flare address new deployment: The flare address 0x8EE45EA9d6b7eb4026269D8c2BbdB20bEB38428d is not in git history and differs from the previous 0xE3989Ea7486c0F418C764e6c511e86f6E8830FAb. Verify this is the correct newly deployed contract.

  3. Incomplete flare update: src/dynamic-spread.rain still uses the old flare address (0xE3989Ea7486c0F418C764e6c511e86f6E8830FAb) and must be updated to match fixed-limit.rain.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7647f4f and cf96aab.

📒 Files selected for processing (12)
  • registry (1 hunks)
  • settings.yaml (4 hunks)
  • src/auction-dca.rain (14 hunks)
  • src/canary.rain (2 hunks)
  • src/claims.rain (1 hunks)
  • src/dynamic-spread.rain (8 hunks)
  • src/fixed-limit.rain (5 hunks)
  • src/fixed-spread.md (1 hunks)
  • src/fixed-spread.rain (1 hunks)
  • src/folio.md (1 hunks)
  • src/folio.rain (1 hunks)
  • src/grid.rain (2 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: 0xgleb
Repo: rainlanguage/rain.strategies PR: 45
File: registry:0-0
Timestamp: 2025-07-26T15:31:37.916Z
Learning: In the rain.strategies repository, the registry file uses full commit SHAs to pin strategy URLs as the current established pattern, rather than using tags or branches, as confirmed by project maintainer 0xgleb.
Learnt from: findolor
Repo: rainlanguage/rain.strategies PR: 59
File: src/fixed-limit.rain:68-68
Timestamp: 2025-09-01T12:19:42.343Z
Learning: In the rain.strategies repository, the team plans to replace contract addresses in the configuration files, and deployment-block values will be updated as part of that broader effort, so placeholder values like 1 are intentionally temporary.
📚 Learning: 2025-06-19T03:59:46.063Z
Learnt from: Siddharth2207
Repo: rainlanguage/rain.strategies PR: 42
File: src/fixed-limit.rain:19-23
Timestamp: 2025-06-19T03:59:46.063Z
Learning: In rain.strategies configuration files, `arbitrum2` is an intentional alias for the Arbitrum network (same chain-id 42161) but with updated contract addresses. It serves as a deployment target for newer contract versions while maintaining the existing `arbitrum` configuration during transition periods.

Applied to files:

  • src/canary.rain
  • src/grid.rain
  • src/fixed-spread.rain
  • registry
  • src/dynamic-spread.rain
  • src/auction-dca.rain
📚 Learning: 2025-04-30T06:32:43.860Z
Learnt from: findolor
Repo: rainlanguage/rain.strategies PR: 29
File: settings.yaml:2-6
Timestamp: 2025-04-30T06:32:43.860Z
Learning: The `network-id` field is intentionally omitted for the flare network in the `settings.yaml` configuration file, unlike other networks which include both `chain-id` and `network-id` fields.

Applied to files:

  • settings.yaml
  • src/fixed-limit.rain
📚 Learning: 2025-07-03T09:47:48.019Z
Learnt from: thedavidmeister
Repo: rainlanguage/rain.strategies PR: 28
File: src/folio.rain:28-42
Timestamp: 2025-07-03T09:47:48.019Z
Learning: In Rain language strategy files, thedavidmeister prefers intentionally oversimplified setups over complex validation logic, especially in initial implementations like the folio strategy configuration.

Applied to files:

  • src/folio.rain
  • src/fixed-spread.rain
  • registry
📚 Learning: 2025-09-01T12:19:42.343Z
Learnt from: findolor
Repo: rainlanguage/rain.strategies PR: 59
File: src/fixed-limit.rain:68-68
Timestamp: 2025-09-01T12:19:42.343Z
Learning: In the rain.strategies repository, the team plans to replace contract addresses in the configuration files, and deployment-block values will be updated as part of that broader effort, so placeholder values like 1 are intentionally temporary.

Applied to files:

  • src/folio.rain
  • src/fixed-spread.rain
  • registry
  • src/fixed-limit.rain
  • src/dynamic-spread.rain
📚 Learning: 2025-04-30T06:32:49.466Z
Learnt from: findolor
Repo: rainlanguage/rain.strategies PR: 29
File: settings.yaml:1-35
Timestamp: 2025-04-30T06:32:49.466Z
Learning: In the Rain Strategies project, the `matchain` network referenced in `orderbooks` and `deployers` sections of the configuration YAML doesn't require an explicit definition in the `networks` section.

Applied to files:

  • src/folio.rain
  • src/fixed-spread.rain
📚 Learning: 2025-07-03T09:47:14.894Z
Learnt from: thedavidmeister
Repo: rainlanguage/rain.strategies PR: 28
File: src/folio.rain:115-122
Timestamp: 2025-07-03T09:47:14.894Z
Learning: In Rain language folio strategy, the zero balance check using `every(input-vault-before() output-vault-before())` is specifically implemented to prevent trades from executing while users are depositing or withdrawing from vaults, serving as a safety mechanism against race conditions during vault operations.

Applied to files:

  • src/folio.rain
  • src/fixed-spread.rain
  • registry
📚 Learning: 2025-09-04T12:59:34.219Z
Learnt from: thedavidmeister
Repo: rainlanguage/rain.strategies PR: 60
File: src/dynamic-spread.rain:924-929
Timestamp: 2025-09-04T12:59:34.219Z
Learning: In the Rain Strategies dynamic spread system, the io values cannot be zero due to business logic constraints where baseline uses any(cost-basis-io last-io) and cost-basis-multiplier is positive, making division-by-zero in inv(stored-last-io) mathematically impossible under normal operation.

Applied to files:

  • src/fixed-spread.rain
  • registry
  • src/fixed-limit.rain
  • src/dynamic-spread.rain
  • src/auction-dca.rain
📚 Learning: 2025-07-26T15:31:37.916Z
Learnt from: 0xgleb
Repo: rainlanguage/rain.strategies PR: 45
File: registry:0-0
Timestamp: 2025-07-26T15:31:37.916Z
Learning: In the rain.strategies repository, the registry file uses full commit SHAs to pin strategy URLs as the current established pattern, rather than using tags or branches, as confirmed by project maintainer 0xgleb.

Applied to files:

  • src/fixed-spread.rain
  • registry
📚 Learning: 2025-07-15T09:19:34.859Z
Learnt from: Siddharth2207
Repo: rainlanguage/rain.strategies PR: 53
File: src/claims.rain:0-0
Timestamp: 2025-07-15T09:19:34.859Z
Learning: In Rain language, the evaluation uses a stack-based model where stack indexes start from the bottom. In the calculate-io function, stack[0] represents the ratio and stack[1] represents the amount. This means when a function returns two values like `(expected-amount, 0)`, the first value is the ratio and the second value is the amount.

Applied to files:

  • src/fixed-limit.rain
  • src/dynamic-spread.rain
🪛 markdownlint-cli2 (0.18.1)
src/folio.md

3-3: Files should end with a single newline character

(MD047, single-trailing-newline)

src/fixed-spread.md

1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


1-1: Files should end with a single newline character

(MD047, single-trailing-newline)

🔇 Additional comments (4)
src/fixed-limit.rain (4)

1-1: LGTM!

The schema version bump from 3 to 4 is appropriate given the structural changes (new local-db-remotes section and new local-db-remote fields in orderbooks).


70-96: Addresses and deployment blocks are consistent across the codebase—manual on-chain verification required.

The updated orderbook addresses appear consistently throughout the project:

  • Flare: 0x8Dbc50485e7C6994923B9A2c603a2B6b2d8Eef64 (deployment-block: 49782578)
  • Base: 0x52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775 (deployment-block: 36667253)
  • Polygon: 0x8a3C8E610d827093F7437E0C45EFa648563c0dDA (deployment-block: 76772162)

These same addresses are synchronized across settings.yaml and multiple .rain files (fixed-limit, fixed-spread, folio, dynamic-spread, claims, auction-dca). All address formats are valid, and deployment block values are properly set. However, confirming that these addresses host actual orderbook contracts on their respective networks requires on-chain verification, which sandbox tooling cannot perform.


169-169: The addresses referenced in the review comment appear consistently across the codebase for their respective networks (0xAD4DeD9BBda1B409536906Fa48fe2b261bBaBde1 for Polygon, 0x22839F16281E67E5Fd395fAFd1571e820CbD46cB for Base, and 0x85e440C297f267332c34A88E0d085162a96475D2 for Flare), but I cannot definitively verify their correctness because:

  1. On-chain verification is not available in this sandbox environment
  2. Web search found no deployment records or documentation for these specific contract addresses
  3. The codebase shows these addresses are already established across multiple scenario files, but without the git diff, I cannot confirm if this represents actual changes or consistent configuration

The developer should manually verify that these addresses correspond to the correct raindex-subparser contract deployments on their respective networks (Polygon, Base, Flare), potentially through the project's deployment documentation, block explorers, or internal deployment records.


359-359: Verify max-positive-value() function existence in raindex-subparser.

The change uses max-positive-value() sourced from raindex-subparser (line 358). However, this function could not be verified in the codebase or Rain/Raindex documentation. Confirm:

  1. max-positive-value() is a valid function exported by raindex-subparser
  2. It's available in the version of raindex-subparser being used
  3. The semantic change from max-value() is intentional and correct

Comment on lines +11 to +25
subgraphs:
base: https://example.com/subgraph

metaboards:
base: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/metadata-base/2025-07-06-594f/gn

local-db-remotes:
raindex: https://example.com/subgraph

orderbooks:
base:
address: 0x52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775
deployment-block: 36667253
local-db-remote: raindex

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Claims: replace placeholder endpoints.

Both subgraphs.base and the new local-db-remotes.raindex point at https://example.com/subgraph. That 404s in production, so the merkle claim order can’t hydrate any on-chain data. Please hook this to the real Base RAIndex subgraph (or drop the local-db-remote field until you have it).

🤖 Prompt for AI Agents
In src/claims.rain around lines 11 to 25, the subgraphs.base and
local-db-remotes.raindex entries point to the placeholder URL
https://example.com/subgraph which 404s in production and prevents merkle claim
order hydration; replace subgraphs.base with the real Base RAIndex subgraph
endpoint (provide the correct HTTPS URL) and update local-db-remotes.raindex to
the corresponding RAIndex remote endpoint, or remove the local-db-remote:
raindex line entirely if you don’t yet have a valid remote; ensure the addresses
remain unchanged and validate the file loads successfully after updating.

Comment on lines +128 to +133
expected-amount: signed-context<0 1>(),
leaf-node: call<'get-leaf-node>(),
:call<'check-claim>(leaf-node),
:call<'verify-proof>(leaf-node),
_: expected-amount,
_: 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Swap calculate-io outputs (ratio vs amount).

Rain stacks expect the IO ratio first and the amount second. Returning (expected-amount, 0) sets the ratio to the reward and the amount to zero, so takers never receive tokens. Push (0, expected-amount) instead.

-  _: expected-amount,
-  _: 0;
+  _: 0,
+  _: expected-amount;

Based on learnings

🤖 Prompt for AI Agents
In src/claims.rain around lines 128 to 133 the calculate-io outputs are in the
wrong order: the code returns (expected-amount, 0) which assigns the IO ratio to
the reward and sets the transfer amount to zero; change the returned tuple to
(0, expected-amount) so the IO ratio is zero and the transfer amount equals
expected-amount, ensuring takers actually receive tokens.

Comment on lines +137 to +168
local-db-remotes:
raindex: https://example.com/subgraph

orderbooks:
flare:
address: 0xCEe8Cd002F151A536394E564b84076c41bBBcD4d
deployment-block: 1
local-db-remote: raindex
base:
address: 0xd2938e7c9fe3597f78832ce780feb61945c377d7
deployment-block: 1
address: 0x52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775
deployment-block: 36667253
local-db-remote: raindex
arbitrum:
address: 0x2f209e5b67A33B8fE96E28f24628dF6Da301c8eB
deployment-block: 352866209
address: 0x8df8075e4077dabf1e95f49059e4c1eea33094ab
deployment-block: 380203894
local-db-remote: raindex
polygon:
address: 0x7D2f700b1f6FD75734824EA4578960747bdF269A
deployment-block: 1
address: 0x8a3C8E610d827093F7437E0C45EFa648563c0dDA
deployment-block: 76772162
local-db-remote: raindex
bsc:
address: 0xd2938E7c9fe3597F78832CE780Feb61945c377d7
deployment-block: 1
local-db-remote: raindex
ethereum:
address: 0x0eA6d458488d1cf51695e1D6e4744e6FB715d37C
deployment-block: 1
local-db-remote: raindex
linea:
address: 0x22410e2a46261a1B1e3899a072f303022801C764
deployment-block: 1
local-db-remote: raindex
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Blocking: RAIndex local-db remote must be real.

Setting local-db-remotes.raindex to https://example.com/subgraph while wiring every orderbook to it causes every deployment to sync from a dead endpoint. The dynamic spread orders will fail to start once this merges. Please supply the actual RAIndex URL (or omit the wiring until it exists).

🤖 Prompt for AI Agents
In src/dynamic-spread.rain around lines 137 to 168, the RAIndex local-db-remote
is set to a placeholder (https://example.com/subgraph) which will point all
orderbooks to a dead endpoint; replace that placeholder with the real RAIndex
URL (the production or staging endpoint you intend to use) or remove the
local-db-remote: raindex entries from each orderbook until the real RAIndex
service exists so deployments don’t try to sync from a non-existent endpoint.

Comment on lines +65 to +66
local-db-remotes:
raindex: https://example.com/subgraph
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Replace placeholder URL with actual raindex endpoint.

The raindex entry points to https://example.com/subgraph, which is a placeholder and will cause runtime failures since all orderbooks reference it via local-db-remote: raindex.

Similarly, the subgraphs section (lines 57-63) uses the same placeholder URL for all networks. Ensure both sections are updated with actual endpoints before deployment.

🤖 Prompt for AI Agents
In src/fixed-limit.rain around lines 65-66 (and also update subgraphs at lines
57-63), the raindex URL is a placeholder (https://example.com/subgraph) which
will break runtime resolution; replace the placeholder with the actual raindex
endpoint(s) used by your deployment for each network, update the corresponding
entries in both local-db-remotes and subgraphs to those real, reachable URLs,
and verify connectivity (HTTP 200 / correct subgraph schema) before deploying.

@@ -0,0 +1 @@
This strategy has the ratio track a benchmark price (e.g. pyth) with a fixed multiplier. As long as that multiplier is >1, the strategy will always offer to trade at a premium to the benchmark, thereby increasing the likelihood that the deployer can "buy low sell high". No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a heading and trailing newline for Markdown lint.

This new doc fails MD041 (missing top-level heading) and MD047 (no trailing newline). Please add an # heading on the first line and end the file with a newline so markdownlint passes.

+# Fixed spread strategy
 This strategy has the ratio track a benchmark price (e.g. pyth) with a fixed multiplier. As long as that multiplier is >1, the strategy will always offer to trade at a premium to the benchmark, thereby increasing the likelihood that the deployer can "buy low sell high".
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
This strategy has the ratio track a benchmark price (e.g. pyth) with a fixed multiplier. As long as that multiplier is >1, the strategy will always offer to trade at a premium to the benchmark, thereby increasing the likelihood that the deployer can "buy low sell high".
# Fixed spread strategy
This strategy has the ratio track a benchmark price (e.g. pyth) with a fixed multiplier. As long as that multiplier is >1, the strategy will always offer to trade at a premium to the benchmark, thereby increasing the likelihood that the deployer can "buy low sell high".
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


1-1: Files should end with a single newline character

(MD047, single-trailing-newline)

🤖 Prompt for AI Agents
In src/fixed-spread.md around lines 1 to 1, the file is missing a top-level
Markdown heading and a trailing newline which causes MD041 and MD047 failures;
fix by adding a top-level heading (prefix the first line with "# " and an
appropriate title) as the first line of the file and ensure the file ends with a
newline character.

Comment on lines +132 to +180
description: Deploy an fixed-spread trategy on Base using Pyth price feeds to buy shares.
deposits:
- token: output
fields:
- binding: pyth-pair
name: Pyth price feed pair
description: |
The Pyth price feed pair to use for the auction.
This is used to determine the baseline and initial IO ratios for the auction.
For example, if you are buying WETH and selling USDC then you would use the WETH/USD price feed.
show-custom-field: false
presets:
- name: Equity.US.GOOG/USD
value: 0x924571756974792e55532e474f4f472f55534400000000000000000000000000
- name: Equity.US.AMZN/USD
value: 0x924571756974792e55532e414d5a4e2f55534400000000000000000000000000
- name: Equity.US.AAPL/USD
value: 0x924571756974792e55532e4141504c2f55534400000000000000000000000000
- name: Equity.US.MSFT/USD
value: 0x924571756974792e55532e4d5346542f55534400000000000000000000000000
- name: Equity.US.TSLA/USD
value: 0x924571756974792e55532e54534c412f55534400000000000000000000000000
- name: Equity.US.NVDA/USD
value: 0x924571756974792e55532e4e5644412f55534400000000000000000000000000
- name: Equity.US.META/USD
value: 0x924571756974792e55532e4d4554412f55534400000000000000000000000000
- name: Equity.US.GME/USD
value: 0x914571756974792e55532e474d452f5553440000000000000000000000000000
- name: Equity.US.MSTR/USD
value: 0x924571756974792e55532e4d5354522f55534400000000000000000000000000
- name: Equity.US.BRK-B/USD
value: 0x934571756974792e55532e42524b2d422f555344000000000000000000000000
- name: Equity.US.SPLG/USD
value: 0x924571756974792e55532e53504c472f55534400000000000000000000000000
- name: Equity.US.IAU/USD
value: 0x914571756974792e55532e4941552f5553440000000000000000000000000000
- binding: max-trade-amount
name: Maximum trade size (${order.outputs.0.token.symbol})
description: |
The maximum amount of ${order.outputs.0.token.symbol} to sell in a single auction.
- binding: min-trade-amount
name: Minimum trade size (${order.outputs.0.token.symbol})
description: |
The minimum amount of ${order.outputs.0.token.symbol} to sell in a single auction.
- binding: baseline-multiplier
name: Benchmark price multiplier
description: |
The multiplier to be applied to the benchmark when calculating the price the strategy will offer at
default: 1.001
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the Base GUI description typo.

The copy reads “Deploy an fixed-spread trategy…”. Please change this to “Deploy a fixed-spread strategy…” to avoid the grammar/spelling error in the deployment UI.

-      description: Deploy an fixed-spread trategy on Base using Pyth price feeds to buy shares.
+      description: Deploy a fixed-spread strategy on Base using Pyth price feeds to buy shares.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: Deploy an fixed-spread trategy on Base using Pyth price feeds to buy shares.
deposits:
- token: output
fields:
- binding: pyth-pair
name: Pyth price feed pair
description: |
The Pyth price feed pair to use for the auction.
This is used to determine the baseline and initial IO ratios for the auction.
For example, if you are buying WETH and selling USDC then you would use the WETH/USD price feed.
show-custom-field: false
presets:
- name: Equity.US.GOOG/USD
value: 0x924571756974792e55532e474f4f472f55534400000000000000000000000000
- name: Equity.US.AMZN/USD
value: 0x924571756974792e55532e414d5a4e2f55534400000000000000000000000000
- name: Equity.US.AAPL/USD
value: 0x924571756974792e55532e4141504c2f55534400000000000000000000000000
- name: Equity.US.MSFT/USD
value: 0x924571756974792e55532e4d5346542f55534400000000000000000000000000
- name: Equity.US.TSLA/USD
value: 0x924571756974792e55532e54534c412f55534400000000000000000000000000
- name: Equity.US.NVDA/USD
value: 0x924571756974792e55532e4e5644412f55534400000000000000000000000000
- name: Equity.US.META/USD
value: 0x924571756974792e55532e4d4554412f55534400000000000000000000000000
- name: Equity.US.GME/USD
value: 0x914571756974792e55532e474d452f5553440000000000000000000000000000
- name: Equity.US.MSTR/USD
value: 0x924571756974792e55532e4d5354522f55534400000000000000000000000000
- name: Equity.US.BRK-B/USD
value: 0x934571756974792e55532e42524b2d422f555344000000000000000000000000
- name: Equity.US.SPLG/USD
value: 0x924571756974792e55532e53504c472f55534400000000000000000000000000
- name: Equity.US.IAU/USD
value: 0x914571756974792e55532e4941552f5553440000000000000000000000000000
- binding: max-trade-amount
name: Maximum trade size (${order.outputs.0.token.symbol})
description: |
The maximum amount of ${order.outputs.0.token.symbol} to sell in a single auction.
- binding: min-trade-amount
name: Minimum trade size (${order.outputs.0.token.symbol})
description: |
The minimum amount of ${order.outputs.0.token.symbol} to sell in a single auction.
- binding: baseline-multiplier
name: Benchmark price multiplier
description: |
The multiplier to be applied to the benchmark when calculating the price the strategy will offer at
default: 1.001
description: Deploy a fixed-spread strategy on Base using Pyth price feeds to buy shares.
deposits:
- token: output
fields:
- binding: pyth-pair
name: Pyth price feed pair
description: |
The Pyth price feed pair to use for the auction.
This is used to determine the baseline and initial IO ratios for the auction.
For example, if you are buying WETH and selling USDC then you would use the WETH/USD price feed.
show-custom-field: false
presets:
- name: Equity.US.GOOG/USD
value: 0x924571756974792e55532e474f4f472f55534400000000000000000000000000
- name: Equity.US.AMZN/USD
value: 0x924571756974792e55532e414d5a4e2f55534400000000000000000000000000
- name: Equity.US.AAPL/USD
value: 0x924571756974792e55532e4141504c2f55534400000000000000000000000000
- name: Equity.US.MSFT/USD
value: 0x924571756974792e55532e4d5346542f55534400000000000000000000000000
- name: Equity.US.TSLA/USD
value: 0x924571756974792e55532e54534c412f55534400000000000000000000000000
- name: Equity.US.NVDA/USD
value: 0x924571756974792e55532e4e5644412f55534400000000000000000000000000
- name: Equity.US.META/USD
value: 0x924571756974792e55532e4d4554412f55534400000000000000000000000000
- name: Equity.US.GME/USD
value: 0x914571756974792e55532e474d452f5553440000000000000000000000000000
- name: Equity.US.MSTR/USD
value: 0x924571756974792e55532e4d5354522f55534400000000000000000000000000
- name: Equity.US.BRK-B/USD
value: 0x934571756974792e55532e42524b2d422f555344000000000000000000000000
- name: Equity.US.SPLG/USD
value: 0x924571756974792e55532e53504c472f55534400000000000000000000000000
- name: Equity.US.IAU/USD
value: 0x914571756974792e55532e4941552f5553440000000000000000000000000000
- binding: max-trade-amount
name: Maximum trade size (${order.outputs.0.token.symbol})
description: |
The maximum amount of ${order.outputs.0.token.symbol} to sell in a single auction.
- binding: min-trade-amount
name: Minimum trade size (${order.outputs.0.token.symbol})
description: |
The minimum amount of ${order.outputs.0.token.symbol} to sell in a single auction.
- binding: baseline-multiplier
name: Benchmark price multiplier
description: |
The multiplier to be applied to the benchmark when calculating the price the strategy will offer at
default: 1.001
🤖 Prompt for AI Agents
In src/fixed-spread.rain around lines 132-180, the description string contains a
grammar and spelling error: "Deploy an fixed-spread trategy on Base using Pyth
price feeds to buy shares." Update that description to "Deploy a fixed-spread
strategy on Base using Pyth price feeds to buy shares." (fix the article "an" →
"a" and the misspelling "trategy" → "strategy") so the deployment UI shows the
corrected text.

@@ -0,0 +1,3 @@
# Folio Rebalancer

Folio rebalances a portfolio of tokens to maintain an equal weight distribution across all assets. No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add trailing newline for markdownlint.

markdownlint (MD047) flags this file; append a final newline so the docs build/lint passes.

- Folio rebalances a portfolio of tokens to maintain an equal weight distribution across all assets.
+Folio rebalances a portfolio of tokens to maintain an equal weight distribution across all assets.
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Folio rebalances a portfolio of tokens to maintain an equal weight distribution across all assets.
Folio rebalances a portfolio of tokens to maintain an equal weight distribution across all assets.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

3-3: Files should end with a single newline character

(MD047, single-trailing-newline)

🤖 Prompt for AI Agents
In src/folio.md around line 3, the file is missing a trailing newline which
triggers markdownlint MD047; append a single newline character at the end of the
file so the file ends with a blank line (ensure the last line terminates with
\n) and save to satisfy the linter.

Comment on lines +15 to +25
base: https://example.com/subgraph

local-db-remotes:
raindex: https://example.com/subgraph

orderbooks:
base:
address: 0x52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775
deployment-block: 36667253
local-db-remote: raindex

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Blocking: replace placeholder endpoints.

https://example.com/subgraph is a placeholder. With this committed, raindex syncs and subgraph lookups will 404, so the folio order can’t ever come online. Please wire the real RAIndex/subgraph URLs (or leave the remote unset until they exist) before merging.

🤖 Prompt for AI Agents
In src/folio.rain around lines 15 to 25, the base and local-db-remotes entries
use the placeholder URL https://example.com/subgraph which will cause raindex
syncs and subgraph lookups to 404; replace these placeholders with the real
RAIndex/subgraph endpoints or remove/leave the local-db-remote unset until the
real endpoints exist. Update the base field and the raindex entry to point to
the correct production or staging subgraph URLs, and if those services aren’t
available yet remove the local-db-remote reference (or comment it out) so the
orderbook’s local-db-remote is not configured with a non-existent endpoint.

Comment on lines +57 to +58
local-db-remotes:
raindex: https://example.com/subgraphs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix the raindex local-db URL typo.

local-db-remotes.raindex points to https://example.com/subgraphs, but every other file (and the actual endpoint) uses the singular /subgraph. With the current string, local DB lookups will 404, so the strategy cannot sync locally. Please align this URL with the others.

-  raindex: https://example.com/subgraphs
+  raindex: https://example.com/subgraph
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
local-db-remotes:
raindex: https://example.com/subgraphs
local-db-remotes:
raindex: https://example.com/subgraph
🤖 Prompt for AI Agents
In src/grid.rain around lines 57 to 58, the local-db-remotes.raindex URL is
incorrectly set to "https://example.com/subgraphs"; update it to the singular
path "https://example.com/subgraph" to match other files and the actual endpoint
so local DB lookups don't 404 and the strategy can sync locally.

@hardyjosh hardyjosh merged commit 96e8627 into main Nov 7, 2025
1 check passed
This was referenced Nov 7, 2025
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