-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/Flippers-for-collection-activity #35
Feat/Flippers-for-collection-activity #35
Conversation
|
||
type FlipEvent @entity { | ||
id: ID! | ||
flipper: FlipperEntity! | ||
nft: NFTEntity! | ||
soldPrice: BigInt | ||
soldTo: String | ||
sellTimestamp: DateTime | ||
boughtPrice: BigInt! | ||
profit: BigInt | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- afaik we don't have initial and closing prices. that will fit more into a trading system with candles
- anyway, this is not the info I'm looking to capture, I am looking to capture flip events for collection activity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this some common good pattern or?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what you mean
i just find it convenient to wrap it inside a class
can be done otherwise as well obv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just find it convenient to wrap it inside a class
Like I am writing is as functions, but maybe is more my approach to thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually wrote function as well
I have 0 problem changing to function if that's the preferd style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return | ||
} | ||
|
||
const previousFlipEvent = previousFlipper.flips.find((flip) => flip.nft.id === nft.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the issue?
I am looking for the previous time this (current event) nft has been bought
if it has been bought before, then we are now dealing with a flip
otherwise, it is first time purchase, and the function handlePreviousOwner
returns because the previous owner got the nft somehow (minting sending, whatever), but they didn't buy it => not a flip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the issue?
That iterating over array in javascript would be always slower than reading from DB. If the flips would have 10k items my bet is that processor would be slow and die 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand.
I'll query the db instead
👌👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vikiival please have a look again sir
|
Spin indexer
apply migrations
Create new
|
…ppers-for-collection-activity
@vikiival check again, please. i've added migartion |
enabling query for flippers in colllection activity
@vikiival