Adrena Protocol Integration

Learn how to use perpetual trading functionality with Adrena Protocol

Ping Agent Kit provides comprehensive integration with Adrena Protocol for perpetual trading. The integration supports both long and short positions with configurable leverage and slippage parameters.

  • Long/Short position trading

  • Configurable leverage up to 100x

  • Slippage protection

  • Automated token account setup

  • Price feed integration

Copy

const signature = await agent.methods.openPerpTradeLong({
  price: 300, // USD price
  collateralAmount: 10, // Amount of collateral
  collateralMint: new PublicKey("J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn"), // jitoSOL
  leverage: 50000, // 5x leverage (10000 = 1x)
  tradeMint: new PublicKey("J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn"), // Trading asset
  slippage: 0.3, // 0.3% slippage tolerance
});

Copy

Copy

Copy

Ping Agent Kit provides LangChain tools for automated trading:

Copy

Copy

For LangChain AI tools, here are example prompts:

Copy

Copy

  1. Leverage Configuration

    • Leverage is specified in basis points (10000 = 1x)

    • Maximum leverage varies by market

    • Example: 50000 = 5x leverage

  2. Collateral Types

    • Long positions: Use same token as tradeMint to avoid swaps

    • Short positions: USDC recommended as collateral

  3. Price and Slippage

    • Price in USD

    • Slippage as percentage (0.3 = 0.3%)

    • Always monitor price impact before trading

Copy

Copy

Copy

Copy

  • jitoSOL

  • USDC

  • Additional assets based on protocol liquidity

Last updated