Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/mirror_short_reward/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn query(_deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
pub fn query_short_reward_weight(premium_rate: Decimal) -> StdResult<ShortRewardWeightResponse> {
if premium_rate > Decimal::percent(7) {
return Ok(ShortRewardWeightResponse {
short_reward_weight: Decimal::percent(40),
short_reward_weight: Decimal::percent(100),
});
}

Expand All @@ -65,7 +65,7 @@ pub fn query_short_reward_weight(premium_rate: Decimal) -> StdResult<ShortReward
};

let short_reward_weight: Decimal =
decimal_division(erf_plus_one(sign_x, x)?, Decimal::from_ratio(5u128, 1u128));
decimal_division(erf_plus_one(sign_x, x)?, Decimal::from_ratio(2u128, 1u128));

Ok(ShortRewardWeightResponse {
short_reward_weight,
Expand Down
12 changes: 6 additions & 6 deletions contracts/mirror_short_reward/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@ fn short_reward_weight_test() {
query_short_reward_weight(Decimal::zero())
.unwrap()
.short_reward_weight,
Decimal::from_ratio(2618u128, e6)
Decimal::from_ratio(6545u128, e6)
);
assert_eq!(
query_short_reward_weight(Decimal::percent(1))
.unwrap()
.short_reward_weight,
Decimal::from_ratio(634168u128, e7),
Decimal::from_ratio(1585420u128, e7),
);
assert_eq!(
query_short_reward_weight(Decimal::percent(2))
.unwrap()
.short_reward_weight,
Decimal::percent(20)
Decimal::percent(50)
);
assert_eq!(
query_short_reward_weight(Decimal::percent(4))
.unwrap()
.short_reward_weight,
Decimal::from_ratio(3908998u128, e7)
Decimal::from_ratio(9772495u128, e7)
);
assert_eq!(
query_short_reward_weight(Decimal::percent(8))
.unwrap()
.short_reward_weight,
Decimal::percent(40)
Decimal::percent(100)
);
assert_eq!(
query_short_reward_weight(Decimal::percent(15))
.unwrap()
.short_reward_weight,
Decimal::percent(40)
Decimal::percent(100)
);
}

Expand Down