Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

DEX Batch Distribution

БесплатноБез исполняемых скриптовНе проверен

Batch-distribute ERC-20 tokens or native currency to up to 200 recipients in one transaction through Spraay Protocol, directly or via Uniswap V4 and…

plagtechот plagtech397 установок в других каталогах

Об этом скилле

DEX Batch Distribution

Batch-distribute ERC-20 tokens or native currency to up to 200 recipients in one transaction, directly through Spraay Protocol or through a DEX hook that ties the payout to a pool.

What this does

Spraay is push-based distribution. Instead of recipients claiming rewards from a farm or merkle tree, the sender chooses recipients off-chain and delivers to all of them in one transaction. No claim step, no unclaimed dust.

This skill covers the @spraay/dex-adapters npm package (0.4.1 or later): a generic adapter for direct Spraay calls, plus adapters for DEX hook integrations.

Install

npm install @spraay/dex-adapters@^0.4.1 viem

Supported adapters

Adapter Import path Chains What it calls
Generic @spraay/dex-adapters/generic Base, BNB Chain The Spraay contract directly
Uniswap V4 @spraay/dex-adapters/uniswap-v4 Base, BNB Chain BatchDistributeHook (permissions: afterInitialize + afterDonate)
PancakeSwap Infinity @spraay/dex-adapters/pancakeswap BNB Chain, Base BatchDistributeHook (ICLHook)
SushiSwap @spraay/dex-adapters/sushiswap Base Spraay directly, for launchpad-style holder rewards. No Sushi contract is involved
Balancer v3 @spraay/dex-adapters/balancer Base BatchDistributeHook

These are SDK adapters. They are not official integrations by those DEX teams.

How it works

Each adapter wraps Spraay's on-chain batch functions (sprayToken, sprayETH, sprayEqual). The hook adapters route the batch through a hook contract so the payout is attributed on-chain to a pool. The hooks do not intercept swaps or liquidity.

  • Fee: 30 bps, charged on top of the distributed amount.
  • Recipient limit: 200 per transaction.
  • Gas: one transaction instead of one per recipient. The saving grows with batch size; very small batches can use more gas than separate transfers. Use estimateCost for real numbers.

Quick start: generic adapter (direct Spraay calls)

import { createPublicClient, createWalletClient, http, parseUnits } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { base } from 'viem/chains'
import { distribute, estimateCost } from '@spraay/dex-adapters/generic'

const account = privateKeyToAccount(process.env.SPRAAY_SENDER_PRIVATE_KEY as `0x${string}`)
const publicClient = createPublicClient({ chain: base, transport: http() })
const walletClient = createWalletClient({ account, chain: base, transport: http() })

const USDC = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' // USDC on Base
const recipients = ['0xAbc...', '0xDef...'] as const
const amounts = [parseUnits('100', 6), parseUnits('250', 6)]

// Fee breakdown, and gas figures when `account` is given
const quote = await estimateCost({
  token: USDC, recipients, amounts,
  chain: base, publicClient, account,
})

// Approves exactly amount + fee if needed, simulates, then sends
const { hash, approvalHash } = await distribute({
  token: USDC, recipients, amounts,
  chain: base, walletClient, publicClient,
})

Gas (read this before sending on Base)

On Base, the Spraay contract requires 150,000 gas to remain before each transfer. A gas limit based on the gas a call uses can revert with Insufficient gas.

  • From 0.4.1 the SDK estimates each distribution and sends it with 20% headroom. Unused gas is not charged.
  • If you build transactions yourself, use eth_estimateGas and add headroom. Do not use gas-used times a multiplier.
  • Pass gas to distribute to set the limit yourself.
  • estimateCost returns gas (minimum limit that passes), gasLimit (what the SDK would send), and gasCost (an upper bound). When the RPC supports eth_simulateV1 it also returns gasUsedEstimate and expectedGasCost, the realistic figures. On Base none of these include the L1 data fee.
  • Gas can only be estimated once the ERC-20 allowance exists.
  • BNB Chain has no such gas floor.

Partial delivery on Base

On Base, a recipient whose transfer fails is skipped, and that recipient's amount and fee are returned to the sender, normally in the same transaction. Native currency that the sender cannot receive is held for the sender to claim (claimRefund). A successful transaction does not mean every recipient was paid. After each distribution, check the receipt for RecipientFailed events (and BatchRefunded when using a hook) and report any skipped recipients.

Uniswap V4 adapter

Every hook distribution must reference a pool that was initialized with the hook, and the sender must be an operator of that hook.

Option A: your own hook and pool. You are the owner and operator.

import { zeroAddress } from 'viem'
import { base } from 'viem/chains'
import { deployHook, distribute, getPoolId } from '@spraay/dex-adapters/uniswap-v4'

// 1. Deploy once per chain. Mines a CREATE2 salt for the 0x...1010 permission flags.
const { address: hook } = await deployHook({
  chain:
Полный SKILL.md на ClawHub

Установить DEX Batch Distribution в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл DEX Batch Distribution?

Batch-distribute ERC-20 tokens or native currency to up to 200 recipients in one transaction through Spraay Protocol, directly or via Uniswap V4 and PancakeSwap hooks, using the @spraay/dex-adapters SDK.

Как установить скилл DEX Batch Distribution?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл DEX Batch Distribution запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить DEX Batch Distribution с