type StakeData @entity {
...
applications: [Application!] @derivedFrom(field: "stake")
}
interface Application {
id: ID!
stake: StakeData!
authorizedStakeAmount: BigInt!
}
type PREApplication implements Application @entity {
id: ID! // id = "operatorAddress-preapplication"
stake: StakeData!
authorizedStakeAmount: BigInt!
confirmationTimestamp: BigInt!
... // other fields related to the pre app
}
// other applications in the future eg. RandomBeaconApplication
type RandomBeaconApplication implement Application @entity {
...
}
As I understand, PREApplication ID should be <stakingProvider>-preapplication since if the ID is composed of the operator address, we can't easily find the PREOperator entity in order to modify or delete it when this type of event is received. But this will depend on the final PRE application contract.
A new schema has been proposed in #11:
As I understand,
PREApplication
ID should be<stakingProvider>-preapplication
since if the ID is composed of the operator address, we can't easily find the PREOperator entity in order to modify or delete it when this type of event is received. But this will depend on the final PRE application contract.In my opinion, this issue should be addressed when a definitive version of some Threshold application (PREApplication, TBTC, RandomBeacon) is deployed, since currently there are still in-progress discussions about, for example, authorizedStake events: https://github.com/threshold-network/solidity-contracts/issues/88#issuecomment-1111059312