mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
CHanging the decimals so that they are taken from the feeToken
This commit is contained in:
parent
d1cd98ce1b
commit
f6b81ecccb
@ -129,6 +129,7 @@ export function handlerOrderReused(event: OrderReused): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function handlePublishMarketFee(event: PublishMarketFee): void {}
|
export function handlePublishMarketFee(event: PublishMarketFee): void {}
|
||||||
|
|
||||||
export function handlePublishMarketFeeChanged(
|
export function handlePublishMarketFeeChanged(
|
||||||
event: PublishMarketFeeChanged
|
event: PublishMarketFeeChanged
|
||||||
): void {
|
): void {
|
||||||
|
@ -246,16 +246,19 @@ export function handlePublishMarketFeeChanged(
|
|||||||
event.address
|
event.address
|
||||||
)
|
)
|
||||||
const fixedRateExchange = getFixedRateExchange(fixedRateId)
|
const fixedRateExchange = getFixedRateExchange(fixedRateId)
|
||||||
const baseToken = getToken(
|
|
||||||
Address.fromString(fixedRateExchange.baseToken),
|
|
||||||
false
|
|
||||||
)
|
|
||||||
if (fixedRateExchange) {
|
if (fixedRateExchange) {
|
||||||
|
const feeToken = getToken(
|
||||||
|
Address.fromString(fixedRateExchange.publishMarketFeeAddress),
|
||||||
|
false
|
||||||
|
)
|
||||||
|
const feeDecimals = BigInt.fromI32(feeToken.decimals).toI32()
|
||||||
|
|
||||||
fixedRateExchange.publishMarketFeeAddress =
|
fixedRateExchange.publishMarketFeeAddress =
|
||||||
event.params.newMarketCollector.toHexString()
|
event.params.newMarketCollector.toHexString()
|
||||||
fixedRateExchange.publishMarketSwapFee = weiToDecimal(
|
fixedRateExchange.publishMarketSwapFee = weiToDecimal(
|
||||||
event.params.swapFee.toBigDecimal(),
|
event.params.swapFee.toBigDecimal(),
|
||||||
BigInt.fromI32(baseToken.decimals).toI32()
|
feeDecimals
|
||||||
)
|
)
|
||||||
fixedRateExchange.save()
|
fixedRateExchange.save()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user