Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .changeset/healthy-chicken-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, what is this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philcchen
Thanks for the review.

Changeset have been introduced recently.
It is used to publish SDK packages with auto-increment on semver.
https://github.com/orca-so/whirlpools?tab=readme-ov-file#changesets

This change doesn't affect client-side code, so I executed yarn changeset --empty and this file is generated. 🙂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: changelogs are also created for the program so an actual changeset would be nice!

---
5 changes: 5 additions & 0 deletions .changeset/witty-eyes-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@orca-so/whirlpools-program": patch
---

Increase MAX_FEE_RATE, new max fee rate is 6%
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe("initialize_fee_tier", () => {
configInitInfo,
configKeypairs.feeAuthorityKeypair,
testTickSpacing,
30_000, // 3 %
60_000, // 6 %
);

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

assert.ok(feeTierAccount.tickSpacing == params.tickSpacing);
assert.ok(feeTierAccount.defaultFeeRate == params.defaultFeeRate);
assert.ok(params.defaultFeeRate === 30_000);
assert.ok(params.defaultFeeRate === 60_000);
});

it("successfully init a FeeRate with another funder wallet", async () => {
Expand Down Expand Up @@ -135,7 +135,7 @@ describe("initialize_fee_tier", () => {
configInitInfo,
configKeypairs.feeAuthorityKeypair,
TickSpacing.Stable,
30_000 + 1,
60_000 + 1,
),
/0x178c/, // FeeRateMaxExceeded
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe("set_default_fee_rate", () => {
configInitInfo.whirlpoolsConfigKeypair.publicKey;
const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair;

const newDefaultFeeRate = 30_000;
const newDefaultFeeRate = 60_000;

await toTx(
ctx,
Expand Down Expand Up @@ -148,7 +148,7 @@ describe("set_default_fee_rate", () => {
configInitInfo.whirlpoolsConfigKeypair.publicKey;
const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair;

const newDefaultFeeRate = 30_000 + 1;
const newDefaultFeeRate = 60_000 + 1;
await assert.rejects(
toTx(
ctx,
Expand Down
4 changes: 2 additions & 2 deletions legacy-sdk/whirlpool/tests/integration/set_fee_rate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe("set_fee_rate", () => {
configInitInfo.whirlpoolsConfigKeypair.publicKey;
const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair;

const newFeeRate = 30_000;
const newFeeRate = 60_000;

let whirlpool = (await fetcher.getPool(
whirlpoolKey,
Expand Down Expand Up @@ -98,7 +98,7 @@ describe("set_fee_rate", () => {
configInitInfo.whirlpoolsConfigKeypair.publicKey;
const feeAuthorityKeypair = configKeypairs.feeAuthorityKeypair;

const newFeeRate = 30_000 + 1;
const newFeeRate = 60_000 + 1;
await assert.rejects(
toTx(
ctx,
Expand Down
4 changes: 2 additions & 2 deletions programs/whirlpool/src/math/token_math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use super::{

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

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