Skip to main content
POST
Builds the transactions that connect a bot to one of the instance’s markets, or disconnect it. A connection has two halves held by two parties, so the answer can hold two steps for two different signers. The API reads both halves first and returns only the ones not already in the requested state. Trusset holds no key and signs neither step. The bot step comes first in both directions. The two are independent transactions, so neither has to be mined before the other. Either half alone stops the bot acting on a market, and the bot step is the one the owner can take without the market admin. A market still seeking a lender of record has no market admin, so its market step cannot succeed. This call does not check for that. A lender of record can instead grant the role while taking it, by naming the bot as liquidator on Accept Lender Role. Set Liquidator Role grants it too.

Path Parameters

string
required
Bot ID.

Body Parameters

string
required
ID of one of your instance’s markets, 1 to 100 characters. The market must have an on-chain address.
boolean
required
true to connect, false to disconnect.

Response Fields

When both halves already match the request, data is { success: true, alreadyInState: true, connected, marketId } and there is nothing to sign. Otherwise:
object
Confirming a step is optional. The connection is read from the chain every time, and confirming only clears the cached read so Get Liquidation Bot shows the change at once.

Error Codes