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. The API reads who holds each half before it answers. Every step names the wallet that must sign it as requiredSigner. For the bot step that is the bot’s owner as the chain reports it. For the market step it is a wallet known to the instance that holds DEFAULT_ADMIN_ROLE on the market. Send signerAddress to get only the steps that wallet can sign. The steps another wallet must sign then come back under pending, and partial is true. One wallet therefore never signs a half connection without being told who finishes it. A wallet that can sign none of the steps is refused. 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, and its requiredSigner reads null. 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.
string
The wallet that will sign, 0x followed by 40 hex characters. With it, steps holds only what this wallet can sign: the bot step when it owns the bot, the market step when it holds DEFAULT_ADMIN_ROLE on the market. Without it, steps holds every step, each for the wallet its requiredSigner names.

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