POST /v1/wallet/intent

This endpoint allows you to create a new non-custodial wallet intent for token sniping using a custodial bot, specifying conditions and parameters under which the intent will execute during a token launch.


Signature

The signaturefield in the body is the signature of EIP712 message with the following data structure:

export const types = {
  BuyIntent: [
    { name: "token", type: "address" },
    { name: "amount", type: "uint256" },
    { name: "bribe", type: "uint256" },
    { name: "expiry", type: "uint256" },
    { name: "minIn", type: "uint256" },
  ],
};

export const domain = {
  name: "OPL",
  version: "1",
  chainId: <>, // use the right chain id
  verifyingContract: "0x", // use the right router address for the chain
};

Contract addresses can be found here.

Example signing EIP712 messages with Typescript and Viem
const sniperAccount = privateKeyToAccount(
   "0x..."
 );
 
const signature = await sniperAccount.signTypedData({
  types,
  domain,
  primaryType: "BuyIntent",
  message: {
    token: "0x...", // token address
    amount: parseEther(1), // 1 ETH amount to buy
    bribe: parseEther(2), // 2 ETH block builder bribe
    expiry: BigInt(1000000000000000000000),
    minIn: 0,
  },
});

Request

Endpoint

POST https://snipe.merkle.io/v1/wallet/intent

Body

{
  // Required fields
  "chainId": 1,
  "wallet": "<wallet address>", // must be the wallet used to sign the message
  "tokenAddress": "<token address>",
  "bribe": "<bribe amount in wei>",
  "signature": "0x...", // see above
  "buyAmount": "<buy amount in wei>",
  "expiry": 2800998888, // expiry timestamp in seconds

  // Optional fields
  "maxBuyTax": 0.2, // between 0 and 1
  "maxSellTax": 0.2, // between 0 and 1
  "minIn": "<min in amount in wei>",
  "minOut": "<min out amount in token units>",
  "minLiquidity": "<min liquidity in cents>",
  "feeBps": 100, // 1% fee on the buy amount
  "feeRecipient": "<fee recipient address>",
  "firstOrFail": true, // or false
  "maxSlippageBps": 1000, // 10%
  "gasTip": "1000000000" // in wei (e.g., 1 gwei)
}
Field
Type
Required
Description

chainId

number

Yes

Blockchain network ID (e.g., 1 for Ethereum).

wallet

string

Yes

Wallet address to use for the transaction.

tokenAddress

string

Yes

Address of the token to be purchased.

bribe

string

Yes

Bribe amount in wei for miners or block builders.

signature

string

Yes

EIP712 signature for the intent.

buyAmount

string

Yes

Amount to purchase in wei.

expiry

number

Yes

Expiry timestamp for the intent (UNIX format in seconds).

notificationWebhookUrl

string

No (but recommended)

Notification webhook url for this intent.

maxBuyTax

number

No

Maximum acceptable buy tax (0 to 1).

maxSellTax

number

No

Maximum acceptable sell tax (0 to 1).

minIn

string

No

Minimum input amount in wei.

minOut

string

No

Minimum output amount in token units.

minLiquidity

string

No

Minimum liquidity in cents (e.g., 10000 for $100).

feeBps

number

No

Fee in basis points (e.g., 100 for 1%).

feeRecipient

string

No

Address to receive the fee.

firstOrFail

boolean

No

Whether the intent should only be included in the first bundle.

maxSlippageBps

number

No

Maximum slippage in basis points (e.g., 1000 for 10%).

gasTip

string

No

Gas tip in wei (e.g., 1000000000 for 1 gwei).


Response

{
    id: "<uuid>",
    status: "pending" | "completed" | "expired" | "cancelled" | "error";
    error: "balance_too_low",
			 | "allowance_too_low",
			 | "balance_fetch_error",
			 | "allowance_fetch_error",
			 | "not_included_in_bundle",
			 | "unknown"
			 | null,
    txHash: null,
    tokenAddress: "0x...",
    wallet: "0x...",
    chainId: 1,
    bribe: "100000000000", // in wei
    buyAmount: "100000000000", // in wei
    maxBuyTax: 0.5,
    maxSellTax: 0.5,
    maxSlippageBps: 1000,
    minBuy: "1000000", // in wei
    minOut: "1000000", // in wei
    createdAtMs: 99999999, // in milliseconds 
    gasTip: 1000000000,
    token: {
	    chainId: 1,
	    address: "0x...",
	    deployer: "0x...",
	    deployerHash: "0x...",
	    deployerBlocknumber: 190000000,
	    deployerTimestamp: 99999999, // in seconds
	    launchedAtBlocknumber: null,
	    launchBuyTax: null,
	    launchStatus: "not_launched",
	    launchLiquidity: null,
	    launchProcessingTime: null,
	    launchSellTax: null,
	    launchedAtTxHash: null,
	    totalSupply: "9999999999999",
	    name: "Token name",
	    iconUrl: "",
	    symbol: "TKN",
	    decimals: 9,
	    launchedAtMs: null,
    }
}

Last updated