Skip to content

feat: add --tokens flag to list deployment-specific tokens#2549

Open
hardyjosh wants to merge 1 commit into
interactive-strategy-builderfrom
list-tokens
Open

feat: add --tokens flag to list deployment-specific tokens#2549
hardyjosh wants to merge 1 commit into
interactive-strategy-builderfrom
list-tokens

Conversation

@hardyjosh
Copy link
Copy Markdown
Contributor

@hardyjosh hardyjosh commented Apr 14, 2026

Motivation

Non-interactive strategy-builder users need the valid token addresses for a deployment to populate --select-token KEY=<address> flags. The webapp resolves this dynamically by reading the registry's token-list; CLI users currently have no equivalent.

Inlining the full token list in --describe output was considered and rejected: a registry can have hundreds of tokens and the list is typically only needed for the one deployment the caller is working with.

Solution

Add a --tokens flag that scopes to a single strategy + deployment and emits a markdown table of the tokens the registry has registered for that deployment.

raindex strategy-builder --tokens \
  --registry <url> --strategy <key> --deployment <key>

Output:

# Available tokens — `fixed-limit` / `base`

14 tokens. Use any address as the value of a `--select-token KEY=<address>` flag.

| Symbol | Name | Address | Decimals |
|--------|------|---------|----------|
| `wtIAU` | Wrapped iShares Gold Trust ST0x | `0x1E46...` | 18 |
...

Any ERC20 address is accepted for --select-token; the list is a curated convenience subset. --describe links to this command so agents fetch scoped lists on demand.

Checks

  • 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)

Copy link
Copy Markdown
Contributor Author

hardyjosh commented Apr 14, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label Raindex-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 75644f24-e533-4340-b85f-5ff4b03033ea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch list-tokens

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.

@hardyjosh hardyjosh marked this pull request as ready for review April 15, 2026 12:48
@hardyjosh hardyjosh force-pushed the interactive-strategy-builder branch from 5b81496 to 09b6e85 Compare April 15, 2026 15:46
@hardyjosh
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 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.

@hardyjosh hardyjosh force-pushed the interactive-strategy-builder branch from 09b6e85 to 9a36b8f Compare April 15, 2026 20:50
@hardyjosh
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 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.

Copy link
Copy Markdown
Contributor Author

hardyjosh commented May 11, 2026

Merge activity

graphite-app Bot pushed a commit that referenced this pull request May 11, 2026
## Motivation

The Raindex orderbook protocol has a rich GUI builder flow in the webapp for configuring and deploying strategies. There is currently no way to do the same from a terminal or from a non-interactive agent — the webapp is the only entry point. That forces anyone automating a deployment (CI, scripts, AI agents) to either drive the browser or hand-roll the calldata.

## Solution

Add a `strategy-builder` subcommand to the raindex CLI that generates deployment calldata from a remote registry strategy.

```
raindex strategy-builder \
  --registry <url> \
  --strategy <key> \
  --deployment <key> \
  --owner <0x-address> \
  [--select-token KEY=ADDRESS ...] \
  [--set-field BINDING=VALUE ...] \
  [--set-deposit TOKEN=AMOUNT ...]
```

Outputs one `<address>:<calldata>` line per transaction on stdout — approvals first, then the deployment multicall, then optional metaboard meta emission. Each line is one signable transaction.

Implementation reuses `RaindexOrderBuilder` from the common crate (same object the webapp drives) and `DotrainRegistry` from the js_api crate, so the CLI and webapp use identical resolution semantics.

