> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Fund Bot

> Build a native coin transfer that tops up a liquidation bot float

Builds a plain transfer of the network's native coin, such as ETH on Ethereum, to the bot. That float pays the gas refunds of callers who trigger liquidations through the bot. Any wallet can send it.

<Warning>
  Coin sent to a bot leaves it in only two ways: as refunds to callers, within the refund policy, and through the owner's withdrawal. Only the owner wallet can withdraw. If that wallet is lost, the float is stranded, because the factory keeps no role on the bot and Trusset holds no key to it.
</Warning>

Unlike the other writes on this surface, the transaction's `value` is not zero. It carries the amount in wei, and `data` is empty, so the transfer lands in the bot's `receive` function, which emits `Funded`. Send `value` exactly as returned.

## Path Parameters

<ParamField path="botId" type="string" required>Bot ID.</ParamField>

## Body Parameters

<ParamField body="amount" type="string" required>
  Amount in whole units of the native coin, as a decimal string such as `"0.25"`. At most 18 decimal places, and greater than zero.
</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="action" type="string">`SIGN_TRANSACTION`.</ResponseField>
    <ResponseField name="transaction" type="object">`to` is the bot, `data` is `"0x"`, `value` is the amount in wei, plus `chainId`.</ResponseField>
    <ResponseField name="functionName" type="string">`fund`. A label: the transaction calls no function.</ResponseField>
    <ResponseField name="confirmWith" type="object">`{ "endpoint": "confirm-tx", "txHash": true }`. See [Confirm Bot Transaction](/endpoints/lending/confirm-bot-transaction).</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/liquidation-bots/{botId}/fund" \
    -H "X-API-Key: trusset_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{"amount": "0.25"}'
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/lending-external-securities-v2/api/liquidation-bots/${botId}/fund`,
    {
      method: 'POST',
      headers: {
        'X-API-Key': 'trusset_your_key_here',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ amount: '0.25' })
    }
  );
  const { data } = await res.json();

  const tx = await wallet.sendTransaction(data.transaction);
  await tx.wait();
  ```
</RequestExample>

<ResponseExample>
  ```json Calldata Response theme={null}
  {
    "success": true,
    "data": {
      "action": "SIGN_TRANSACTION",
      "transaction": {
        "to": "0xc40dea7387a290e7ce71784a65ae0ed6bb1ae555",
        "data": "0x",
        "value": "250000000000000000",
        "chainId": 11155111
      },
      "functionName": "fund",
      "confirmWith": { "endpoint": "confirm-tx", "txHash": true }
    },
    "error": null,
    "metadata": {
      "timestamp": "2026-09-20T10:05:00.000Z",
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "instanceId": "inst_abc123"
    }
  }
  ```

  ```json Error - Zero Amount theme={null}
  {
    "success": false,
    "data": null,
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "amount must be greater than zero"
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code               | HTTP  | Cause                                                                         |
| ------------------ | ----- | ----------------------------------------------------------------------------- |
| `VALIDATION_ERROR` | `400` | `amount` is not a decimal string, has more than 18 decimal places, or is zero |
| `BOT_NOT_FOUND`    | `404` | No bot with this ID belongs to your instance                                  |
| `BOT_NOT_DEPLOYED` | `409` | The bot record has no contract address                                        |
| `BOT_FUND_FAILED`  | `500` | An unexpected failure. The message is generic; retry                          |
