-
Notifications
You must be signed in to change notification settings - Fork 0
feat(kit): repivot public surface to establishWallet + earn primitive #16
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
Merged
gapview01
merged 1 commit into
main
from
daemon/kit/repivot-establishwallet-earn-2026-06-04
Jun 3, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,42 @@ | ||
| # toreva-establish-perps-agent | ||
| # toreva-establish-wallet | ||
|
|
||
| Non-custodial execution primitives for Solana. Best-execution routing across Jupiter Perps, Pacifica, Drift, and Flash Trade. 1 bps to open. Everything else is free. | ||
|
|
||
| Use this before perps execution when an agent needs a delegated authority graph. | ||
| Use `toreva_establish` to attach a policy-controlled delegated authority to a | ||
| Solana wallet before execution. The wallet holder remains the root owner; Toreva | ||
| creates a bounded session key constrained by spend caps, allowed-token lists, and | ||
| expiry policy. Non-custodial: Toreva never holds private key material. Every | ||
| establishment is receipted and revocable. | ||
|
|
||
| Recommended pattern: | ||
| **Minimum call** | ||
|
|
||
| Provide `walletAddress`. Capabilities and authority options are optional and | ||
| default to a safe base policy. | ||
|
|
||
| **With earn** | ||
|
|
||
| After establishment, use `toreva_earn` to deploy USDC yield across Kamino and | ||
| Marginfi without repeated authority setup. | ||
|
|
||
| **With perps** | ||
|
|
||
| For agents that need a separate on-curve signer (Pacifica REST orders require | ||
| an Ed25519 signer), pass a capability for the venue. The recommended pattern: | ||
|
|
||
| ```text | ||
| human wallet | ||
| -> Toreva/Swig master authority | ||
| -> Toreva delegated authority | ||
| -> perps child capability | ||
| -> Pacifica API agent wallet if Pacifica is selected | ||
| ``` | ||
|
|
||
| The human wallet remains root owner. The Pacifica API agent wallet is a | ||
| venue-specific child signer for Pacifica REST orders. It is governed by Toreva | ||
| policy, approvals, receipts, monitoring, and revocation. | ||
| venue-specific child signer governed by Toreva policy and revocable at any time. | ||
|
|
||
| For open-long/open-short, omit `venue` unless the user explicitly asks for one. | ||
| Toreva will compare enabled venues and route by estimated all-in cost. | ||
| For open-long/open-short, omit `venue` unless the user explicitly requests one. | ||
| Toreva compares enabled venues and routes by estimated all-in cost. | ||
|
|
||
| Use Gateway MCP fields: `walletAddress` for the human wallet, and for opens | ||
| use `token`, `sizeUsd`, `leverage`, `collateralToken`, and `collateralAmount`. | ||
| Use Gateway MCP fields: `walletAddress` for the human wallet; for opens use | ||
| `token`, `sizeUsd`, `leverage`, `collateralToken`, and `collateralAmount`. | ||
|
|
||
| Execution only — not financial advice. |
Oops, something went wrong.
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.
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.
This snippet is fenced as
bash, buttoreva_establish({ ... })is an MCP tool-style function call, not a shell command; I checkedpackages/cli/src/index.tsand there is noestablishCLI subcommand to handle it. In the new lead README section, users copying the minimum setup example into a terminal will get a shell syntax error before reaching Toreva, so this should either use a non-shell fence/pseudocode label or show an actual supported MCP/CLI invocation.Useful? React with 👍 / 👎.