fix: Update tests for Meteora

This commit is contained in:
quangkeu95
2025-01-11 08:39:51 +07:00
parent 2aaf3f86b7
commit 835a42aaec
7 changed files with 4998 additions and 9493 deletions

View File

@@ -63,6 +63,8 @@ import {
fetchPythPriceFeedID,
flashOpenTrade,
flashCloseTrade,
createMeteoraDynamicAMMPool,
createMeteoraDlmmPool,
} from "../tools";
import {
CollectionDeployment,
@@ -339,6 +341,57 @@ export class SolanaAgentKit {
);
}
async meteoraCreateDynamicPool(
tokenAMint: PublicKey,
tokenBMint: PublicKey,
tokenAAmount: BN,
tokenBAmount: BN,
tradeFeeNumerator: number,
activationPoint: BN | null,
hasAlphaVault: boolean,
activationType: number,
): Promise<string> {
return createMeteoraDynamicAMMPool(
this,
tokenAMint,
tokenBMint,
tokenAAmount,
tokenBAmount,
{
tradeFeeNumerator,
activationPoint,
hasAlphaVault,
activationType,
padding: new Array(90).fill(0),
},
);
}
async meteoraCreateDlmmPool(
binStep: number,
tokenAMint: PublicKey,
tokenBMint: PublicKey,
initialPrice: number,
priceRoundingUp: boolean,
feeBps: number,
activationType: number,
hasAlphaVault: boolean,
activationPoint: BN | undefined,
): Promise<string> {
return createMeteoraDlmmPool(
this,
binStep,
tokenAMint,
tokenBMint,
initialPrice,
priceRoundingUp,
feeBps,
activationType,
hasAlphaVault,
activationPoint,
);
}
async orcaClosePosition(positionMintAddress: PublicKey) {
return orcaClosePosition(this, positionMintAddress);
}

View File

@@ -34,4 +34,9 @@ export const JUP_API = "https://quote-api.jup.ag/v6";
export const JUP_REFERRAL_ADDRESS =
"REFER4ZgmyYx9c6He5XfaTMiGfdLwRnkV4RPp9t9iF3";
export const METEORA_DYNAMIC_AMM_PROGRAM_ID = new PublicKey("Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB");
export const METEORA_DYNAMIC_AMM_PROGRAM_ID = new PublicKey(
"Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB",
);
export const METEORA_DLMM_PROGRAM_ID = new PublicKey(
"LbVRzDTvBDEcrthxfZ4RL6yiq3uZw8bS6MwtdY6UhFQ",
);