Skip to main content

Idle stablecoin cash sweeps

What it is

Idle stablecoin cash sweeps move stablecoins that build up in an operating wallet beyond what the business needs into a tokenized money market or liquidity fund, the onchain version of a bank’s automated cash sweep.

Treasury teams run them so receipts earn a return instead of sitting idle, and every sweep is a payment that needs approval and a record.

Tokenized funds built to take these sweeps accept subscriptions and redemptions in stablecoins, but the rule for when to sweep is one each treasury team writes for itself.

Goldsky spots a balance over your threshold and runs the task that sends the sweep for your custodian to sign, while the threshold, the approval policy and the choice of fund stay with you.

You can sweep idle stablecoin cash two ways: have a Turbo Pipelines webhook start a Compose task when a balance passes your threshold, or run a scheduled Compose task that checks balances through the Feeds API.

Who it’s for

Stablecoin payment companies, custodian banks and asset managers that hold operating cash onchain.

How idle stablecoin cash sweeps work

The diagram follows one sweep from receipts building up in an operating wallet to fund shares issued for the cash, and shows who does each step. Your setup may differ.

Goldsky, step 2: TurboSpot idle cashOver your threshold, a webhook fires
Blockchains, step 1: Cash piles upReceipts land in an operating wallet
Your business, step 4: CustodianApprove and signYour custodian signs under its policy
Goldsky, step 3: ComposeStart the sweepThe webhook starts your task
Your business, step 6: Transfer agentIssue fund sharesMinted once the fund settles the order
Goldsky, step 5: ComposeSend itSubmitted onchain once signed
  • Goldsky
  • Your provider

Ways to sweep idle stablecoin cash

A balance pipeline starts the sweep as soon as a balance crosses the threshold; the scheduled task checks at the times you set, so cash can sit over the threshold until the next run.

Best for
Sweeps that start as soon as a balance passes the threshold
Products
TurboCompose
What you run
The destination: your database, queue or bucket, or a Postgres database Goldsky hosts
What you write
Pipeline YAML and SQL; TypeScript transforms when needed
Where your data lives
In your own database or systems
How results reach you
Pushed to you
Best for
Tens of wallets, swept on a schedule from one codebase
Products
ComposeFeeds
What you run
Nothing on Goldsky cloud; single-tenant, VPC and on-premises deployments are enterprise options
What you write
TypeScript tasks
Where your data lives
Hosted by Goldsky
How results reach you
Acts onchain or calls your systems

Option 1: Sweep idle stablecoin cash with a balance pipeline and a task

A pipeline reads your operating wallet’s balance whenever cash lands and sends a webhook when it passes your threshold; the webhook starts a task that sends the sweep for your custodian to sign.

When to trigger sweeps from a balance pipeline

Cash lands in your operating wallets at all hours, and you want a sweep to start as soon as a balance passes the threshold.

What you’ll need

  • Goldsky Turbo
  • Goldsky Compose
  • A custody provider with an approval policy that can sign EIP-712 typed data and EIP-7702 authorizations, reached through a signing endpoint you host
  • A tokenized money market fund and its subscription process
  • Your sweep rules: the threshold and the working balance to keep
  1. Collect receipts in an operating wallet

    Customer payments and other receipts arrive in the wallet the business uses day to day.

    Each receipt raises the balance. Until enough blocks sit on top of a receipt, a reorg (the chain replacing its newest blocks) can still undo it.

  2. Spot cash over your threshold

    Handled by Goldsky Turbo

    Cash above what operations needs is idle, and a sweep can only start once you know it’s there.

    Each time the wallet receives, its balance is read at that block and compared with your threshold. A rule about one balance works here; a rule about how long cash has sat idle needs a schedule.

    A Turbo Pipelines transform reads the balance with _gs_eth_call at each transfer’s block and keeps only rows above your threshold, which a webhook sink then posts.

    Set up a webhook sink (opens in a new tab)
  3. Start the sweep

    Handled by Goldsky Compose

    A balance over the threshold is only a trigger; the sweep itself is code that decides how much to move.

    The task works out the amount from your rules, such as everything above a working balance, and checks it hasn’t already swept this cash. Without that check, a repeated webhook moves the cash twice.

    Compose starts your task from the webhook through an HTTP trigger, and the task can read the wallet’s balance again before it acts.

    Set up an HTTP trigger (opens in a new tab)
  4. Approve and sign the sweep

    Moving money takes a signature, and most teams keep their keys with a custodian whose policy says who can approve what.

    The sweep is signed under limits and approvers set before it runs. A sweep that skips the policy lets anyone who can change the code move the cash.

  5. Send the sweep

    Handled by Goldsky Compose

    The sweep is done when the transfer to the fund’s subscription address is confirmed on the chain.

    The transfer can be dropped, or undone by a reorg, so it’s watched until final and resent if needed, without ever sending twice.

    Goldsky Compose sends the transfer through a webhook wallet, which has your signing endpoint sign it as a UserOperation (the transaction format smart-account wallets use), plus a one-time EIP-7702 authorization the first time it sends on a chain, then waits for the confirmations you set and logs each step of the run.

    Learn about webhook wallets (opens in a new tab)
  6. Receive the fund shares

    The cash buys shares in the fund, which are issued to you once the fund settles the order.

    The fund’s tokenization platform mints the shares to your wallet. Until they arrive, the cash has left with nothing yet in its place, so treasury tracks the order as pending.

