Skip to content

Commit 0f478e7

Browse files
authored
Increase MAX_FEE_RATE (#743)
* increase MAX_FEE_RATE * changeset (no client side update) * add changeset to add change log
1 parent 51e6eeb commit 0f478e7

File tree

6 files changed

+16
-9
lines changed

6 files changed

+16
-9
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.changeset/witty-eyes-swim.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@orca-so/whirlpools-program": patch
3+
---
4+
5+
Increase MAX_FEE_RATE, new max fee rate is 6%

legacy-sdk/whirlpool/tests/integration/initialize_fee_tier.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe("initialize_fee_tier", () => {
8787
configInitInfo,
8888
configKeypairs.feeAuthorityKeypair,
8989
testTickSpacing,
90-
30_000, // 3 %
90+
60_000, // 6 %
9191
);
9292

9393
const feeTierAccount = (await fetcher.getFeeTier(
@@ -96,7 +96,7 @@ describe("initialize_fee_tier", () => {
9696

9797
assert.ok(feeTierAccount.tickSpacing == params.tickSpacing);
9898
assert.ok(feeTierAccount.defaultFeeRate == params.defaultFeeRate);
99-
assert.ok(params.defaultFeeRate === 30_000);
99+
assert.ok(params.defaultFeeRate === 60_000);
100100
});
101101

102102
it("successfully init a FeeRate with another funder wallet", async () => {
@@ -135,7 +135,7 @@ describe("initialize_fee_tier", () => {
135135
configInitInfo,
136136
configKeypairs.feeAuthorityKeypair,
137137
TickSpacing.Stable,
138-
30_000 + 1,
138+
60_000 + 1,
139139
),
140140
/0x178c/, // FeeRateMaxExceeded
141141
);

legacy-sdk/whirlpool/tests/integration/set_default_fee_rate.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe("set_default_fee_rate", () => {
9393
configInitInfo.whirlpoolsConfigKeypair.publicKey;
9494
const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair;
9595

96-
const newDefaultFeeRate = 30_000;
96+
const newDefaultFeeRate = 60_000;
9797

9898
await toTx(
9999
ctx,
@@ -148,7 +148,7 @@ describe("set_default_fee_rate", () => {
148148
configInitInfo.whirlpoolsConfigKeypair.publicKey;
149149
const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair;
150150

151-
const newDefaultFeeRate = 30_000 + 1;
151+
const newDefaultFeeRate = 60_000 + 1;
152152
await assert.rejects(
153153
toTx(
154154
ctx,

legacy-sdk/whirlpool/tests/integration/set_fee_rate.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe("set_fee_rate", () => {
6161
configInitInfo.whirlpoolsConfigKeypair.publicKey;
6262
const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair;
6363

64-
const newFeeRate = 30_000;
64+
const newFeeRate = 60_000;
6565

6666
let whirlpool = (await fetcher.getPool(
6767
whirlpoolKey,
@@ -98,7 +98,7 @@ describe("set_fee_rate", () => {
9898
configInitInfo.whirlpoolsConfigKeypair.publicKey;
9999
const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair;
100100

101-
const newFeeRate = 30_000 + 1;
101+
const newFeeRate = 60_000 + 1;
102102
await assert.rejects(
103103
toTx(
104104
ctx,

programs/whirlpool/src/math/token_math.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use super::{
88

99
// Fee rate is represented as hundredths of a basis point.
1010
// Fee amount = total_amount * fee_rate / 1_000_000.
11-
// Max fee rate supported is 3%.
12-
pub const MAX_FEE_RATE: u16 = 30_000;
11+
// Max fee rate supported is 6%.
12+
pub const MAX_FEE_RATE: u16 = 60_000;
1313

1414
// Assuming that FEE_RATE is represented as hundredths of a basis point
1515
// We want FEE_RATE_MUL_VALUE = 1/FEE_RATE_UNIT, so 1e6

0 commit comments

Comments
 (0)