Skip to content

Commit

Permalink
fix getexpected returns for terra (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitcoinera authored and faboweb committed Dec 14, 2019
1 parent faf71d8 commit b9c1d27
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/terraV3-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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,
Expand All @@ -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

0 comments on commit b9c1d27

Please sign in to comment.