mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-24 15:10:46 +00:00
Finish Orca tools
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
||||
orcaCreateSingleSidedLiquidityPool,
|
||||
orcaCreateCLMM,
|
||||
orcaOpenCenteredPositionWithLiquidity,
|
||||
orcaOpenSingleSidedPosition,
|
||||
FEE_TIERS,
|
||||
fetchPrice,
|
||||
pythFetchPrice,
|
||||
@@ -37,6 +38,8 @@ import {
|
||||
getOwnedAllDomains,
|
||||
resolveAllDomains,
|
||||
create_gibwork_task,
|
||||
orcaClosePosition,
|
||||
orcaFetchPositions,
|
||||
} from "../tools";
|
||||
|
||||
import {
|
||||
@@ -202,23 +205,32 @@ export class SolanaAgentKit {
|
||||
);
|
||||
}
|
||||
|
||||
async orcaClosePosition(
|
||||
positionMintAddress: PublicKey,
|
||||
) {
|
||||
return orcaClosePosition(
|
||||
this,
|
||||
positionMintAddress,
|
||||
);
|
||||
}
|
||||
|
||||
async orcaCreateCLMM(
|
||||
mintA: PublicKey,
|
||||
mintB: PublicKey,
|
||||
mintDeploy: PublicKey,
|
||||
mintPair: PublicKey,
|
||||
initialPrice: Decimal,
|
||||
feeTier: keyof typeof FEE_TIERS,
|
||||
) {
|
||||
return orcaCreateCLMM(
|
||||
this,
|
||||
mintA,
|
||||
mintB,
|
||||
mintDeploy,
|
||||
mintPair,
|
||||
initialPrice,
|
||||
feeTier,
|
||||
);
|
||||
}
|
||||
|
||||
async orcaCreateSingleSidedLiquidityPool(
|
||||
depositTokenAmount: BN,
|
||||
depositTokenAmount: number,
|
||||
depositTokenMint: PublicKey,
|
||||
otherTokenMint: PublicKey,
|
||||
initialPrice: Decimal,
|
||||
@@ -236,6 +248,13 @@ export class SolanaAgentKit {
|
||||
);
|
||||
}
|
||||
|
||||
async orcaFetchPositions(
|
||||
) {
|
||||
return orcaFetchPositions(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
async orcaOpenCenteredPositionWithLiquidity(
|
||||
whirlpoolAddress: PublicKey,
|
||||
priceOffsetBps: number,
|
||||
@@ -251,6 +270,23 @@ export class SolanaAgentKit {
|
||||
);
|
||||
}
|
||||
|
||||
async orcaOpenSingleSidedPosition(
|
||||
whirlpoolAddress: PublicKey,
|
||||
distanceFromCurrentPriceBps: number,
|
||||
widthBps: number,
|
||||
inputTokenMint: PublicKey,
|
||||
inputAmount: Decimal,
|
||||
): Promise<string> {
|
||||
return orcaOpenSingleSidedPosition(
|
||||
this,
|
||||
whirlpoolAddress,
|
||||
distanceFromCurrentPriceBps,
|
||||
widthBps,
|
||||
inputTokenMint,
|
||||
inputAmount,
|
||||
);
|
||||
}
|
||||
|
||||
async resolveAllDomains(domain: string): Promise<PublicKey | undefined> {
|
||||
return resolveAllDomains(this, domain);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user