agentleFS
ahmetenesdurahmetenesdur/starkfi/skills/batch/SKILL.md

batch

Skill2 starsChanged 8 months agoMITView on GitHub

Execute multiple different DeFi operations in a single Starknet transaction — combine swaps, staking, lending supply/borrow/repay/withdraw, token sends, DCA orders, and Troves vault deposits/withdrawals into one multicall. Use this skill when the user wants to batch, combine, bundle, or chain multiple diverse operations together in one atomic transaction, such as "swap ETH and then stake STRK" or "withdraw from lending and swap" or "repay debt and stake" or "swap and send in one go" or "create a DCA order and stake" or "deposit into vault and swap". Also trigger when the user mentions multicall, combining operations, doing multiple things at once, or wants to save gas by bundling actions — even if they don't use the word "batch".

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use loop, simplify and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • HeshamFSSkill

    loop

    Run a command or check on a recurring interval

    Also in 5 projects that use this

  • Hugging FaceSkill

    simplify

    Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.

    Also in 4 projects that use this

  • Microsoft AzureSkill

    verify

    End-to-end app testing pipeline for browser-based web apps on cloud browsers via Azure Playwright Workspaces: verify the live app, author tests for working flows, heal failing tests, then re-run with video and produce one consolidated report. Three phases (app verification, test authoring, test healing) plus a scoped final sanity run; each phase emits a sub-report. Use when asked to "verify my app", "make sure my app works and has good test coverage", "do a full QA pass", "add tests where I'm missing coverage", "fix failing tests and add new ones", "smoke test before deploy", "QA my deployment", or any combined verify-and-test ask. Requires Azure CLI (`az login`) and a Playwright Workspace resource ID — bootstraps configs on first invocation. Browser-based web apps with Playwright only — not for unit/API tests, native mobile/desktop, load/perf, or full accessibility audits.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 1 is distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    BEFORE any batch, you MUST run npx starkfi@latest status and npx starkfi@latest balance to verify connectivity and funds.

    line 30
  2. Very specific:

    If the batch includes a --send operation, you MUST confirm the recipient address with the user before executing.

    line 33
  3. Very specific:

    AFTER a successful batch, verify with npx starkfi@latest tx-status <hash>.

    line 35
  4. Distinctive:

    All operations in a batch are atomic — if any one fails, the entire transaction reverts.

    line 36
  5. Very specific:

    Use trade for a single swap.

    line 154
  6. Very specific:

    Use staking for standalone staking operations.

    line 155
  7. Very specific:

    Use lending for standalone lending operations.

    line 156
  8. Very specific:

    Use send for standalone token transfers.

    line 157
  9. Very specific:

    Use dca for standalone DCA order management.

    line 158
  10. Very specific:

    Use troves for standalone vault deposit/withdraw operations.

    line 159
  11. Very specific:

    Use lst for liquid staking operations (not supported in batch).

    line 160

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Batch Execute

Bundle multiple diverse DeFi operations into a single Starknet multicall transaction. Supports combining swaps, staking, lending supply/borrow/repay/withdraw, token sends, DCA orders, and Troves vault deposits/withdrawals — all executed atomically in one on-chain call.

Prerequisites

  • Active session required.
  • Sufficient balance for all operations + gas fees.
  • Minimum 2 operations required per batch.

Rules

  1. BEFORE any batch, you MUST run npx starkfi@latest status and npx starkfi@latest balance to verify connectivity and funds.
  2. A batch MUST include at least 2 operations. For single operations, use the dedicated skill (trade, send, staking, lending, or dca).
  3. Each --swap, --stake, --supply, --send, --dca-create, and --dca-cancel flag can appear multiple times (repeatable).
  4. If the batch includes a --send operation, you MUST confirm the recipient address with the user before executing.
  5. Suggest using --simulate first to verify the entire batch would succeed.
  6. AFTER a successful batch, verify with npx starkfi@latest tx-status <hash>.
  7. All operations in a batch are atomic — if any one fails, the entire transaction reverts.

Commands

npx starkfi@latest batch [--simulate] [--json] \
  --swap "<amount> <from> <to>" \
  --stake "<amount> <token> <validator_or_pool>" \
  --supply "<amount> <token> <pool>" \
  --send "<amount> <token> <recipient>" \
  --borrow "<col_amt> <col_token> <bor_amt> <bor_token> <pool>" \
  --repay "<amount> <token> <col_token> <pool>" \
  --withdraw "<amount> <token> <pool>" \
  --dca-create "<amount> <sell> <buy> <perCycle> [frequency]" \
  --dca-cancel "<orderId>" \
  --troves-deposit "<amount> <token> <strategyId> [amount2 token2]" \
  --troves-withdraw "<amount> <token> <strategyId> [amount2 token2]"

