morpho-org / morpho-blue-subgraph

📈 A Morpho Blue Subgraph implementing the Messari schema for Lending protocol
MIT License
1 stars 4 forks source link

Pending cap show market id #10

Closed MerlinEgalite closed 6 months ago

MerlinEgalite commented 6 months ago

When querying the pending caps the id is the concatenation of the market params. I think it would be better if it was the the id of the market instead

Screenshot 2024-02-12 at 16 59 55
julien-devatom commented 6 months ago

id must be unique for a pending cap, but you can retrieve the market id by doing the following query:

{
  pendingCaps(first: 1) {
    metaMorphoMarket {
      market {
        id
      }
    }
  }
}
julien-devatom commented 6 months ago

Better, you can do that:

{
  metaMorphos(first: 10) {

    markets {
      market {
        id
      }
       pendingCaps {
        validAt
        isNewMarket
        cap
        status
      }
    }
  }
}
MerlinEgalite commented 6 months ago

ah cool thx