marinade-bond-sweep
Skill3 starsChanged 2 months agoMITView on GitHub
Sweep surplus SOL from a Solana mainnet validator vote account and identity account into its existing Marinade Validator Bond using keypairs held on the local operator machine. Use when funding a validator's Marinade bond while retaining vote-account rent exemption and at least 5 SOL in the identity.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- doublezero-statusSkill
- inventorySkill
- jito-bam-boostSkill
- jitosol-stewardSkill
- onboardingSkill
- sfdp-checkSkill
- upgrade-agave-primarySkill
- upgrade-agaveSkill
- upgrade-mainnetSkill
- upgrade-testnetSkill
- validator-performanceSkill
- validator-revenueSkill
- votex-roi-simSkill
- votex-statusSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 7 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Read installed bundle and configuration before running commands.
- Very specific: line 26
Ensure the Bun global binary directory is on PATH.
- Very specific: line 36
Use a fee-payer keypair whose pubkey differs from the validator identity.
- Distinctive: line 37
Never expose, print, copy, or store keypair contents.
- Distinctive: line 38
Never SSH to a validator host to discover or use a signer, and never fall back to a validator-host key path when a local signer is missing.
- Very specific: line 39
Do not use --skip-preflight.
- Very specific: line 40
Never invoke the executor's --execute mode before showing the current read-only result and receiving explicit operator confirmation.
- Distinctive: line 52
If any required local keypair cannot be found or validated, pause and tell the operator which signer role and expected pubkey are missing.
- Very specific: line 69
Do not repeat the planner or show-bond serially when this result succeeds.
- Distinctive: line 75
Only after explicit confirmation, run the same local command with the approved values:
- Very specific: line 100
Do not replace this flow with manual commands after a successful Phase 1.
- Distinctive: line 110
If vote withdrawal succeeds but funding fails, stop.
- Distinctive: line 111
If RPC submission returns an ambiguous error, resolve the transaction signature and finalized status before considering any retry.
- Distinctive: line 112
If balance drift would exceed the approved funding ceiling or consume the execution buffer and put the identity below the hard floor, stop …
- Very specific: line 113
If the final identity is below the 5 SOL hard floor, report it as a safety failure immediately and do not perform another debit.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Marinade Bond Sweep
Read installed bundle and configuration before running commands. Resolve paths from this loaded SKILL.md, not the session working directory.
Sweep a mainnet validator's vote-account and identity-account surplus into its existing Marinade bond. Run discovery, preflight, simulation, signing, submission, and verification from the local operator machine; the validator host is not a signing environment for this workflow. Use the bundled two-phase executor so independent preflight checks run in parallel and balance-only drift does not create a second approval loop. This is a production mutation: complete the read-only phase, show its exact plan, and wait for explicit operator approval before starting the execution phase.
Local prerequisites
Install the repository's Bun dependencies, and ensure solana and solana-keygen are available in the local runtime. Solana CLI 3.1.9 is the locally checked reference; inspect withdrawal/confirmation flags for other releases before signing. The executor requires validator-bonds CLI 2.6.0 and Node.js >=20.18.0 on PATH (the pinned CLI uses a Node interpreter even when installed with Bun):
bun add --global @marinade.finance/validator-bonds-cli@2.6.0
validator-bonds --versionEnsure the Bun global binary directory is on PATH. Preflight checks required fund-bond-sol flags and refuses a different validator-bonds version. No local signers are needed to install tools or view --help.
Fixed policy
- Apply RPC setup and selection. Both planner and executor accept
--rpc,--config, and--profile; never print or commit API keys. - Operate only on an existing bond. Never initialize, configure, withdraw from, or otherwise change a bond.
- Vote account: when its finalized total balance is below
1 SOL, skip it. Otherwise withdrawALLto the validator identity; Solana CLI's vote-accountALLsemantics leave the rent-exempt minimum. - Identity account: evaluate its finalized balance independently before moving vote funds. The hard floor is
5 SOL; use a5.001 SOLexecution reserve because an active validator identity can continue paying vote fees while the transaction is simulated and finalized. Below5 SOL, contribute none of its original balance. At or below5.001 SOL, contribute none. Above5.001 SOL, contribute exactlybalance - 5.001 SOL. - Require every nonzero sweep to leave at least
5 SOLin the identity. If the identity starts below5 SOL, reject an otherwise eligible vote sweep during read-only planning, before any withdrawal. A below-floor identity with no eligible surplus can still produce a no-op result. Do not retain part of the vote surplus to top up the identity under this policy. - Withdraw any eligible vote surplus temporarily to the identity, then fund the bond once with
vote surplus + identity surplus. This returns an identity that started above5.001 SOLto the operational reserve before concurrent vote fees; an identity that started between5 SOLand the reserve returns to its unchanged starting balance. - Use a fee-payer keypair whose pubkey differs from the validator identity. This keeps transaction fees from reducing the identity below the
5 SOLtarget. - Never expose, print, copy, or store keypair contents. Use only keypair files already present on the local operator machine.
- Never SSH to a validator host to discover or use a signer, and never fall back to a validator-host key path when a local signer is missing.
- Do not use
--skip-preflight. Requirefinalizedconfirmation. - Never invoke the executor's
--executemode before showing the current read-only result and receiving explicit operator confirmation. A request to inspect, plan, or preflight is not execution approval.
Resolve the validator
- Resolve the requested validator from an explicit vote account or the operator's chain profile (
references/onboarding.md). Reuse verified public keys and pass them explicitly to the executor. A profile or host key path is not evidence that a local signer is available. - Re-check the vote account through Helius and derive both the live identity and current authorized-withdrawer from its finalized state. Do not use a testnet validator, an unstaked/warmup identity, a stale inventory value, or an ambiguous host.
- Discover these three signer roles on the local operator machine without reading keypair contents:
- current validator identity keypair;
- current vote authorized-withdrawer keypair;
- a fee-payer keypair whose pubkey differs from the validator identity.
- Ask for local signer paths or use paths explicitly provided earlier by this operator. Search only operator-designated local key directories by filename when needed; do not scan unrelated logs or other operators' inventories. Keep paths in operator-owned configuration outside the repository and never print or parse JSON key material. See
references/inventory-references-hosts.mdfor signer onboarding. - Require each selected local file to be readable and compare its
solana-keygen pubkeyoutput with the expected on-chain pubkey. Do not trust a filename alone. The authorized-withdrawer keypair may also be the fee payer only when its pubkey differs from the identity and its finalized balance is sufficient for the planned transactions. - If any required local keypair cannot be found or validated, pause and tell the operator which signer role and expected pubkey are missing. Do not SSH to the validator host, fetch a remote key, copy a key between machines, or guess a path.
Phase 1: read-only preflight
From the resolved bundle root, run the bundled executor without --execute:
bun src/skills/marinade-bond-sweep/scripts/execute.ts \
--vote-account "$VOTE_ACCOUNT" \
--identity "$IDENTITY_ACCOUNT" \
--identity-keypair "$IDENTITY_KEYPAIR" \
--withdrawer-keypair "$VOTE_WITHDRAWER_KEYPAIR" \
--fee-payer-keypair "$FEE_PAYER_KEYPAIR"This mode cannot mutate chain state. It runs the finalized planner, bond lookup, signer checks, fee-payer balance check, and local tooling checks in parallel. It emits one JSON result containing the accounts, balances, action path, signer paths, exact proposed funding, 5.001 SOL reserve, default proposed + 0.1 SOL ceiling, and an approvalId bound to the non-balance state and ceiling.
Do not repeat the planner or show-bond serially when this result succeeds. Use extra read-only commands only to diagnose a failed or ambiguous preflight.
If no mutation is proposed, report the result and stop. Otherwise present the JSON result concisely, including UTC and local check time, all accounts and signer paths, vote and identity actions, proposed funding, approval ceiling, and the warning that vote withdrawal can succeed even if later funding fails. Ask for explicit approval of that exact approvalId and ceiling, then stop and wait. Never continue to Phase 2 in the same turn without the operator's confirmation.
Phase 2: execute after confirmation
Only after explicit confirmation, run the same local command with the approved values:
bun src/skills/marinade-bond-sweep/scripts/execute.ts \
--vote-account "$VOTE_ACCOUNT" \
--identity "$IDENTITY_ACCOUNT" \
--identity-keypair "$IDENTITY_KEYPAIR" \
--withdrawer-keypair "$VOTE_WITHDRAWER_KEYPAIR" \
--fee-payer-keypair "$FEE_PAYER_KEYPAIR" \
--execute \
--operator-approved \
--approval-id "$APPROVAL_ID" \
--approved-ceiling-lamports "$APPROVED_CEILING_LAMPORTS"The executor re-runs one parallelized finalized preflight and refuses to sign unless the approval fingerprint, accounts, signer roles, bond, action path, withdrawal state, and ceiling still match. It then performs the approved workflow as one state machine:
- withdraw eligible vote surplus and verify the finalized vote balance equals its rent reserve;
- accept identity balance drift, recalculate the funding amount, and continue without another approval only while the amount stays within the approved ceiling and preserves the original contribution policy;
- re-check the bond has no withdrawal request;
- simulate the exact recalculated funding transaction;
- re-read the identity and require the same amount to leave at least the
5 SOLhard floor; - submit that exact amount at finalized commitment;
- resolve the funding signature from Helius and verify the
FundBondtransaction, funded stake account, final identity floor, vote rent reserve, bond ownership increase, and withdrawal state.
Do not replace this flow with manual commands after a successful Phase 1. Do not use solana confirm -v, because it prints the configured RPC URL; use the executor's redacted RPC verification.
Balance-only drift below the approved ceiling does not require a second approval. Stop and obtain a new read-only plan and explicit approval if the approval fingerprint changes, the action path changes before execution, funding exceeds the ceiling, a signer or account changes, a withdrawal request appears, simulation fails, or the identity hard floor would be violated.
Report and record
Report the executor's UTC and local completion time, before/after balances in lamports and SOL, skipped actions, bond change, funded stake account, and both transaction signatures. Use its final JSON rather than making duplicate RPC calls. If a durable Markdown operation record exists for that validator, update it from this result while preserving created and setting last_updated in frontmatter.
Failure handling
- If vote withdrawal succeeds but funding fails, stop. Report that the surplus is now in the identity and include the finalized balances and vote-withdrawal signature. Never retry or improvise without a fresh plan and approval.
- If RPC submission returns an ambiguous error, resolve the transaction signature and finalized status before considering any retry.
- If balance drift would exceed the approved funding ceiling or consume the execution buffer and put the identity below the hard floor, stop and request a fresh approval; do not improvise another amount automatically.
- If the final identity is below the
5 SOLhard floor, report it as a safety failure immediately and do not perform another debit.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

