Skip to content

Commit

Permalink
use lenderInfo for depositTime in transferLP
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike committed Aug 16, 2023
1 parent da68ba5 commit 5fd73b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mappings/base/base-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ export function _handleTransferLP(erc20Event: TransferLPERC20Event | null, erc72

// add new lend
const newLend = loadOrCreateLend(bucketId, newLendId, pool.id, transferLP.newOwner)
// TODO: should we simply use lenderInfo.depositTime instead of getDepositTime?
newLend.depositTime = getDepositTime(oldLend.depositTime, newLend)
newLend.lpb = wadToDecimal(getLenderInfo(pool.id, bucketIndex, newOwner).lpBalance)
const newLendInfo = getLenderInfo(pool.id, bucketIndex, newOwner)
newLend.depositTime = newLendInfo.depositTime
newLend.lpb = wadToDecimal(newLendInfo.lpBalance)
newLend.lpbValueInQuote = lpbValueInQuote(pool.id, bucket.bucketIndex, newLend.lpb)
updateAccountLends(newOwnerAccount, newLend)
newLend.save()
Expand Down

0 comments on commit 5fd73b5

Please sign in to comment.