docs: add strategy quickstart (drift-rebalance pair) - #46
Draft
NicolaBernini wants to merge 1 commit into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an initial Strategy Docs “quickstart” page under Operate to help curators/operators author and POST a valid drift-trigger rebalance strategy pair (deposit + withdrawal) into the Strategy Engine, and wires the page into the docs navigation.
Changes:
- Added
operate/strategy/quickstart.mdxwith end-to-end guidance and two copy/paste JSON payloads (deposit/withdraw pair). - Updated
docs.jsonto introduce a “Strategy Authoring” nav group under the Operate tab linking to the new page.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| operate/strategy/quickstart.mdx | New quickstart guide for authoring and posting a drift-trigger rebalance strategy pair. |
| docs.json | Adds “Strategy Authoring” navigation group so the new page is discoverable under Operate. |
Comments suppressed due to low confidence (1)
operate/strategy/quickstart.mdx:162
- This curl example also uses
$SUPERFORM_JWT; for consistency with the rest of the Operate docs (which useSUPERFORMOS_JWT), consider updating the env var name here as well.
```bash
curl -X PATCH https://strategy.superform.xyz/api/v1/strategies/{strategy_id}/state \
-H "Authorization: Bearer $SUPERFORM_JWT" \
-H "Content-Type: application/json" \
--data '{"target_state": "RUNNING", "version": 1}'
</details>
---
💡 <a href="/superform-xyz/docs/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
| @@ -0,0 +1,177 @@ | |||
| --- | |||
| title: "Strategy Quickstart" | |||
| description: "Author and POST your first Superman strategy in 10 minutes." | |||
| `vault_free_assets` is sourced live from chain as `IERC20(asset).balanceOf(strategy)` through the EVM RPC datafeed, so the trigger reflects the strategy contract's actual idle balance. `vault_tvl` is derived from yield-source allocations on the subgraph cadence. Both are in the underlying asset's base units. | ||
|
|
||
| <Warning> | ||
| **Avoid division in trigger expressions.** The validator dry-runs every expression against an empty `EvalSnapshot` (all zeros) to catch type errors. `vault_free_assets / vault_tvl > 0.10` would fail with `division by zero` at `POST /strategies` time, even though it's semantically equivalent. Use the multiplicative form `vault_free_assets > 0.10 * vault_tvl` instead. |
|
|
||
| Both are positive whenever their trigger fires. A `size_expr` that evaluates to ≤ 0 at runtime is dropped before reaching the OMS. | ||
|
|
||
| Indicators (SMA, RSI, MACD, etc.) and conviction tuning (graded confidence, dead bands) are out of scope here — they live in the [Cookbook](/operate/strategy/cookbook) and [Conviction](/operate/strategy/conviction) pages. |
Comment on lines
+148
to
+152
| ```bash | ||
| curl -X POST https://strategy.superform.xyz/api/v1/strategies \ | ||
| -H "Authorization: Bearer $SUPERFORM_JWT" \ | ||
| -H "Content-Type: application/json" \ | ||
| --data @deposit.json |
|
|
||
| ## Common rejections | ||
|
|
||
| The validator runs at `POST` and `PUT` time only. Most first-time rejections fall into a handful of buckets — unknown identifier, division-by-zero in a dry-run, missing `objective`, non-hex address. The full list with example error strings is on the [Troubleshooting](/operate/strategy/troubleshooting) page. |
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
operate/strategy/quickstart.mdx— the first hand-authored page in the Strategy Docs redesign IA. A curator landing on it can copy-paste a valid strategy JSON and POST it to the Strategy API on the first try.Strategy Authoringgroup todocs.jsonnavigation under the Operate tab so the page is discoverable.First deliverable of the redesign plan (Heptabase: "Superform - Strategy Docs Plan - 19 May 2026"; Vik ask, 18 May 2026).
Companion engine PR
superform-xyz/superman-strategybranchdocs/strategy-quickstartherehttps://github.com/superform-xyz/superman-strategy/pull/50
— adds
testdata/cookbook/drift_rebalance_{deposit,withdraw}.json(the two JSON payloads embedded in this page) plusinternal/rule/cookbook_test.gowhich CI-validates them against the liveStrategyValidator. The two PRs must merge together so the JSON-in-docs stays in lockstep with the engine.Notes for review
operate/strategy/, notcurate/strategy/as originally specced. Vik'scurate/→operate/rename (commit59c0144, 2026-05-19) landed before this work; followed the rename and updated all in-page links accordingly. Happy to migrate to a different parent if the layered IA wants its own section.vault_free_assets > 0.10 * vault_tvl) because the validator dry-runs every expression against a zero-valuedEvalSnapshotand rejects/ vault_tvlwithdivision by zero. The page calls this out as a<Warning>block — it's a real first-time-curator gotcha worth teaching./operate/strategy/action-config,/operate/strategy/troubleshooting,/operate/strategy/cookbook,/operate/strategy/conviction. They're stubs in the layered-IA roadmap; expected to 404 until those pages land in follow-up PRs.Frontmatter
Includes the agent-friendly fields (
agent_intent,strategy_json,applicability) that the futurellms.mdCI assembly step will consume.Test plan
mintlify dev(ormintlify build) renders the page cleanly — I could not verify locally (nomintlifyCLI on the author machine). Please confirm in preview before merge.jq.https://strategy.superform.xyz).🤖 Generated with Claude Code