Skip to content

Commit

Permalink
fixed update rebalancer config
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Nov 5, 2024
1 parent b8b2ae0 commit bf7c412
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export class ConfigureRebalancerAction extends ActionBase<ConfigureRebalancerDat
maxLimit:
rebalancerConfig?.max_limit &&
!isNaN(Number(rebalancerConfig.max_limit))
? Number(rebalancerConfig.max_limit)
? Number(rebalancerConfig.max_limit) * 100
: 5,
minBalance:
minBalanceTarget?.min_balance && minBalanceToken
Expand Down Expand Up @@ -529,8 +529,6 @@ export class ConfigureRebalancerAction extends ActionBase<ConfigureRebalancerDat
// Common options.
...({
base_denom: baseDenom,
// BPS
max_limit_bps: maxLimit && maxLimit * 100,
pid: {
p: pid.kp.toString(),
i: pid.ki.toString(),
Expand Down Expand Up @@ -560,9 +558,15 @@ export class ConfigureRebalancerAction extends ActionBase<ConfigureRebalancerDat
...(rebalancerConfig
? ({
trustee: trustee ? { set: trustee } : 'clear',
// BPS
max_limit_bps: maxLimit
? { set: maxLimit * 100 }
: 'clear',
} as Partial<RebalancerUpdateData>)
: ({
trustee: trustee || null,
// BPS
max_limit_bps: maxLimit && maxLimit * 100,
} as Partial<RebalancerData>)),
}),
},
Expand Down

0 comments on commit bf7c412

Please sign in to comment.