DEV Community

Mandie Brugman
Mandie Brugman

Posted on

How to Move Protocol Revenue to a Payroll Chain

If payroll is due in 48 hours, first find out whether the revenue transfer is still moving or has failed. Then check how much the payroll wallet must receive, allow for fees and price changes, and move only the amount needed for that payment.

Work out the amount payroll must receive

Start with the payroll amount in the asset and chain your payment process actually uses. A token with the same name on another chain may be a different asset, so check both the token and network with your payroll provider.

Say 18 contributors are each owed $1,000 in USDC on Arbitrum. The target is $18,000 of USDC on Arbitrum, even if protocol revenue arrived as ETH on Ethereum or BTC. If you need a buffer, calculate it separately: a 2% example buffer adds $360, for a $18,360 target.

Estimate the amount to send by adding likely costs to that target. A cross-chain swap can involve a source-chain network fee, a swap cost from price impact or slippage, and a destination-chain fee. Price impact means a trade changes the market price; slippage is the difference between the expected and final rate. For a simple estimate, if costs may total $90, plan to convert about $18,450 to cover the $18,360 target. Treat that as an example, not a quote.

If the transfer spans chains and also needs a currency swap, thor swap can move and exchange assets across chains in one flow. When the main treasury question is which route to use, how thor swap routes treasury transfers covers that choice; here, the priority is diagnosing a transfer already pending or failed.

Read the transfer as separate on-chain events

A cross-chain swap usually has at least two visible events: funds leave the source chain, then the destination asset is sent on the payroll chain. The service coordinates the swap, but each chain still needs to record and confirm its own transaction.

A pending status can mean the source transaction is waiting for confirmations, the swap is queued, or the destination transaction is waiting to be broadcast or confirmed. Confirmation is a block added after a transaction; some chains require more blocks than others before funds are treated as settled. So a source-chain success does not prove payroll-chain delivery is complete.

Check the transaction hash, a public record identifier, on the source chain first. If it is confirmed, look for a destination transaction or a refund record; if the source transaction itself is unconfirmed, the swap has not completed its first step. Don’t submit the same amount again until you know whether the original funds arrived, were refunded, or remain in progress.

Take the next step based on what failed

Use the record for the chain where the problem occurred, and keep enough native coin for network fees if you need to act again. A native coin is the chain’s own token used to pay transaction costs.

  1. Copy the source transaction hash and confirm whether it succeeded on its own chain.
  2. If it is still unconfirmed, wait for the chain’s required confirmations; resubmitting may spend twice if the first transaction later lands.
  3. If the source succeeded, check for a destination transaction, a refund, or a delay before treating the money as lost.
  4. If the transfer failed and the input was returned, verify the returned amount and token on the source chain before planning a new transfer.
  5. Recheck the payroll chain, token contract, recipient address, and net amount before sending again.

For example, if the payroll wallet needs $18,360 and the first attempt returned $18,310 after costs, the shortfall is $50. Recalculate from the amount actually received rather than repeating the original estimate. If the first attempt is still unresolved, wait for its outcome before funding a second one.

For the next conversion, thor swap is useful when protocol revenue must be exchanged and delivered on a different chain as one task. I would schedule the transfer ahead of payroll, then reconcile the final destination balance against the payroll total before releasing payments.

Before acting, ask yourself: do I know where the original funds are, and will the confirmed amount on the payroll chain cover the payment?

Top comments (0)