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!
|
tokenId: BigInt!
|
||||||
amount: BigDecimal!
|
amount: BigDecimal!
|
||||||
lockedAmount: BigDecimal!
|
lockedAmount: BigDecimal!
|
||||||
lockedAmountinVe: BigDecimal!
|
timeLeft: BigDecimal!
|
||||||
cancelTime: BigInt!
|
cancelTime: BigInt!
|
||||||
expireTime: BigInt!
|
expireTime: BigInt!
|
||||||
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")
|
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")
|
||||||
|
@ -137,7 +137,7 @@ export function getveDelegation(
|
|||||||
veDelegation.receiver = ''
|
veDelegation.receiver = ''
|
||||||
veDelegation.delegator = ''
|
veDelegation.delegator = ''
|
||||||
veDelegation.lockedAmount = BigDecimal.zero()
|
veDelegation.lockedAmount = BigDecimal.zero()
|
||||||
veDelegation.lockedAmountinVe = BigDecimal.zero()
|
veDelegation.timeLeft = BigDecimal.zero()
|
||||||
veDelegation.save()
|
veDelegation.save()
|
||||||
}
|
}
|
||||||
return veDelegation
|
return veDelegation
|
||||||
|
@ -31,7 +31,7 @@ export function handleDelegation(event: DelegateBoost): void {
|
|||||||
BigInt.fromI32(18).toI32()
|
BigInt.fromI32(18).toI32()
|
||||||
)
|
)
|
||||||
veDelegation.lockedAmount = delegator.lockedAmount
|
veDelegation.lockedAmount = delegator.lockedAmount
|
||||||
veDelegation.lockedAmountinVe = delegator.lockedAmount.mul(timeLeft).divDecimal(MAX_TIME)
|
veDelegation.timeLeft = Datetime.now() - delegator.unlockTime
|
||||||
veDelegation.cancelTime = _cancelTime
|
veDelegation.cancelTime = _cancelTime
|
||||||
veDelegation.expireTime = _expireTime
|
veDelegation.expireTime = _expireTime
|
||||||
veDelegation.save()
|
veDelegation.save()
|
||||||
|
Loading…
Reference in New Issue
Block a user