Buy from an OTC tier
dexe_otc_buyer_buyBuys tokens from an OTC TokenSaleProposal tier by preflighting balance and allowance, adding ERC20 approval when needed, and building or broadcasting the buy call.
Instructions
Broadcasts when a signer is configured. Preflights balance + allowance, adds an ERC20 approve when needed, then builds TokenSaleProposal.buy(tierId, paymentToken, amount, proof). Native path (0x000...000) skips approve and sets value; whitelistUsers generates the proof.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tokenSaleProposal": "<tokenSaleProposal>",
"tierId": "<tierId>",
"tokenToBuyWith": "<tokenToBuyWith>",
"amount": "<amount>"
},
"name": "dexe_otc_buyer_buy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | No | Buyer address; defaults to the configured signer. | |
| proof | No | Merkle proof for a gated tier; [] when not gated. | |
| amount | Yes | Amount to spend: human units ('100.5'), or digits-only = 18-decimal-normalized. | |
| dryRun | No | If true, return ordered TxPayloads even when a signer is loaded. | |
| tierId | Yes | Tier to buy from, decimal string. | |
| chainId | No | Target chain id. Defaults to the MCP's default chain. | |
| signerKey | No | Keyring signer: omit = primary key; 'agent<n>' or address = a DEXE_AGENT_PK_* key. | |
| simulateFirst | No | eth_call-simulate buy() first; aborts with the revertReason if the sim fails. | |
| tokenToBuyWith | Yes | Payment token; native BNB = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE (0x0 is an alias). | |
| whitelistUsers | No | Optional whitelist for proof gen | |
| tokenSaleProposal | Yes | TokenSaleProposal helper address |