Pledges
List Pledges
Every pledge a market has recorded against its collateral token
GET
Returns every pledge the market’s collateral adapter has recorded against the collateral token, oldest first. Each record carries the holder, the pledgee, the amount, the transaction that created the lock, and how the pledge ended if it has.
The records are rebuilt from the adapter’s own events, so the response describes the chain rather than a Trusset ledger. Reading this endpoint advances the scan, which is why a first call on a market with long history can return a partial list.
What
index says how far the scan has reached.
This endpoint takes the market’s contract address. Every other endpoint on the lending surface takes the market ID.
Path Parameters
string
required
The market contract address, as 40 hex characters with a
0x prefix. Available as marketAddress on List Markets.Query Parameters
integer
default:"0"
Records to skip. Minimum
0.integer
default:"50"
Records to return. Between
1 and 200.string
default:"true"
Accepts
true or false. Set it to false to return only pledges that have not ended. Any other value is a validation error. total follows the same filter.Response Fields
object
Change kinds
A split is bookkeeping inside the adapter, used to isolate collateral going to auction from the rest of the loan. Both sides carry the same holder and the same pledgee.
How a pledge ends
endedAt.kind is RELEASED when the loan closed and the collateral went back to the holder. The restriction is gone and the register entry can come off.
It is ENFORCED when the last of the collateral was seized in a liquidation. endedAt.to is where it went. A partial seizure is not an ending: it lands in changes and the pledge keeps standing for the remainder.
Tie a pledge to a loan
ref is derived from the market, the loan ID and a counter, and no endpoint maps it back to a loan. Join on lockedAt.txHash against List Transactions, which records the same hash for the loan that created the lock. holder is the borrower.
Reading the index
The scan reads at most 200,000 blocks per request and stops three blocks behind the head, so a market with long history takes several calls to catch up. It is throttled to once a minute per market. A call inside that minute returns the stored records withsynced: false and reason of THROTTLED, which is a normal answer rather than a failure.
Records already in the index are returned in all six cases.
What complete: false actually means
complete is synced, and no truncated history, and no unparsed logs. The last of those three is the one to read carefully.
The index models six adapter events: Locked, Increased, Decreased, Released, Enforced and RefSplit. Those are the pledge’s whole life. The adapters also emit events that have nothing to do with a pledge: a freeze adapter emits FreezeShortfall when it could not freeze the full amount asked for, and a custody adapter emits CollateralEscrowed and EscrowedCollateralClaimed when a return to the borrower was blocked on compliance and held instead. Any of those in the scanned window is counted in unparsedLogsThisScan and turns complete to false.
So read the three parts rather than the flag alone:
historyTruncatedBeforeBlockis the one that means pledges are genuinely missing, and they stay missing.scannedToBlockwell behind the chain head means the scan has not caught up. Call again.unparsedLogsThisScanon its own is informational. The pledges returned for the blocks scanned are complete.
complete: true on a market that has seen a freeze shortfall or an escrowed return means waiting for something that will not arrive.
Errors
A
403 is a statement about this instance’s access to this market. A 503 is a statement about a read that failed, and says nothing about the market or the caller.
