A Aelin subgraph for The Graph. Aelin is a fundraising protocol built on Ethereum.
Notifications are a powerful feature that will allow Aelin to create a communication chanel with users in a reliable way. All notifications are design with a goal in mind: little-to-none work should be done on the client-side to transform chain data.
Notifications are created in advanced, this means that the client will have to decide if a notification should be rendered depending on triggerStart
and triggerEnd
fields.
It's important to mention that all(*) notifications will be removed from the subgraph at certain point and therefore wont be possible to query them again from that point.
Some notifications might be stored forever depending on the context and certain conditions, ie: a pool is created but no one invests in it and no deal is created. As a consequence no event will be emitted to remove InvestmentWindowAlert and InvestmentWindowEnded
Notifications can be easily filtered by target
and type
, for instance:
If a user has invested in PoolA
, when all notifications from PoolA
are pulled from the subgraph, the client will have to show only those relevant for the user, and in this case, since the user is (only) an investor, then the client should filter by target: Investor
Name | Type | Description |
---|---|---|
id | ID | address - NotificationType address could be a poolAddress, dealAddress, or a userAddress |
message | String | The notification message |
type |
enum NotificationType { InvestmentWindowAlert InvestmentWindowEnded DealProposed HolderSet SponsorFeesReady VestingCliffBegun WithdrawUnredeemed DealTokensVestingBegun AllDealTokensVested } | Depending on the type field, the client-side willdecide if the message needs to be adapted or changed. |
target |
enum NotificationTarget { Investor Sponsor Holder } |
Since all notifications types and targets from a certain Pool will be queried from the subgraph, the client will need a way to filter them depending on the user type (investor, sponsor, holder) |
triggerStart | BigInt | Notification should be visible to the client only if the current time has passed triggerStart |
triggerEnd | BigInt | Notification should be NOT be visible to the client if the current time has passed triggerEnd |
pool | PoolCreated | Contain all the information of the pool related to the notification |