Dutch Auctions
List Active Auctions
List the Dutch auctions still open on a market, running or awaiting settlement
GET
/
lending-external-securities-v2
/
api
/
liquidations
/
{marketId}
/
auctions
curl "https://api.trusset.org/lending-external-securities-v2/api/liquidations/{marketId}/auctions" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/liquidations/${marketId}/auctions`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const biddable = data.auctions.filter((auction) => auction.biddable);
const toSettle = data.auctions.filter((auction) => auction.settleable);
{
"success": true,
"data": {
"auctions": [
{
"auctionId": "2",
"loanId": "5",
"borrower": "0x7d2e9B4c1A8f03e6B5D9c2A7F4e18B06c3D5a92F",
"collateralRemaining": "40.0",
"debtRemaining": "3850.5",
"currentPrice": "95.0",
"endTime": 1718438400,
"active": true,
"expired": true,
"biddable": false,
"settleable": true,
"phase": "EXPIRED"
},
{
"auctionId": "3",
"loanId": "7",
"borrower": "0x7d2e9B4c1A8f03e6B5D9c2A7F4e18B06c3D5a92F",
"collateralRemaining": "220.0",
"debtRemaining": "21159.2",
"currentPrice": "118.42",
"endTime": 1718449200,
"active": true,
"expired": false,
"biddable": true,
"settleable": false,
"phase": "RUNNING"
}
]
}
}
{
"success": false,
"error": {
"code": "NO_MARKET_ADDRESS",
"message": "No on-chain address"
}
}
Returns every auction the market’s auction venue still holds open, with its live declining price. That covers auctions that are running and auctions past their end time that nobody has settled yet. Check
phase before acting: only a RUNNING auction takes bids, and an EXPIRED one waits for Settle Expired Auction.
Auctions do not run on the market contract. They run on a per-market auction venue, which the market admin binds after adoption, and a market without one has no auctions. Liquidation opens an auction only while the market’s useDutchAuction switch is on, and that switch cannot be turned on before a venue is wired. See Get Auction Module.
Path Parameters
string
required
Response Fields
object
Show child attributes
Show child attributes
array
Show child attributes
Show child attributes
string
Auction ID on the market’s venue. Pass it to Bid on Auction or Settle Expired Auction.
string
Loan whose collateral is on sale.
string
Borrower whose collateral is on sale, in the checksummed form the chain returns.
string
Collateral still for sale, in collateral token units. Falls as bids fill.
string
Debt the auction has not yet discharged, in borrow asset units. Each fill discharges debt in proportion to the collateral it buys.
string
Price per whole collateral unit, in borrow asset units, read from the venue on this request. After the end time it is the floor price.
integer
Unix seconds when bidding closes.
boolean
Always
true in this list. The venue clears it when the last unit sells or when the auction is settled after expiry.boolean
true once endTime has passed.boolean
true while the auction is running. A bid on an auction where this is false is refused.boolean
true once the auction has expired, which is when Settle Expired Auction accepts it.string
How the Price Moves
The venue fixes the schedule once, when the auction opens, from the oracle price the liquidation was priced at. The price then falls linearly from that price timesauctionStartPremium to that price times auctionMinPremium, across auctionDuration. A market configured at 13000 and 9500 basis points opens at 1.3 times that price and reaches 0.95 times at the end time. Oracle updates after the auction opens do not move its schedule.
currentPrice reflects the moment of the request. Quote it fresh, since what a bid costs changes between reading and submitting.
expired, biddable, settleable and phase are computed against the API server’s clock, while the venue judges by the block timestamp. Within seconds of endTime the two can disagree, so a bid sent at the last moment can still revert.
An empty array is also what a market with no auction venue returns, and what a failed read of the venue returns. An auction whose own read fails is left out without an error. If a market has known auctions and this returns nothing, check two things. Get Auction Module says whether a venue is
wired, and Get Market Metrics carries an activeAuctions counter.curl "https://api.trusset.org/lending-external-securities-v2/api/liquidations/{marketId}/auctions" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/liquidations/${marketId}/auctions`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const biddable = data.auctions.filter((auction) => auction.biddable);
const toSettle = data.auctions.filter((auction) => auction.settleable);
{
"success": true,
"data": {
"auctions": [
{
"auctionId": "2",
"loanId": "5",
"borrower": "0x7d2e9B4c1A8f03e6B5D9c2A7F4e18B06c3D5a92F",
"collateralRemaining": "40.0",
"debtRemaining": "3850.5",
"currentPrice": "95.0",
"endTime": 1718438400,
"active": true,
"expired": true,
"biddable": false,
"settleable": true,
"phase": "EXPIRED"
},
{
"auctionId": "3",
"loanId": "7",
"borrower": "0x7d2e9B4c1A8f03e6B5D9c2A7F4e18B06c3D5a92F",
"collateralRemaining": "220.0",
"debtRemaining": "21159.2",
"currentPrice": "118.42",
"endTime": 1718449200,
"active": true,
"expired": false,
"biddable": true,
"settleable": false,
"phase": "RUNNING"
}
]
}
}
{
"success": false,
"error": {
"code": "NO_MARKET_ADDRESS",
"message": "No on-chain address"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
MISSING_MARKET_ID | 400 | The market ID is longer than 100 characters |
NO_MARKET_ADDRESS | 400 | The market has no on-chain address recorded |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
⌘I
curl "https://api.trusset.org/lending-external-securities-v2/api/liquidations/{marketId}/auctions" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/liquidations/${marketId}/auctions`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const biddable = data.auctions.filter((auction) => auction.biddable);
const toSettle = data.auctions.filter((auction) => auction.settleable);
{
"success": true,
"data": {
"auctions": [
{
"auctionId": "2",
"loanId": "5",
"borrower": "0x7d2e9B4c1A8f03e6B5D9c2A7F4e18B06c3D5a92F",
"collateralRemaining": "40.0",
"debtRemaining": "3850.5",
"currentPrice": "95.0",
"endTime": 1718438400,
"active": true,
"expired": true,
"biddable": false,
"settleable": true,
"phase": "EXPIRED"
},
{
"auctionId": "3",
"loanId": "7",
"borrower": "0x7d2e9B4c1A8f03e6B5D9c2A7F4e18B06c3D5a92F",
"collateralRemaining": "220.0",
"debtRemaining": "21159.2",
"currentPrice": "118.42",
"endTime": 1718449200,
"active": true,
"expired": false,
"biddable": true,
"settleable": false,
"phase": "RUNNING"
}
]
}
}
{
"success": false,
"error": {
"code": "NO_MARKET_ADDRESS",
"message": "No on-chain address"
}
}
