Skip to content

Commit

Permalink
log the pool lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
EdNoepel committed Aug 24, 2023
1 parent 19908f8 commit ec37864
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mappings/position-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,15 @@ export function handleRedeemPosition(event: RedeemPositionEvent): void {
redeem.transactionHash = event.transaction.hash

const position = loadOrCreatePosition(redeem.tokenId)
const poolAddress = addressToBytes(getPoolForToken(redeem.tokenId))
const accountId = redeem.lender

log.info("handleRedeemPosition for lender {} token {}" , [accountId.toHexString(), redeem.tokenId.toString()])

// update positionLend entities for each index
const positionIndexes = position.indexes;
for (let index = 0; index < redeem.indexes.length; index++) {
const bucketId = getBucketId(poolAddress, index)
log.info("handleRedeemPosition looking up pool {} bucket {}", [redeem.pool.toHexString(), index.toString()])
const bucketId = getBucketId(redeem.pool, index)
const positionLend = loadOrCreatePositionLend(redeem.tokenId, bucketId, index)
positionLend.lpb = ZERO_BD
saveOrRemovePositionLend(positionLend)
Expand Down

0 comments on commit ec37864

Please sign in to comment.