-
Notifications
You must be signed in to change notification settings - Fork 206
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(perp): Implemented funding payment calculation in epoch hook #616
Conversation
john-connor84
commented
Jun 16, 2022
- Also implemented TWAP mark price calculation
285f5c2
to
a217b7a
Compare
a217b7a
to
6c4cda1
Compare
3a822ac
to
af57c5a
Compare
@@ -11,38 +13,45 @@ func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochN | |||
} | |||
|
|||
func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64) { |
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 third parameter used for?
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.
It's the epochNumber, I don't use it so I made it _
, didn't want to remove it as the func signature is used throughout but can if you think it's better
x/vpool/keeper/prices.go
Outdated
@@ -347,19 +347,19 @@ func (k Keeper) updateTWAPPrice(ctx sdk.Context, pairID string) error { | |||
currentTWAP = types.CurrentTWAP{ | |||
PairID: pairID, | |||
Numerator: sdk.MustNewDecFromStr("0"), |
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.
Could just do sdk.ZeroDec()
here.