Skip to content
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: correct logic for updatePositionLends helper #80

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

imbaniac
Copy link
Contributor

@imbaniac imbaniac commented Nov 9, 2023

  • Helper method updatePositionLends had incorrect conditions for adding lendPosition to Bucket and Position entities. Also it didn't save properly.
  • Change Position Entity to include Pool Entity relation — instead of only pool id

@@ -100,9 +97,6 @@ export function handleMemorializePosition(
memorialize.blockTimestamp = event.block.timestamp
memorialize.transactionHash = event.transaction.hash

// update entities
const position = loadOrCreatePosition(memorialize.tokenId)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed; this is created upon mint, and gets mutated by updatePositionLends on line 121.

@EdNoepel EdNoepel merged commit 042f40a into develop Nov 9, 2023
1 check passed
@EdNoepel EdNoepel deleted the lend-position-fix branch November 9, 2023 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants