diff --git a/lib/terraV3-source.js b/lib/terraV3-source.js index c389c4f910..6b55f7247b 100644 --- a/lib/terraV3-source.js +++ b/lib/terraV3-source.js @@ -3,6 +3,9 @@ const BigNumber = require('bignumber.js') const { keyBy } = require('lodash') const { pubkeyToAddress } = require('./tools') +// Terra is provisioning this amount manually https://medium.com/terra-money/project-santa-community-initiative-b8ab6c4d79be +const annualProvision = '21700000000000' // 21.7 million in uluna + class TerraV3API extends CosmosV2API { setReducers() { this.reducers = require('./reducers/terraV3-reducers') @@ -45,9 +48,6 @@ class TerraV3API extends CosmosV2API { validator.signing_info = signingInfos[consensusAddress] }) - // Terra is provisioning this amount manually https://medium.com/terra-money/project-santa-community-initiative-b8ab6c4d79be - const annualProvision = '21700000000000' // 21.7 million in uluna - return validators.map(validator => this.reducers.validatorReducer( this.networkId, @@ -57,6 +57,15 @@ class TerraV3API extends CosmosV2API { ) ) } + + async getExpectedReturns(validator) { + const expectedReturns = this.reducers.expectedRewardsPerToken( + validator, + validator.commission, + annualProvision + ) + return expectedReturns + } } module.exports = TerraV3API