mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Making percentage update conditional
This commit is contained in:
parent
dd98790cc8
commit
0178464cff
@ -19,9 +19,11 @@ export function handleDelegation(event: DelegateBoost): void {
|
||||
veDelegation.delegator = _delegator
|
||||
getveOCEAN(_receiver)
|
||||
const delegatorVeOcean = getveOCEAN(_delegator)
|
||||
veDelegation.amountFraction = _amount.divDecimal(
|
||||
delegatorVeOcean.lockedAmount
|
||||
)
|
||||
if (_amount && delegatorVeOcean.lockedAmount) {
|
||||
veDelegation.amountFraction = _amount.divDecimal(
|
||||
delegatorVeOcean.lockedAmount
|
||||
)
|
||||
}
|
||||
veDelegation.receiver = _receiver
|
||||
veDelegation.tokenId = _tokenId
|
||||
veDelegation.amount = _amount
|
||||
@ -41,9 +43,11 @@ export function handleExtendBoost(event: ExtendBoost): void {
|
||||
|
||||
const veDelegation = getveDelegation(_tokenId.toHex())
|
||||
const delegatorVeOcean = getveOCEAN(_delegator)
|
||||
veDelegation.amountFraction = _amount.divDecimal(
|
||||
delegatorVeOcean.lockedAmount
|
||||
)
|
||||
if (_amount && delegatorVeOcean.lockedAmount) {
|
||||
veDelegation.amountFraction = _amount.divDecimal(
|
||||
delegatorVeOcean.lockedAmount
|
||||
)
|
||||
}
|
||||
veDelegation.delegator = _delegator
|
||||
veDelegation.receiver = _receiver
|
||||
veDelegation.tokenId = _tokenId
|
||||
|
Loading…
Reference in New Issue
Block a user