Skip to content
This repository was archived by the owner on Apr 24, 2026. It is now read-only.

feat: link BadDebtRealization with Market entity - #16

Open
antoncoding wants to merge 1 commit into
morpho-org:mainfrom
antoncoding:feat/market-bad-debt
Open

feat: link BadDebtRealization with Market entity#16
antoncoding wants to merge 1 commit into
morpho-org:mainfrom
antoncoding:feat/market-bad-debt

Conversation

@antoncoding

Copy link
Copy Markdown

Link BadDebtRealization with Market entity so we can query bad debt associated with a market like this

{
  markets(first: 5) {
    badDebtRealizations {
      badDebt
    }
  }
}

@antoncoding

antoncoding commented Oct 24, 2025

Copy link
Copy Markdown
Author

The test subgraph is still not synced, but has some entities already have badDebtRealizations attached to the market that we can verify

Endpoint: https://api.studio.thegraph.com/query/114289/morpho-blue-base/version/latest

Example query

{
  market (id : "0x13c42741a359ac4a8aa8287d2be109dcf28344484f91185f9a79bd5a805a55ae") {
    irm
    totalCollateral
    badDebtRealizations {
      id
      liquidation {
        id
      }
      badDebt
    }
  }
}

Response

{
  "data": {
    "market": {
      "irm": "0x46415998764c29ab2a25cbea6254146d50d22687",
      "totalCollateral": "699946990582152877604",
      "badDebtRealizations": [
        {
          "id": "0x08911a948cdfb0a8c0a44f5d9b1bb44c6f8fe506a1ada8de9c42c7a1a794e817c100000000000000",
          "liquidation": {
            "id": "0x08911a948cdfb0a8c0a44f5d9b1bb44c6f8fe506a1ada8de9c42c7a1a794e817c100000000000000"
          },
          "badDebt": "14581"
        }
      ]
    }
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant