Skip to content

Commit

Permalink
[LeverageLp]: Fix position query (#758)
Browse files Browse the repository at this point in the history
fix query

Co-authored-by: Cosmic Vagabond <[email protected]>
  • Loading branch information
amityadav0 and cosmic-vagabond authored Sep 3, 2024
1 parent ab4bdb5 commit 6333cac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/leveragelp/keeper/position.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ func (k Keeper) GetPosition(ctx sdk.Context, positionAddress sdk.AccAddress, id
}
bz := store.Get(key)
k.cdc.MustUnmarshal(bz, &position)
debt := k.stableKeeper.GetDebt(ctx, position.GetPositionAddress())
position.Liabilities = debt.GetTotalLiablities()
return position, nil
}

Expand Down Expand Up @@ -141,6 +143,8 @@ func (k Keeper) GetAllPositions(ctx sdk.Context) []types.Position {
bytesValue := iterator.Value()
err := k.cdc.Unmarshal(bytesValue, &position)
if err == nil {
debt := k.stableKeeper.GetDebt(ctx, position.GetPositionAddress())
position.Liabilities = debt.GetTotalLiablities()
positions = append(positions, position)
}
}
Expand Down

0 comments on commit 6333cac

Please sign in to comment.