diff --git a/package-lock.json b/package-lock.json index 8c59e0a..53b32a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,6 @@ "requires": true, "packages": { "": { - "name": "ocean-subgraph", "version": "1.2.0", "license": "Apache-2.0", "dependencies": { diff --git a/schema.graphql b/schema.graphql index 858a07c..da6d991 100644 --- a/schema.graphql +++ b/schema.graphql @@ -26,8 +26,8 @@ type Token @entity { "adreess of fee token (can be Ocean, ETH, etc.)" publishMarketFeeToken: String - "fee amount. Fixed value, expressed in wei in contracts, needs conversion in decimals." - publishMarketFeeAmmount: BigDecimal + "fee amount. Fixed value." + publishMarketFeeAmount: BigDecimal "template ID of the datatoken" templateId: Int @@ -150,10 +150,7 @@ type Pool @entity { "Liquidty provider fee value" liquidityProviderSwapFee: BigDecimal "liquidity provider fee total amount" - liquidityProviderSwapFeeAmount: BigDecimal! - - "OPF Fee percent, fee that goes to Ocean Protocol Foundation : SWAP" - opcFee: BigDecimal! + liquidityProviderSwapFeeAmount: BigDecimal! "total pool token shares" totalShares: BigDecimal! @@ -328,8 +325,6 @@ type FixedRateExchange @entity { "if the fre has the minter role on the datatoken" isMinter: Boolean - marketSwapFee: BigDecimal! - updates: [FixedRateExchangeUpdate!] @derivedFrom(field: "exchangeId") swaps: [FixedRateExchangeSwap!] @derivedFrom(field: "exchangeId") @@ -340,7 +335,7 @@ type FixedRateExchange @entity { "address of the market where the datatoken was created. This address collects market fees." publishMarketFeeAddress: String - "fee amount. Fixed value, expressed in wei in contracts, needs conversion in decimals." + "fee amount. Fixed value" publishMarketSwapFee: BigDecimal } diff --git a/src/mappings/erc20Templates.ts b/src/mappings/erc20Templates.ts index 1055c00..d72371e 100644 --- a/src/mappings/erc20Templates.ts +++ b/src/mappings/erc20Templates.ts @@ -90,26 +90,24 @@ export function handlePublishMarketFeeChanged( event: PublishMarketFeeChanged ): void { const token = getToken(event.address, true) - if (token != null) { - token.publishMarketFeeAddress = - event.params.PublishMarketFeeAddress.toHexString() - token.publishMarketFeeToken = - event.params.PublishMarketFeeToken.toHexString() - let decimals = BigInt.fromI32(18).toI32() - if ( - token.publishMarketFeeToken != - '0x0000000000000000000000000000000000000000' - ) { - const token = getToken(event.params.PublishMarketFeeToken, false) - decimals = BigInt.fromI32(token.decimals).toI32() - } - token.publishMarketFeeAmmount = weiToDecimal( - event.params.PublishMarketFeeAmount.toBigDecimal(), - decimals - ) - token.save() - // TODO - shold we have a history + if (!token) return + + token.publishMarketFeeAddress = + event.params.PublishMarketFeeAddress.toHexString() + token.publishMarketFeeToken = event.params.PublishMarketFeeToken.toHexString() + let decimals = BigInt.fromI32(18).toI32() + if ( + token.publishMarketFeeToken != '0x0000000000000000000000000000000000000000' + ) { + const token = getToken(event.params.PublishMarketFeeToken, false) + decimals = BigInt.fromI32(token.decimals).toI32() } + token.publishMarketFeeAmount = weiToDecimal( + event.params.PublishMarketFeeAmount.toBigDecimal(), + decimals + ) + token.save() + // TODO - shold we have a history } // roles