mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Replace lockedAmountinVe with timeLeft
This commit is contained in:
parent
392e1f28d9
commit
de7b439cc4
@ -469,7 +469,7 @@ type VeDelegation @entity {
|
||||
tokenId: BigInt!
|
||||
amount: BigDecimal!
|
||||
lockedAmount: BigDecimal!
|
||||
lockedAmountinVe: BigDecimal!
|
||||
timeLeft: BigDecimal!
|
||||
cancelTime: BigInt!
|
||||
expireTime: BigInt!
|
||||
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")
|
||||
|
@ -137,7 +137,7 @@ export function getveDelegation(
|
||||
veDelegation.receiver = ''
|
||||
veDelegation.delegator = ''
|
||||
veDelegation.lockedAmount = BigDecimal.zero()
|
||||
veDelegation.lockedAmountinVe = BigDecimal.zero()
|
||||
veDelegation.timeLeft = BigDecimal.zero()
|
||||
veDelegation.save()
|
||||
}
|
||||
return veDelegation
|
||||
|
@ -31,7 +31,7 @@ export function handleDelegation(event: DelegateBoost): void {
|
||||
BigInt.fromI32(18).toI32()
|
||||
)
|
||||
veDelegation.lockedAmount = delegator.lockedAmount
|
||||
veDelegation.lockedAmountinVe = delegator.lockedAmount.mul(timeLeft).divDecimal(MAX_TIME)
|
||||
veDelegation.timeLeft = Datetime.now() - delegator.unlockTime
|
||||
veDelegation.cancelTime = _cancelTime
|
||||
veDelegation.expireTime = _expireTime
|
||||
veDelegation.save()
|
||||
|
Loading…
Reference in New Issue
Block a user