diff --git a/CHANGELOG_UNRELEASED.md b/CHANGELOG_UNRELEASED.md
index 5912b1d263..99a8bbbb59 100644
--- a/CHANGELOG_UNRELEASED.md
+++ b/CHANGELOG_UNRELEASED.md
@@ -32,6 +32,7 @@
- (impv) [\#2039](https://github.com/bandprotocol/bandchain/pull/2039) Forward max_span_size from module to go-owasm
- (impv) [\#2008](https://github.com/bandprotocol/bandchain/pull/2008) Add target validator's address on redelegate
+- (impv) [\#2005](https://github.com/bandprotocol/bandchain/pull/2005) Show max commission rate and max commission change on validator index page
- (feat) [\#2001](https://github.com/bandprotocol/bandchain/pull/2001) Add `Countup.js` to animate balance and reward
- (bugs) [\#1996](https://github.com/bandprotocol/bandchain/pull/1996) Fix id bug on `RequestSub.re`
- (chore) [\#1987](https://github.com/bandprotocol/bandchain/pull/1987) Remove `request_tab_t` in `Route.re`
diff --git a/scan/src/pages/ValidatorIndexPage.re b/scan/src/pages/ValidatorIndexPage.re
index 9537793155..b54fbd4f98 100644
--- a/scan/src/pages/ValidatorIndexPage.re
+++ b/scan/src/pages/ValidatorIndexPage.re
@@ -90,7 +90,7 @@ module Uptime = {
"Percentage of the blocks that the validator is active for out of the last 250"
|> React.string;
},
- VCode(uptime->Format.fPercent),
+ VCode(uptime |> Format.fPercent(~digits=2)),
)
|> Sub.resolve
| None =>
@@ -197,7 +197,28 @@ let make = (~address, ~hashtag: Route.validator_tab_t) =>
{
"Validator service fees charged to delegators" |> React.string;
},
- VCode(validator.commission->Format.fPercent),
+ VCode(validator.commission |> Format.fPercent(~digits=2)),
+ )}
+
+ {kvRow(
+ "COMMISSION MAX CHANGE",
+ {
+ "Maximum increment by which the validator can change their commission rate at a time"
+ |> React.string;
+ },
+ {
+ VCode(validator.commissionMaxChange |> Format.fPercent(~digits=2));
+ },
+ )}
+
+ {kvRow(
+ "COMMISSION MAX RATE",
+ {
+ "The highest possible commission rate the validator can set" |> React.string;
+ },
+ {
+ VCode(validator.commissionMaxRate |> Format.fPercent(~digits=2));
+ },
)}
{kvRow(
diff --git a/scan/src/subscriptions/ValidatorSub.re b/scan/src/subscriptions/ValidatorSub.re
index 4cf242c2dd..e982f260be 100644
--- a/scan/src/subscriptions/ValidatorSub.re
+++ b/scan/src/subscriptions/ValidatorSub.re
@@ -15,6 +15,8 @@ type internal_t = {
website: string,
tokens: Coin.t,
commissionRate: float,
+ commissionMaxChange: float,
+ commissionMaxRate: float,
consensusPubKey: PubKey.t,
bondedHeight: int,
jailed: bool,
@@ -35,6 +37,8 @@ type t = {
details: string,
tokens: Coin.t,
commission: float,
+ commissionMaxChange: float,
+ commissionMaxRate: float,
bondedHeight: int,
completedRequestCount: int,
missedRequestCount: int,
@@ -52,6 +56,8 @@ let toExternal =
tokens,
commissionRate,
consensusPubKey,
+ commissionMaxChange,
+ commissionMaxRate,
bondedHeight,
jailed,
details,
@@ -70,6 +76,8 @@ let toExternal =
details,
tokens,
commission: commissionRate *. 100.,
+ commissionMaxChange: commissionMaxChange *. 100.,
+ commissionMaxRate: commissionMaxRate *. 100.,
bondedHeight,
// TODO: remove hardcoded when somewhere use it
avgResponseTime: 2,
@@ -95,6 +103,8 @@ module SingleConfig = [%graphql
website
tokens @bsDecoder(fn: "GraphQLParser.coin")
commissionRate: commission_rate @bsDecoder(fn: "float_of_string")
+ commissionMaxChange: commission_max_change @bsDecoder(fn: "float_of_string")
+ commissionMaxRate: commission_max_rate @bsDecoder(fn: "float_of_string")
consensusPubKey: consensus_pubkey @bsDecoder(fn: "PubKey.fromBech32")
bondedHeight: bonded_height @bsDecoder(fn: "GraphQLParser.int64")
jailed
@@ -115,6 +125,8 @@ module MultiConfig = [%graphql
website
tokens @bsDecoder(fn: "GraphQLParser.coin")
commissionRate: commission_rate @bsDecoder(fn: "float_of_string")
+ commissionMaxChange: commission_max_change @bsDecoder(fn: "float_of_string")
+ commissionMaxRate: commission_max_rate @bsDecoder(fn: "float_of_string")
consensusPubKey: consensus_pubkey @bsDecoder(fn: "PubKey.fromBech32")
bondedHeight: bonded_height @bsDecoder(fn: "GraphQLParser.int64")
jailed