Liquidation Bots
Confirm Bot Deployment
Record a liquidation bot from its mined deployment transaction
POST
/
lending-external-securities-v2
/
api
/
liquidation-bots
/
confirm-deploy
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/liquidation-bots/confirm-deploy" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"txHash": "0x1a2531f9e02d8b3660364d25a982585f822fbe8689e811e7b967cbd1d670ba7b",
"label": "Primary keeper"
}'
const res = await fetch(
'https://api.trusset.org/lending-external-securities-v2/api/liquidation-bots/confirm-deploy',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ txHash: tx.hash, label: 'Primary keeper' })
}
);
const { data } = await res.json();
const botId = data.bot.id;
{
"success": true,
"data": {
"success": true,
"bot": {
"id": "clx_bot_001",
"instanceId": "inst_abc123",
"botAddress": "0xc40dea7387a290e7ce71784a65ae0ed6bb1ae555",
"ownerWallet": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"label": "Primary keeper",
"archived": false,
"deployTxHash": "0x1a2531f9e02d8b3660364d25a982585f822fbe8689e811e7b967cbd1d670ba7b",
"createdAt": "2026-09-20T10:00:00.000Z",
"updatedAt": "2026-09-20T10:00:00.000Z"
},
"txHash": "0x1a2531f9e02d8b3660364d25a982585f822fbe8689e811e7b967cbd1d670ba7b"
},
"error": null,
"metadata": {
"timestamp": "2026-09-20T10:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
{
"success": false,
"data": null,
"error": {
"code": "TX_NOT_FOUND",
"message": "Transaction not found or not yet mined"
}
}
{
"success": false,
"data": null,
"error": {
"code": "TX_NOT_VERIFIED",
"message": "The transaction did not deploy a liquidation bot on the factory"
}
}
Records a bot from its mined deployment. The API reads the receipt and checks that the transaction succeeded and called
deployShim on this network’s bot factory. It takes the bot’s address and owner from the factory’s ShimDeployed event, never from the request.
Confirm each deployment once. The call does not look for an existing record, so confirming the same hash again records a second bot for the same contract. It also accepts any successful
deployShim call on the factory, whichever wallet sent it. The recorded ownerWallet is the wallet that sent it, and only that wallet can sign the bot’s owner actions. Trusset holds no key to it.Body Parameters
string
required
Hash of the mined deployment transaction built by Deploy Liquidation Bot.
string
Display label, at most 64 characters. Surrounding whitespace is trimmed, and an empty label is stored as
null. Change it later with Update Bot.Response Fields
object
Show child attributes
Show child attributes
boolean
Always
true.object
The new record. On-chain state is not included; read it with Get Liquidation Bot.
Show child attributes
Show child attributes
string
Bot ID, used in every other bot path.
string
Your instance.
string
The bot contract’s address, from
ShimDeployed.string
The wallet that deployed the bot, from
ShimDeployed.string | null
Display label.
boolean
false.string
The confirmed hash.
string
When the record was written.
string
Same as
createdAt on a new record.string
The confirmed hash.
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/liquidation-bots/confirm-deploy" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"txHash": "0x1a2531f9e02d8b3660364d25a982585f822fbe8689e811e7b967cbd1d670ba7b",
"label": "Primary keeper"
}'
const res = await fetch(
'https://api.trusset.org/lending-external-securities-v2/api/liquidation-bots/confirm-deploy',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ txHash: tx.hash, label: 'Primary keeper' })
}
);
const { data } = await res.json();
const botId = data.bot.id;
{
"success": true,
"data": {
"success": true,
"bot": {
"id": "clx_bot_001",
"instanceId": "inst_abc123",
"botAddress": "0xc40dea7387a290e7ce71784a65ae0ed6bb1ae555",
"ownerWallet": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"label": "Primary keeper",
"archived": false,
"deployTxHash": "0x1a2531f9e02d8b3660364d25a982585f822fbe8689e811e7b967cbd1d670ba7b",
"createdAt": "2026-09-20T10:00:00.000Z",
"updatedAt": "2026-09-20T10:00:00.000Z"
},
"txHash": "0x1a2531f9e02d8b3660364d25a982585f822fbe8689e811e7b967cbd1d670ba7b"
},
"error": null,
"metadata": {
"timestamp": "2026-09-20T10:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
{
"success": false,
"data": null,
"error": {
"code": "TX_NOT_FOUND",
"message": "Transaction not found or not yet mined"
}
}
{
"success": false,
"data": null,
"error": {
"code": "TX_NOT_VERIFIED",
"message": "The transaction did not deploy a liquidation bot on the factory"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
VALIDATION_ERROR | 400 | txHash is not a 0x-prefixed 64-hex hash, or label is longer than 64 characters |
TX_REVERTED | 400 | The transaction was mined but reverted |
TX_WRONG_TARGET | 400 | The transaction was not sent to this network’s bot factory |
TX_WRONG_FUNCTION | 400 | The transaction does not call deployShim |
TX_NOT_VERIFIED | 400 | The receipt carries no ShimDeployed event from the factory |
TX_NOT_FOUND | 404 | No receipt yet. The transaction is unmined, dropped, or on another network |
SHIM_NOT_CONFIGURED | 503 | No liquidation bot factory is configured for the instance’s network |
BOT_DEPLOY_CONFIRM_FAILED | 500 | An unexpected failure, such as the chain or the database not answering. The message is generic; retry |
⌘I
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/liquidation-bots/confirm-deploy" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"txHash": "0x1a2531f9e02d8b3660364d25a982585f822fbe8689e811e7b967cbd1d670ba7b",
"label": "Primary keeper"
}'
const res = await fetch(
'https://api.trusset.org/lending-external-securities-v2/api/liquidation-bots/confirm-deploy',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ txHash: tx.hash, label: 'Primary keeper' })
}
);
const { data } = await res.json();
const botId = data.bot.id;
{
"success": true,
"data": {
"success": true,
"bot": {
"id": "clx_bot_001",
"instanceId": "inst_abc123",
"botAddress": "0xc40dea7387a290e7ce71784a65ae0ed6bb1ae555",
"ownerWallet": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"label": "Primary keeper",
"archived": false,
"deployTxHash": "0x1a2531f9e02d8b3660364d25a982585f822fbe8689e811e7b967cbd1d670ba7b",
"createdAt": "2026-09-20T10:00:00.000Z",
"updatedAt": "2026-09-20T10:00:00.000Z"
},
"txHash": "0x1a2531f9e02d8b3660364d25a982585f822fbe8689e811e7b967cbd1d670ba7b"
},
"error": null,
"metadata": {
"timestamp": "2026-09-20T10:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "inst_abc123"
}
}
{
"success": false,
"data": null,
"error": {
"code": "TX_NOT_FOUND",
"message": "Transaction not found or not yet mined"
}
}
{
"success": false,
"data": null,
"error": {
"code": "TX_NOT_VERIFIED",
"message": "The transaction did not deploy a liquidation bot on the factory"
}
}