Operation Formats

FlagFormatExample
--swap"<amount> <from> <to>"--swap "100 USDC ETH"
--stake"<amount> <token> <validator_or_0xPool>"--stake "500 STRK Karnot"
--supply"<amount> <token> <pool>"--supply "100 USDC Prime"
--send"<amount> <token> <0xRecipient>"--send "10 STRK 0x07b2..."
--borrow"<col_amt> <col_token> <bor_amt> <bor_token> <pool>"--borrow "0.5 ETH 500 USDC Prime"
--repay"<amount> <token> <col_token> <pool>"--repay "100 USDC ETH Prime"
--withdraw"<amount> <token> <pool>"--withdraw "200 USDC Prime"
--dca-create"<amount> <sell> <buy> <perCycle> [freq]"--dca-create "1000 USDC ETH 10 P1D"
--dca-cancel"<orderId>"--dca-cancel "abc123"
--troves-deposit"<amount> <token> <strategyId> [amount2 token2]"--troves-deposit "100 STRK evergreen_strk" or "100 STRK ekubo_cl_strketh 0.005 ETH"
--troves-withdraw"<amount> <token> <strategyId> [amount2 token2]"--troves-withdraw "50 STRK evergreen_strk" or "50 STRK ekubo_cl_strketh 0.005 ETH"

Note: --stake accepts either a validator name (e.g. Karnot) or a pool contract address (starting with 0x). The CLI auto-detects the format.

Parameters

ParameterTypeDescriptionRequired
--swapstringSwap operation (repeatable)No*
--stakestringStake operation (repeatable)No*
--supplystringLending supply operation (repeatable)No*
--sendstringToken transfer operation (repeatable)No*
--borrowstringBorrow from lending pool (repeatable)No*
--repaystringRepay lending debt (repeatable)No*
--withdrawstringWithdraw from lending pool (repeatable)No*
--dca-createstringCreate DCA order (repeatable)No*
--dca-cancelstringCancel DCA order (repeatable)No*
--troves-depositstringTroves vault deposit (repeatable)No*
--troves-withdrawstringTroves vault withdraw (repeatable)No*
--simulateflagEstimate fees without broadcastingNo
--jsonflagOutput as JSONNo

*At least 2 operations (of any type) are required.

Examples

User: "Swap 100 USDC to ETH and stake 500 STRK with Karnot in one transaction"

npx starkfi@latest status
npx starkfi@latest balance
npx starkfi@latest batch --swap "100 USDC ETH" --stake "500 STRK Karnot"
npx starkfi@latest tx-status <hash>

User: "Withdraw my USDC from Prime lending and swap it to ETH"

npx starkfi@latest status
npx starkfi@latest balance
npx starkfi@latest batch --withdraw "200 USDC Prime" --swap "200 USDC ETH"
npx starkfi@latest tx-status <hash>

User: "Repay my USDC debt on Prime and stake STRK"

npx starkfi@latest status
npx starkfi@latest balance
npx starkfi@latest batch --repay "100 USDC ETH Prime" --stake "50 STRK karnot"
npx starkfi@latest tx-status <hash>

User: "Borrow USDC using ETH as collateral and swap half to STRK"

npx starkfi@latest status
npx starkfi@latest balance
npx starkfi@latest batch \
  --borrow "0.5 ETH 500 USDC Prime" \
  --swap "250 USDC STRK"
npx starkfi@latest tx-status <hash>

User: "Simulate a batch of two swaps and a stake"

npx starkfi@latest batch --simulate \
  --swap "100 USDC ETH" \
  --swap "200 USDT STRK" \
  --stake "500 STRK Karnot"

Error Handling

ErrorAction
Too few operationsAt least 2 operations required. Use dedicated skills instead.
Insufficient balanceCheck balance for all required tokens.
Invalid validator/poolRun validators/pools to find valid names/addresses.
Simulation failedOne of the operations would revert. Check each individually.
Not authenticatedRun authenticate-wallet skill first.

Related Skills

  • Use trade for a single swap.
  • Use staking for standalone staking operations.
  • Use lending for standalone lending operations.
  • Use send for standalone token transfers.
  • Use dca for standalone DCA order management.
  • Use troves for standalone vault deposit/withdraw operations.
  • Use lst for liquid staking operations (not supported in batch).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.