-
Notifications
You must be signed in to change notification settings - Fork 1
Local db remote settings #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis 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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Areas requiring extra attention:
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this 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:
Arbitrum address mismatch: fixed-limit.rain uses
0x5e9e22154d71f9fd4b5fd1ee36852a4c9fcdcc9ebut settings.yaml specifies0xb1869a4FA6436832bb0AD5420170B8CF17CaF934. These should match.Flare address new deployment: The flare address
0x8EE45EA9d6b7eb4026269D8c2BbdB20bEB38428dis not in git history and differs from the previous0xE3989Ea7486c0F418C764e6c511e86f6E8830FAb. Verify this is the correct newly deployed contract.Incomplete flare update:
src/dynamic-spread.rainstill 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
📒 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.rainsrc/grid.rainsrc/fixed-spread.rainregistrysrc/dynamic-spread.rainsrc/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.yamlsrc/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.rainsrc/fixed-spread.rainregistry
📚 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.rainsrc/fixed-spread.rainregistrysrc/fixed-limit.rainsrc/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.rainsrc/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.rainsrc/fixed-spread.rainregistry
📚 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.rainregistrysrc/fixed-limit.rainsrc/dynamic-spread.rainsrc/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.rainregistry
📚 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.rainsrc/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-remotessection and newlocal-db-remotefields 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:
- On-chain verification is not available in this sandbox environment
- Web search found no deployment records or documentation for these specific contract addresses
- 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 fromraindex-subparser(line 358). However, this function could not be verified in the codebase or Rain/Raindex documentation. Confirm:
max-positive-value()is a valid function exported byraindex-subparser- It's available in the version of raindex-subparser being used
- The semantic change from
max-value()is intentional and correct
| 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 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| local-db-remotes: | ||
| raindex: https://example.com/subgraph |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
| base: https://example.com/subgraph | ||
|
|
||
| local-db-remotes: | ||
| raindex: https://example.com/subgraph | ||
|
|
||
| orderbooks: | ||
| base: | ||
| address: 0x52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775 | ||
| deployment-block: 36667253 | ||
| local-db-remote: raindex | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| local-db-remotes: | ||
| raindex: https://example.com/subgraphs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
Motivation
Solution
Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit
New Features
Improvements