-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: stATOM/ATOM rate #733
Conversation
@@ -33,6 +33,9 @@ func (k Keeper) TranchePtAPYs(c context.Context, req *types.QueryTranchePtAPYsRe | |||
return nil, err | |||
} | |||
restMaturity := tranche.StartTime + tranche.Maturity - uint64(ctx.BlockTime().Unix()) | |||
if restMaturity < 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.
restMaturity is uint64 and won't have <0 case
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.
oh, that's true
@@ -24,6 +24,23 @@ func (k Keeper) EstimateSwapInPool(c context.Context, req *types.QueryEstimateSw | |||
if !ok { | |||
return nil, types.ErrInvalidAmount | |||
} | |||
ptDenom := types.PtDenom(tranche) | |||
if req.Denom == ptDenom { | |||
if tranche.StartTime+tranche.Maturity <= uint64(ctx.BlockTime().Unix()) { |
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's this case? Can you add some comments on the code?
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 missed the processing at maturity
Fix stATOM/ATOM rate
ex:
stATOM/ATOM = 1.1
1 ATOM = 0.9 stATOM