Liquidation Bots
Fund Bot
Build a native coin transfer that tops up a liquidation bot float
POST
/
lending-external-securities-v2
/
api
/
liquidation-bots
/
{botId}
/
fund
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"}'
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();
{
"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"
}
}
{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_ERROR",
"message": "amount must be greater than zero"
}
}
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.
Unlike the other writes on this surface, the transaction’s
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.
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
string
required
Bot ID.
Body Parameters
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.Response Fields
object
Show child attributes
Show child attributes
string
SIGN_TRANSACTION.object
to is the bot, data is "0x", value is the amount in wei, plus chainId.string
fund. A label: the transaction calls no function.object
{ "endpoint": "confirm-tx", "txHash": true }. See Confirm Bot Transaction.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"}'
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();
{
"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"
}
}
{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_ERROR",
"message": "amount must be greater than zero"
}
}
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 |
⌘I
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"}'
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();
{
"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"
}
}
{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_ERROR",
"message": "amount must be greater than zero"
}
}
