Skip to content

Commit

Permalink
revert locked value update
Browse files Browse the repository at this point in the history
  • Loading branch information
ssallam committed Jan 18, 2021
1 parent 0b04b26 commit 8d65cb5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,17 @@ export function createPoolTransaction(

pool.consumePrice = poolTx.consumePrice
pool.spotPrice = poolTx.spotPrice
const lockedValue = pool.lockedValue
pool.lockedValue = pool.oceanReserve + (pool.datatokenReserve * pool.spotPrice)
let factory = PoolFactory.load('1')
factory.totalLockedValue = factory.totalLockedValue - lockedValue + pool.lockedValue

pool.transactionCount = pool.transactionCount.plus(BigInt.fromI32(1))

// const lockedValue = pool.lockedValue
// pool.lockedValue = pool.oceanReserve + (pool.datatokenReserve * pool.spotPrice)
// let factory = PoolFactory.load('1')
// factory.totalLockedValue = factory.totalLockedValue - lockedValue + pool.lockedValue


pool.save()
factory.save()
// factory.save()

debuglog(
'updated pool reserves (source, dtBalance, ocnBalance, dtReserve, ocnReserve): ',
Expand Down

0 comments on commit 8d65cb5

Please sign in to comment.