Open nud3l opened 1 year ago
Would you like me to add onto the existing vault object in squid or is should this be an entirely new object? https://github.com/interlay/interbtc-squid/blob/e0ed448a63df2383f805f366066ab1979b6feb95/schema.graphql#L51-L59 If adding to this existing is this what you are looking for?
type Vault @entity {
id: ID!
accountId: String! @index
collateralToken: Currency!
collateralAmount: BigInt!
wrappedToken: Currency!
pendingBtcAmount: BigInt!
collateralization: String!
statusIssuing: Bool!
statusCollateral: Bool!
registrationBlock: Height!
registrationTimestamp: DateTime!
lastActivity: Height
}
Adding it to the existing vault object is the right approach. Thank you!
Sounds good!
@nud3l The locked collateral in the dashboard displays the collateral as DOT. Is the collateral in the multi-collateral system all converted to DOT equivalent value for displaying here?
No, there are individual dashboards for each collateral asset. The DOT is just due to Interlay only having DOT as collateral right now. See Kintsugi as an example: https://kintsugi.interlay.io/dashboard/vaults
There's then a summary dashboard that converts all collateral assets to USD but that would be an add on and I'd consider it out of scope for this PR.
Ok thanks that clears up all my confusion.
Looks like the proposed goal does not included locked btc amount just the a pending btc amount. I feel that we need locked btc to calculation the collateratlization:
collateralization = colleratalAmount (converted to btc value) / locked btc
I have added this to the schema, but lmk if this is not needed/wanted.
great catch, I forgot to add it.
@nud3l For the status issuing, Is this referring to
status | VaultStatus | Current status of the vault (Active, Liquidated, CommittedTheft)
from the iBTC spec?
Almost:
StatusIssuing - Active or Inactive (just that part basically: https://github.com/interlay/interbtc/blob/master/crates/vault-registry/src/types.rs#L132)
StatusCollateral - AboveSecureThreshold, BelowSecureThreshold, BelowPremiumRedeemThreshold, Liquidated. The parachain just tracks if a vault is liquidated but the UI/frontend would also track if a vault is above or below certain collateral thresholds as determined by the ones here: https://docs.interlay.io/#/vault/overview?id=collateral-thresholds
Ok I see Active is a bool within the VaultStatus struct
Goal
Add a
vaults
endpoint where we can the data available at https://app.interlay.io/dashboard/vaultsImplementation
Vaults have:
Replaces