Conversation
de33cf5 to
36f83fa
Compare
Lezek123
left a comment
There was a problem hiding this comment.
- Update from
masteris needed db/migrations/2000000000000-Views.jsshould be adjusted (see the related tutorial at: https://github.com/Lezek123/orion/blob/user-accounts/docs/developer-guide/tutorials/entity-visibility.md), mainly:- All new entities related to excluded channels should be hidden, ie.:
// db/migrations/2000000000000-Views.js // ... nft_activity: [`EXISTS(SELECT 1 FROM "event" WHERE "id"="event_id")`], token: [`EXISTS(SELECT 1 FROM "channel" WHERE "id"="channel_id")`], revenue_share: [`EXISTS(SELECT 1 FROM "token" WHERE "id"="token_id")`], benefit: [`EXISTS(SELECT 1 FROM "token" WHERE "id"="token_id")`], // ...and so on, there should basically be an entry for each new entity // ...
- To avoid a situation in which a video which is set as
Token.trailerVideoand then excluded causes errors (because in this case the video won't exist in the public schema so queryingToken.trailerVideowill throw an error) you should either create a view which overrides this field (Token.trailerVideo) toNULLif the video doesn't exist (is excluded) or introduce a new entity likeTrailerVideosuch thatTailerVideohas 1-to-1 relationship withvideoandtoken. You would be able to more easily exclude it in this case, ie.:// db/migrations/2000000000000-Views.js // ... trailer_video: [ `EXISTS(SELECT 1 FROM "token" WHERE "id"="token_id")`, `EXISTS(SELECT 1 FROM "video" WHERE "id="video_id")` ], // ...
- All new entities related to excluded channels should be hidden, ie.:
- It's difficult to retrieve the current sale associated with a given token, because
Token.saleis a list of all sales. I suggest adding a field likeToken.currentSale(or makeToken.statusan union withTokenStatusSalevariant that would point to the current one). The same is true for AMMs and revenue splits. Tokenshould have a field likelastTransactionPrice, because in many places in the current designs there is a JOY value associated with each token.
Actually this value can easily be manipulated if the issuer creates a sale and just buys from themselves, so perhaps the designs should be adjusted instead (?) CC: @bedeho- A query is needed that returns total portfolio value of a given member:
- Liquid tokens value: aggregation like
SUM(tokenAccount.transferrableAmount * token.lastTransactionPrice)for all owned tokens - Total tokens value: aggregation like
SUM(tokenAccount.totalAmount * token.lastTransactionPrice)for all owned tokens
- Liquid tokens value: aggregation like
- A query / field is needed that returns total transaction volume of a given token:
SUM(sale.tokensSold * sale.unitPrice)for all token's sales +SUM(ammTransaction.pricePaid)for all token's amm transactions.
Actually I'm not sure if this stat is worth displaying on the token page, since it can be very easily manipulated CC @bedeho
AmmCurveshould havetermsAndConditions(same asSale) according to the designs- Notifications: New events need to be introduced in
schema/events.graphqlto facilitate new kinds of notifications:- Token holder notifications:
- Upcoming revenue split
- Revenue split started
- Revenue split ended
- AMM started
- Sale started
- Channel follower notifications:
- Token issued
- Token sale initialized
- Token issuer:
- Sale eneded
- Someone bought tokens on sale
- Someone bought / sold tokens on AMM
- Rev. Split has ended
The exact schema for those notifications should probably be discussed with the Atlas team (CC: @attemka @drillprop @WRadoslaw)
- Token holder notifications:
| status: TokenStatus! | ||
|
|
||
| "avatar object (profile picture)" | ||
| avatar: TokenAvatar |
There was a problem hiding this comment.
When I was reviewing the designs I was under the impression that tokens don't have their own avatars, instead the channel avatar is simultaneously a token avatar. Is this correct @KubaMikolajczyk ?
There was a problem hiding this comment.
Still not entirely clear whether this field is needed. Probably worth asking @KubaMikolajczyk
schema/token.graphql
Outdated
| "revenue share ratio between creator and holder" | ||
| revenueShareRatioPercent: Int! |
There was a problem hiding this comment.
- The unit is permill (1 / 1000000), not percent (1 / 100)
- This field seems to be duplicated by
channel.revenueShareRatioPercent
There was a problem hiding this comment.
The field is still called Percent while it's actuall Permill
Lezek123
left a comment
There was a problem hiding this comment.
Besides the issues pointed out in the new comments, there are still some unresolved points from the list provided as part of the 1st review (ie. #99 (review)), like points 4. - 9. (although I realize some of them require external input)
| deissued: Boolean! | ||
| } | ||
|
|
||
| type TokenChannel @entity @index(fields: ["token", "channel"], unique: true) { |
There was a problem hiding this comment.
Ok, but I think you now accidently removed creatorToken: TokenChannel @derivedFrom(field: "channel") field from the Channel entity
schema/token.graphql
Outdated
| totalSupply: BigInt! | ||
|
|
||
| "sales issued for this token" | ||
| sale: [Sale!] @derivedFrom(field: "token") |
There was a problem hiding this comment.
I suggest renaming it to sales for better clarity
schema/token.graphql
Outdated
| revenueShareRatioPercent: Int! | ||
|
|
||
| "revenue shares issued for this token" | ||
| revenueShare: [RevenueShare!] @derivedFrom(field: "token") |
There was a problem hiding this comment.
I suggest renaming it to revenueShares for better clarity
docs/developer-guide.md
Outdated
|
|
||
| - `make typegen` - generates event types (`src/types`) based on `typegen.json` (the archive endpoint provided in `specVersions` must be pointing to a running archive) | ||
| - `make codegen` - generates TypeORM models based on the [input schema](#input-schema) | ||
| - `make codegen` - granetes TypeORM models based on the [input schema](#input-schema) |
scripts/orion-v1-migration/export.sh
Outdated
src/server-extension/orm.ts
Outdated
this is required so we can simply make trailer video hidden if video is hidden
I have replaced the vesting schedule back to the original schema with: - VestingSchedule: holding vesting schedule information such being amount agnostic - VestedAccount: contains information regarded to a vested account, the goal is to mimic the runtime logic
Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
2cc77fb to
175cb88
Compare
Goal
Adds schema and mappings (handlers) for CRT extrinsic in orion v2.
Info
src/mappings/token/index.tshas been pretty much tested via integration test except for:processJoinWhitelistEventcrt_releasebranch but there is plan for it (as the figma design documents prescribes it)joystream.jsonlarchive. Due to the different runtime spec versions since mainnet. How to do this is explained in Update developer-guide.md Lezek123/orion#2References for this PR