Follow-up PRs in this stack add `--interactive` (#2546), `--tokens` (#2549), the template-fallback operator (#2551), and `--describe` (#2548).

## Checks

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

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added a new `strategy-builder` command that generates deployment calldata from registry strategies with configurable field bindings, token selections, and deposit amounts.

* **Improvements**
  * Token logo URIs are now optional, improving compatibility with token data sources.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app Bot force-pushed the interactive-strategy-builder branch from 70bd12e to 064b102 Compare May 11, 2026 10:04
graphite-app Bot pushed a commit that referenced this pull request May 11, 2026
## Motivation

Non-interactive `strategy-builder` users need the valid token addresses for a deployment to populate `--select-token KEY=<address>` flags. The webapp resolves this dynamically by reading the registry's token-list; CLI users currently have no equivalent.

Inlining the full token list in `--describe` output was considered and rejected: a registry can have hundreds of tokens and the list is typically only needed for the one deployment the caller is working with.

## Solution

Add a `--tokens` flag that scopes to a single strategy + deployment and emits a markdown table of the tokens the registry has registered for that deployment.

```
raindex strategy-builder --tokens \
  --registry <url> --strategy <key> --deployment <key>
```

Output:

```
# Available tokens — `fixed-limit` / `base`

14 tokens. Use any address as the value of a `--select-token KEY=<address>` flag.

| Symbol | Name | Address | Decimals |
|--------|------|---------|----------|
| `wtIAU` | Wrapped iShares Gold Trust ST0x | `0x1E46...` | 18 |
...
```

Any ERC20 address is accepted for `--select-token`; the list is a curated convenience subset. `--describe` links to this command so agents fetch scoped lists on demand.

## Checks

- [x] made this PR as small as possible
- [x] unit-tested any new functionality
- [x] linked any relevant issues or PRs
- [ ] included screenshots (if this involves a front-end change)
graphite-app Bot pushed a commit that referenced this pull request May 11, 2026
## Motivation

The Raindex orderbook protocol has a rich GUI builder flow in the webapp for configuring and deploying strategies. There is currently no way to do the same from a terminal or from a non-interactive agent — the webapp is the only entry point. That forces anyone automating a deployment (CI, scripts, AI agents) to either drive the browser or hand-roll the calldata.

## Solution

Add a `strategy-builder` subcommand to the raindex CLI that generates deployment calldata from a remote registry strategy.

```
raindex strategy-builder \
  --registry <url> \
  --strategy <key> \
  --deployment <key> \
  --owner <0x-address> \
  [--select-token KEY=ADDRESS ...] \
  [--set-field BINDING=VALUE ...] \
  [--set-deposit TOKEN=AMOUNT ...]
```

Outputs one `<address>:<calldata>` line per transaction on stdout — approvals first, then the deployment multicall, then optional metaboard meta emission. Each line is one signable transaction.

Implementation reuses `RaindexOrderBuilder` from the common crate (same object the webapp drives) and `DotrainRegistry` from the js_api crate, so the CLI and webapp use identical resolution semantics.

Follow-up PRs in this stack add `--interactive` (#2546), `--tokens` (#2549), the template-fallback operator (#2551), and `--describe` (#2548).

## Checks

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

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added a new `strategy-builder` command that generates deployment calldata from registry strategies with configurable field bindings, token selections, and deposit amounts.

* **Improvements**
  * Token logo URIs are now optional, improving compatibility with token data sources.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app Bot force-pushed the interactive-strategy-builder branch from 064b102 to 42d4024 Compare May 11, 2026 12:28
graphite-app Bot pushed a commit that referenced this pull request May 11, 2026
## Motivation

Non-interactive `strategy-builder` users need the valid token addresses for a deployment to populate `--select-token KEY=<address>` flags. The webapp resolves this dynamically by reading the registry's token-list; CLI users currently have no equivalent.

Inlining the full token list in `--describe` output was considered and rejected: a registry can have hundreds of tokens and the list is typically only needed for the one deployment the caller is working with.

## Solution

Add a `--tokens` flag that scopes to a single strategy + deployment and emits a markdown table of the tokens the registry has registered for that deployment.

```
raindex strategy-builder --tokens \
  --registry <url> --strategy <key> --deployment <key>
```

Output:

```
# Available tokens — `fixed-limit` / `base`

14 tokens. Use any address as the value of a `--select-token KEY=<address>` flag.

| Symbol | Name | Address | Decimals |
|--------|------|---------|----------|
| `wtIAU` | Wrapped iShares Gold Trust ST0x | `0x1E46...` | 18 |
...
```

Any ERC20 address is accepted for `--select-token`; the list is a curated convenience subset. `--describe` links to this command so agents fetch scoped lists on demand.

## Checks

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

Non-interactive `strategy-builder` users need the valid token addresses for a deployment to populate `--select-token KEY=<address>` flags. The webapp resolves this dynamically by reading the registry's token-list; CLI users currently have no equivalent.

Inlining the full token list in `--describe` output was considered and rejected: a registry can have hundreds of tokens and the list is typically only needed for the one deployment the caller is working with.

## Solution

Add a `--tokens` flag that scopes to a single strategy + deployment and emits a markdown table of the tokens the registry has registered for that deployment.

```
raindex strategy-builder --tokens \
  --registry <url> --strategy <key> --deployment <key>
```

Output:

```
# Available tokens — `fixed-limit` / `base`

14 tokens. Use any address as the value of a `--select-token KEY=<address>` flag.

| Symbol | Name | Address | Decimals |
|--------|------|---------|----------|
| `wtIAU` | Wrapped iShares Gold Trust ST0x | `0x1E46...` | 18 |
...
```

Any ERC20 address is accepted for `--select-token`; the list is a curated convenience subset. `--describe` links to this command so agents fetch scoped lists on demand.

## Checks

- [x] made this PR as small as possible
- [x] unit-tested any new functionality
- [x] linked any relevant issues or PRs
- [ ] included screenshots (if this involves a front-end change)
graphite-app Bot pushed a commit that referenced this pull request May 11, 2026
## Motivation

The Raindex orderbook protocol has a rich GUI builder flow in the webapp for configuring and deploying strategies. There is currently no way to do the same from a terminal or from a non-interactive agent — the webapp is the only entry point. That forces anyone automating a deployment (CI, scripts, AI agents) to either drive the browser or hand-roll the calldata.

## Solution

Add a `strategy-builder` subcommand to the raindex CLI that generates deployment calldata from a remote registry strategy.

```
raindex strategy-builder \
  --registry <url> \
  --strategy <key> \
  --deployment <key> \
  --owner <0x-address> \
  [--select-token KEY=ADDRESS ...] \
  [--set-field BINDING=VALUE ...] \
  [--set-deposit TOKEN=AMOUNT ...]
```

Outputs one `<address>:<calldata>` line per transaction on stdout — approvals first, then the deployment multicall, then optional metaboard meta emission. Each line is one signable transaction.

Implementation reuses `RaindexOrderBuilder` from the common crate (same object the webapp drives) and `DotrainRegistry` from the js_api crate, so the CLI and webapp use identical resolution semantics.

Follow-up PRs in this stack add `--interactive` (#2546), `--tokens` (#2549), the template-fallback operator (#2551), and `--describe` (#2548).

## Checks

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

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * Added `strategy-builder` command to the CLI for generating deployment calldata from registry-based strategies. The command accepts required parameters for registry URL, strategy identifier, deployment address, and owner. Users can further customize strategy deployments with repeatable options to set field bindings, select tokens, and configure deposit amounts, enabling streamlined deployment workflows.

[![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/rainlanguage/raindex/pull/2544)
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app Bot force-pushed the interactive-strategy-builder branch from 42d4024 to b71ab0d Compare May 11, 2026 12:32
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.

2 participants