From e3fbc2b60a1168480046e0ed3ac909ff67bc1438 Mon Sep 17 00:00:00 2001 From: calintje Date: Thu, 7 Nov 2024 23:55:01 +0100 Subject: [PATCH 1/6] Fix broken links --- .../03-Whirlpool Management/01-Create Pool.md | 2 +- legacy-sdk/scripts/genExpBitConstants.ts | 2 +- legacy-sdk/scripts/whirlpoolNft.json | 1 + .../src/network/public/fetcher/fetcher-impl.ts | 2 +- .../integration/open_position_with_metadata.test.ts | 10 +++++----- legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts | 2 +- .../src/instructions/open_position_with_metadata.rs | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/whirlpool/docs/03-Whirlpools SDKs/03-Whirlpools/03-Whirlpool Management/01-Create Pool.md b/docs/whirlpool/docs/03-Whirlpools SDKs/03-Whirlpools/03-Whirlpool Management/01-Create Pool.md index 728db7795..767cf176a 100644 --- a/docs/whirlpool/docs/03-Whirlpools SDKs/03-Whirlpools/03-Whirlpool Management/01-Create Pool.md +++ b/docs/whirlpool/docs/03-Whirlpools SDKs/03-Whirlpools/03-Whirlpool Management/01-Create Pool.md @@ -53,7 +53,7 @@ Splash Pools are the easiest way to get started: Concentrated Liquidity Pools offer more flexibility: 1. **Token Mint Addresses**: Provide the two token mints. -2. **Tick Spacing**: Set the tick spacing, which defines the intervals for price ticks. Visit [this link](https://orca-so.gitbook.io/orca-developer-portal/whirlpools/interacting-with-the-protocol/orca-whirlpools-parameters#initialized-feetier-and-tickspacing) to learn more about the available values of tick spacing and their corresponding fee rates. +2. **Tick Spacing**: Set the tick spacing, which defines the intervals for price ticks. Visit the [Whirlpools Parameters](../../../02-Architecture%20Overview/06-Whirlpool%20Parameters.mdx) page to learn more about the available values of tick spacing and their corresponding fee rates. 3. **Initial Price**: Specify the initial price of token 1 in terms of token 2. 4. **Funder**: This can be your wallet, which will fund the pool initialization. If the funder is not specified, the default wallet will be used. You can configure the default wallet through the SDK. 5. **Create instructions**: Use the appropriate function to create the pool. diff --git a/legacy-sdk/scripts/genExpBitConstants.ts b/legacy-sdk/scripts/genExpBitConstants.ts index 092141cc5..29ea5212c 100644 --- a/legacy-sdk/scripts/genExpBitConstants.ts +++ b/legacy-sdk/scripts/genExpBitConstants.ts @@ -6,7 +6,7 @@ Decimal.set({ precision: 40, rounding: 4 }); * in Whirlpools. * * Explanation on what magic numbers are: - * https://www.notion.so/orcaso/Fixed-Point-Arithmetic-in-Whirlpools-63f9817a852b4029a6eb15dc755c7baf#5df2cfe5d62b4b0aa7e58f5f381c2d55 + * https://orcaso.notion.site/External-Tick-Math-Documentation-0dd30688f6a74478a42ffe18968262a9 */ const x64 = new Decimal(2).pow(64); diff --git a/legacy-sdk/scripts/whirlpoolNft.json b/legacy-sdk/scripts/whirlpoolNft.json index 6a3d0fdab..86b789673 100644 --- a/legacy-sdk/scripts/whirlpoolNft.json +++ b/legacy-sdk/scripts/whirlpoolNft.json @@ -9,3 +9,4 @@ "family": "Orca Whirlpool Position" } } +?? \ No newline at end of file diff --git a/legacy-sdk/whirlpool/src/network/public/fetcher/fetcher-impl.ts b/legacy-sdk/whirlpool/src/network/public/fetcher/fetcher-impl.ts index ed0e0b6da..e9ac433db 100644 --- a/legacy-sdk/whirlpool/src/network/public/fetcher/fetcher-impl.ts +++ b/legacy-sdk/whirlpool/src/network/public/fetcher/fetcher-impl.ts @@ -74,7 +74,7 @@ export class WhirlpoolAccountFetcher async getAccountRentExempt(refresh: boolean = false): Promise { // This value should be relatively static or at least not break according to spec - // https://docs.solana.com/developing/programming-model/accounts#rent-exemption + // https://solana.com/docs/terminology#rent-exempt if (!this._accountRentExempt || refresh) { this._accountRentExempt = await this.connection.getMinimumBalanceForRentExemption( diff --git a/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts b/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts index 9599dd2ea..c516dbc4e 100644 --- a/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts +++ b/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts @@ -393,7 +393,7 @@ describe("open_position_with_metadata", () => { .addSigner(defaultMint) .buildAndExecute(), // Invalid Metadata Key - // https://github.com/metaplex-foundation/metaplex-program-library/blob/master/token-metadata/program/src/error.rs#L36 + // https://github.com/metaplex-foundation/mpl-token-metadata/blob/2f93406c62e791ee93435644c1a3507e910a116b/programs/token-metadata/program/src/error.rs#L32 /0x5/, ); }); @@ -413,7 +413,7 @@ describe("open_position_with_metadata", () => { await assert.rejects( tx.addSigner(defaultMint).buildAndExecute(), // InvalidProgramId - // https://github.com/project-serum/anchor/blob/master/lang/src/error.rs#L180 + // https://github.com/coral-xyz/anchor/blob/eee03bc7c31ddc99bf3dbe1630283d9226aa7b9c/lang/src/error.rs#L231 /0xbc0/, ); }); @@ -432,7 +432,7 @@ describe("open_position_with_metadata", () => { await assert.rejects( tx.addSigner(defaultMint).buildAndExecute(), // InvalidProgramId - // https://github.com/project-serum/anchor/blob/master/lang/src/error.rs#L180 + // https://github.com/coral-xyz/anchor/blob/eee03bc7c31ddc99bf3dbe1630283d9226aa7b9c/lang/src/error.rs#L231 /0xbc0/, ); }); @@ -451,8 +451,8 @@ describe("open_position_with_metadata", () => { await assert.rejects( tx.addSigner(defaultMint).buildAndExecute(), - // AddressConstraint - // https://github.com/project-serum/anchor/blob/master/lang/src/error.rs#L84 + // ConstraintAddress + // https://github.com/coral-xyz/anchor/blob/eee03bc7c31ddc99bf3dbe1630283d9226aa7b9c/lang/src/error.rs#L92C5-L92C22 /0x7dc/, ); }); diff --git a/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts b/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts index ef5a1797a..8a063543e 100644 --- a/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts +++ b/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts @@ -197,7 +197,7 @@ async function createMintInstructions( // ConfidentialTransfer // [March 6, 2024] getTypeLen(ExtensionType.ConfidentialTransferMint) return 97, but 65 (2 pubkey + 1 bool) is valid - // https://github.com/solana-labs/solana-program-library/blob/d72289c79a04411c69a8bf1054f7156b6196f9b3/token/js/src/extensions/extensionType.ts#L74 + // https://github.com/solana-labs/solana-program-library/blob/d72289c79a04411c69a8bf1054f7156b6196f9b3/token/js/src/extensions/extensionType.ts#L73 let confidentialTransferMintSizePatch = 0; if (tokenTrait.hasConfidentialTransferExtension) { fixedLengthExtensions.push(ExtensionType.ConfidentialTransferMint); diff --git a/programs/whirlpool/src/instructions/open_position_with_metadata.rs b/programs/whirlpool/src/instructions/open_position_with_metadata.rs index de68ae076..3c0c36aed 100644 --- a/programs/whirlpool/src/instructions/open_position_with_metadata.rs +++ b/programs/whirlpool/src/instructions/open_position_with_metadata.rs @@ -32,7 +32,7 @@ pub struct OpenPositionWithMetadata<'info> { pub position_mint: Account<'info, Mint>, /// CHECK: checked via the Metadata CPI call - /// https://github.com/metaplex-foundation/metaplex-program-library/blob/master/token-metadata/program/src/utils.rs#L873 + /// https://github.com/metaplex-foundation/mpl-token-metadata/blob/2f93406c62e791ee93435644c1a3507e910a116b/programs/token-metadata/program/src/utils/metadata.rs#L78C5-L78C39 #[account(mut)] pub position_metadata_account: UncheckedAccount<'info>, From 040750f965a79343e1c2e0e7ea0dad5909b63bf9 Mon Sep 17 00:00:00 2001 From: calintje Date: Fri, 8 Nov 2024 00:26:32 +0100 Subject: [PATCH 2/6] Resolve comment --- legacy-sdk/scripts/whirlpoolNft.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/legacy-sdk/scripts/whirlpoolNft.json b/legacy-sdk/scripts/whirlpoolNft.json index 86b789673..b1c953851 100644 --- a/legacy-sdk/scripts/whirlpoolNft.json +++ b/legacy-sdk/scripts/whirlpoolNft.json @@ -8,5 +8,4 @@ "name": "Orca Whirlpool Position", "family": "Orca Whirlpool Position" } -} -?? \ No newline at end of file +} \ No newline at end of file From b8612e4357c4543847e18c9a73be48dbe27975e4 Mon Sep 17 00:00:00 2001 From: calintje Date: Fri, 8 Nov 2024 00:34:57 +0100 Subject: [PATCH 3/6] Resolve comments --- .../tests/integration/open_position_with_metadata.test.ts | 4 ++-- .../whirlpool/src/instructions/open_position_with_metadata.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts b/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts index c516dbc4e..84cd5cd3f 100644 --- a/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts +++ b/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts @@ -393,7 +393,7 @@ describe("open_position_with_metadata", () => { .addSigner(defaultMint) .buildAndExecute(), // Invalid Metadata Key - // https://github.com/metaplex-foundation/mpl-token-metadata/blob/2f93406c62e791ee93435644c1a3507e910a116b/programs/token-metadata/program/src/error.rs#L32 + // https://github.com/metaplex-foundation/mpl-token-metadata/blob/main/programs/token-metadata/program/src/error.rs#L34-L36 /0x5/, ); }); @@ -413,7 +413,7 @@ describe("open_position_with_metadata", () => { await assert.rejects( tx.addSigner(defaultMint).buildAndExecute(), // InvalidProgramId - // https://github.com/coral-xyz/anchor/blob/eee03bc7c31ddc99bf3dbe1630283d9226aa7b9c/lang/src/error.rs#L231 + // https://github.com/coral-xyz/anchor/blob/master/lang/src/error.rs#L231 /0xbc0/, ); }); diff --git a/programs/whirlpool/src/instructions/open_position_with_metadata.rs b/programs/whirlpool/src/instructions/open_position_with_metadata.rs index 3c0c36aed..45af04fe3 100644 --- a/programs/whirlpool/src/instructions/open_position_with_metadata.rs +++ b/programs/whirlpool/src/instructions/open_position_with_metadata.rs @@ -32,7 +32,7 @@ pub struct OpenPositionWithMetadata<'info> { pub position_mint: Account<'info, Mint>, /// CHECK: checked via the Metadata CPI call - /// https://github.com/metaplex-foundation/mpl-token-metadata/blob/2f93406c62e791ee93435644c1a3507e910a116b/programs/token-metadata/program/src/utils/metadata.rs#L78C5-L78C39 + /// https://github.com/metaplex-foundation/mpl-token-metadata/blob/2f93406c62e791ee93435644c1a3507e910a116b/programs/token-metadata/program/src/utils/metadata.rs#L78 #[account(mut)] pub position_metadata_account: UncheckedAccount<'info>, From acfb5d464a84a897a99624f2746ab70aebb13c01 Mon Sep 17 00:00:00 2001 From: calintje Date: Fri, 8 Nov 2024 00:47:43 +0100 Subject: [PATCH 4/6] Resolve comments --- .../tests/integration/open_position_with_metadata.test.ts | 6 +++--- legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts b/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts index 84cd5cd3f..b1b736a10 100644 --- a/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts +++ b/legacy-sdk/whirlpool/tests/integration/open_position_with_metadata.test.ts @@ -413,7 +413,7 @@ describe("open_position_with_metadata", () => { await assert.rejects( tx.addSigner(defaultMint).buildAndExecute(), // InvalidProgramId - // https://github.com/coral-xyz/anchor/blob/master/lang/src/error.rs#L231 + // https://github.com/coral-xyz/anchor/blob/v0.29.0/lang/src/error.rs#L178-L180 /0xbc0/, ); }); @@ -432,7 +432,7 @@ describe("open_position_with_metadata", () => { await assert.rejects( tx.addSigner(defaultMint).buildAndExecute(), // InvalidProgramId - // https://github.com/coral-xyz/anchor/blob/eee03bc7c31ddc99bf3dbe1630283d9226aa7b9c/lang/src/error.rs#L231 + // https://github.com/coral-xyz/anchor/blob/v0.29.0/lang/src/error.rs#L178-L180 /0xbc0/, ); }); @@ -452,7 +452,7 @@ describe("open_position_with_metadata", () => { await assert.rejects( tx.addSigner(defaultMint).buildAndExecute(), // ConstraintAddress - // https://github.com/coral-xyz/anchor/blob/eee03bc7c31ddc99bf3dbe1630283d9226aa7b9c/lang/src/error.rs#L92C5-L92C22 + // https://github.com/coral-xyz/anchor/blob/v0.29.0/lang/src/error.rs#L89-L91 /0x7dc/, ); }); diff --git a/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts b/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts index 8a063543e..786b9c3ce 100644 --- a/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts +++ b/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts @@ -197,7 +197,7 @@ async function createMintInstructions( // ConfidentialTransfer // [March 6, 2024] getTypeLen(ExtensionType.ConfidentialTransferMint) return 97, but 65 (2 pubkey + 1 bool) is valid - // https://github.com/solana-labs/solana-program-library/blob/d72289c79a04411c69a8bf1054f7156b6196f9b3/token/js/src/extensions/extensionType.ts#L73 + // https://github.com/solana-labs/solana-program-library/blob/master/token/js/src/extensions/extensionType.ts#L80 let confidentialTransferMintSizePatch = 0; if (tokenTrait.hasConfidentialTransferExtension) { fixedLengthExtensions.push(ExtensionType.ConfidentialTransferMint); From 44b98e8469c59c8706490744154b57f95fc2536e Mon Sep 17 00:00:00 2001 From: calintje Date: Fri, 8 Nov 2024 00:50:44 +0100 Subject: [PATCH 5/6] Fix link --- .../whirlpool/src/instructions/open_position_with_metadata.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/whirlpool/src/instructions/open_position_with_metadata.rs b/programs/whirlpool/src/instructions/open_position_with_metadata.rs index 45af04fe3..6caacadcd 100644 --- a/programs/whirlpool/src/instructions/open_position_with_metadata.rs +++ b/programs/whirlpool/src/instructions/open_position_with_metadata.rs @@ -32,7 +32,7 @@ pub struct OpenPositionWithMetadata<'info> { pub position_mint: Account<'info, Mint>, /// CHECK: checked via the Metadata CPI call - /// https://github.com/metaplex-foundation/mpl-token-metadata/blob/2f93406c62e791ee93435644c1a3507e910a116b/programs/token-metadata/program/src/utils/metadata.rs#L78 + /// https://github.com/metaplex-foundation/mpl-token-metadata/blob/master/programs/token-metadata/program/src/utils/metadata.rs#L78 #[account(mut)] pub position_metadata_account: UncheckedAccount<'info>, From d1fb0b22334e75cde134dbf159ded52509830436 Mon Sep 17 00:00:00 2001 From: calintje Date: Fri, 8 Nov 2024 00:52:24 +0100 Subject: [PATCH 6/6] Revert change --- legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts b/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts index 786b9c3ce..ef5a1797a 100644 --- a/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts +++ b/legacy-sdk/whirlpool/tests/utils/v2/token-2022.ts @@ -197,7 +197,7 @@ async function createMintInstructions( // ConfidentialTransfer // [March 6, 2024] getTypeLen(ExtensionType.ConfidentialTransferMint) return 97, but 65 (2 pubkey + 1 bool) is valid - // https://github.com/solana-labs/solana-program-library/blob/master/token/js/src/extensions/extensionType.ts#L80 + // https://github.com/solana-labs/solana-program-library/blob/d72289c79a04411c69a8bf1054f7156b6196f9b3/token/js/src/extensions/extensionType.ts#L74 let confidentialTransferMintSizePatch = 0; if (tokenTrait.hasConfidentialTransferExtension) { fixedLengthExtensions.push(ExtensionType.ConfidentialTransferMint);