What to know about sweeping from a balance pipeline

  • Goldsky runs the pipeline and the task; your custodian signs, and the fund issues the shares.
  • The webhook fires when the balance is first seen over the threshold, before it’s final, so the task checks the balance again before sending.
  • A webhook can arrive more than once, so the task has to recognize a sweep it has already sent.
  • Rules about time, such as sweeping only at day end, belong in a scheduled task instead.

Option 2: Sweep idle stablecoin cash with a scheduled task

A task runs on a schedule, reads your operating wallets’ balances from a balances API, and sends a sweep for your custodian to sign when one is over your threshold, with every request and transaction logged.

When to sweep idle cash from a scheduled task

You have tens of wallets on chains the balances API covers, and you’d rather keep the whole sweep in one TypeScript codebase than run a pipeline and a database.

What you’ll need

  • Goldsky Compose
  • Goldsky Feeds
  • A custody provider with an approval policy that can sign EIP-712 typed data and EIP-7702 authorizations, reached through a signing endpoint you host
  • A tokenized money market fund and its subscription process
  • Your sweep rules: the threshold, the working balance and how often to check
  1. Collect receipts in an operating wallet

    Customer payments and other receipts arrive in the wallet the business uses day to day.

    Each receipt raises the balance. Until enough blocks sit on top of a receipt, a reorg (the chain replacing its newest blocks) can still undo it.

  2. Check balances on a schedule

    Handled by Goldsky Compose

    Someone has to look at the wallet regularly to notice cash building up.

    The check runs at times you set, such as hourly or at day end. Checks set far apart leave cash idle for longer.

    A Compose task with a cron trigger runs at the times you set and calls the Feeds balances endpoint for each operating wallet with fetch.

    Schedule a task with a cron trigger (opens in a new tab)
  3. Decide whether to sweep

    Handled by Goldsky Compose

    Not every balance is idle, because the business needs a working float.

    The task compares each balance with your threshold and works out how much to move. It has to know whether a sweep is already in flight, or it sends a second one for the same cash.

    The rule runs inside the Goldsky Compose task, and the run log records the balances it read and the decision it made.

    See the logs of each run (opens in a new tab)
  4. Approve and sign the sweep

    Moving money takes a signature, and most teams keep their keys with a custodian whose policy says who can approve what.

    The sweep is signed under limits and approvers set before it runs. A sweep that skips the policy lets anyone who can change the code move the cash.

  5. Send the sweep

    Handled by Goldsky Compose

    The sweep is done when the transfer to the fund’s subscription address is confirmed on the chain.

    The transfer can be dropped, or undone by a reorg, so it’s watched until final and resent if needed, without ever sending twice.

    Compose sends the transfer through a webhook wallet, which has your signing endpoint sign it as a UserOperation (the transaction format smart-account wallets use), plus a one-time EIP-7702 authorization on a chain it hasn’t sent on before. It waits for the confirmations you set and resends the transfer if a reorg drops it.

    Handle confirmations and reorgs (opens in a new tab)
  6. Receive the fund shares

    The cash buys shares in the fund, which are issued to you once the fund settles the order.

    The fund’s tokenization platform mints the shares to your wallet. Until they arrive, the cash has left with nothing yet in its place, so treasury tracks the order as pending.

What to know about sweeping idle cash on a schedule

  • The task checks on your schedule, so cash can sit over the threshold until the next run.
  • Rules about time, such as sweeping once at day end, fit well, because the schedule decides when the check runs.
  • Balances come from the API, so wallets on chains it doesn’t cover need another way.
  • Every request and transaction the task makes is logged on its run.

What you control

Your providers
  • Custodian
  • Transfer agent

Security and deployment

  • SOC 2 Type IIIndependently audited security controls.
  • Dedicated infrastructureSingle-tenant options for production workloads.
  • Data residencyCloud, on-premises or co-located.

Sweep idle stablecoin cash with Goldsky

We’ll map it to your systems and show you what Goldsky runs, so your team builds the product, not the pipelines underneath it.

© Endless Sky Inc. All rights reserved.

PrivacyTermsSecurity

System status