Krystal DeFi API

VerifiedCaution

Provides DeFi liquidity pool data, vault management, user positions, and LP transaction-building via the Krystal API.

Sby Skills Guide Bot
DevelopmentAdvanced
7/26/2026
Claude CodeCursor
#defi#liquidity-pools#web3#api-integration#transaction-building

Recommended for

Automated summary

Surfaces Krystal API data on DeFi liquidity pools, vaults and LP positions, plus LP transaction building (zap-in, zap-out, compound, rebalancing) across 13+ blockchains.

Strengths

  • Covers the full LP position lifecycle: pool discovery, opening, adding liquidity, withdrawing, compounding and range adjustment.
  • Handles multi-chain quirks explicitly, such as nftMintAddress and buildTx=true on Solana versus signing txData directly on EVM.
  • Documents useful edge cases, including liquidityPercent=0 to claim only fees while leaving principal in the pool.
  • Keeps slippage controls distinct per action (swapSlippage, liquiditySlippage, withdrawSlippage).

Limitations

  • Examples are curl calls returning raw txData; signing and broadcasting through a web3 provider is left entirely to the user.
  • Computing ticks aligned to the pool's tickSpacing and judging vault risk are not automated.
  • The documentation is split across many reference files (reference/lp-actions/*, vaults, positions) that must be loaded individually.
When to use it

Use it when you need to query pools or LP positions, or build a DeFi transaction (zap-in, zap-out, compound, rebalance) through the Krystal API on EVM or Solana.

When not to use it

Avoid it for general market data or spot trading, or when you want end-to-end on-chain execution without managing a web3 provider.

Security analysis

Caution
Quality score86/100

The skill is primarily API documentation for a DeFi service and contains no destructive, obfuscated, or exfiltration behavior. However, it explicitly guides agents through building, signing, and sending financial transactions, so it warrants caution rather than being fully safe.

Findings
  • •Instructs agents to sign and send `txData` for real on-chain DeFi transactions; this is financially sensitive and should require explicit user confirmation.
  • •Uses network API calls and `curl` examples for legitimate pool/vault data retrieval, but still requires network access.
  • •No private-key handling or secret exfiltration is specified, but transaction signing must be handled by a secure wallet/provider.
How this analysis is made

Examples

Discover top pools
Use the Krystal API to list the top liquidity pools across all chains, then show me the TVL, volume and APR for the best Base pools.
Claim fees only
Zap out my Uniswap v3 position tokenId 12345 on Base with liquidityPercent=0 so I only claim the fees, swapping them to USDC, and build the txData.
Rebalance a position
Rebalance my LP position tokenId 12345 on Arbitrum: fetch the pool tickSpacing from Pool Detail, pick a new range around the current price, and build the adjust-range transaction.

name: krystal-defi-api description: Provides DeFi liquidity pool data, vault management, user positions, and LP transaction-building via the Krystal API. Use for pool analytics (TVL/volume/APR), listing positions (including single-position lookup by positionId), and LP actions like zap-in, zap-out (including fee-claim via liquidityPercent=0), swap-and-increase, adjust-range (rebalance), and compound across chains like Ethereum, BSC, Polygon, Arbitrum, Base, and Solana.

Krystal API

DeFi liquidity pool explorer and transaction API supporting 13+ blockchains.

Quick Start

Base URL: https://api.krystal.app

# Get top pools across all chains
curl "https://api.krystal.app/all/v2/lp_explorer/top_pools?skipCheckAutomation=true"

# Get pool details
curl "https://api.krystal.app/all/v1/lp_explorer/pool_detail?chainId=8453&poolAddress=0x..."

Instructions

Finding Pools

  1. Use Top Pools to discover high-performing pools
  2. Use Pool Detail for specific pool information
  3. Use Pool Chart for liquidity distribution visualization

Creating LP Positions

  1. Get pool details including tickSpacing from Pool Detail
  2. Calculate tick range aligned with pool's tick spacing
  3. Use Zap In to build the transaction
  4. Sign and send txData using a web3 provider

Increasing Liquidity (Swap and Increase)

  1. Get position tokenId from User Positions (for Solana, also pass nftMintAddress)
  2. Use Swap and Increase with tokenInAddress, amountIn, swapSlippage, and liquiditySlippage
  3. Set fundFromOwner=true and isVault=true when adding to a Krystal auto-farm vault position
  4. Sign and send txData using a web3 provider (same as Zap In)

Withdrawing LP Positions (Zap Out)

  1. Get position tokenId from User Positions (for Solana, also pass nftMintAddress)
  2. Use Zap Out with targetToken, liquidityPercent, swapSlippage, and withdrawSlippage
    • Set liquidityPercent = 0 to claim only fees (principal stays in the pool; claimed tokens are swapped to targetToken)
    • Use 0 < liquidityPercent ≤ 1 to withdraw principal liquidity (plus any fees) to targetToken
  3. Sign and send txData using a web3 provider (same as Zap In)

Compounding Fees into a Position

  1. Get position tokenId from User Positions (for Solana, also pass nftMintAddress)
  2. Use Compound with swapSlippage and liquiditySlippage to reinvest unclaimed fees back into the same position
  3. Set isVault=true when compounding a Krystal auto-farm vault position
  4. Sign and send txData using a web3 provider

Rebalancing Positions (Adjust Range)

  1. Get position tokenId from User Positions (for Solana, also pass nftMintAddress)
  2. Get pool tickSpacing from Pool Detail and choose new newTickLower and newTickUpper aligned with it
  3. Use Adjust Range with swapSlippage, liquiditySlippage, and withdrawSlippage
  4. On EVM chains, sign and send txData directly. On Solana, call with buildTx=true first to get txData, then sign and send it.

Exploring Vaults

  1. Use Vaults to list available vaults
  2. Filter by category (ALL_VAULT, NEW_VAULT, BOOST_VAULT) and isAutoFarmVault to narrow results
  3. Evaluate vaults by tvl, apr, riskScore, and vaultSecurities
  4. Use Vault Profile Stats to get a wallet's aggregate vault statistics (owned, joined, yields, PnL)

Viewing Positions

  1. Use User Positions to list a wallet's liquidity positions
  2. Check statsByChain["all"] for aggregate portfolio metrics (total PnL, APR, unclaimed fees)
  3. Filter by chainIds or positionStatus (open/closed) to narrow results
  4. Evaluate individual positions by pnl, apr, impermanentLoss, compareWithHodl, and status (IN_RANGE/OUT_RANGE)
  5. Use refreshAll=true for fresh on-chain data (slower) or omit for cached data (faster)

Wallet Operations

  1. Use Token Search to get user's token balances
  2. Select input token for swap/zap operations

Key Conventions

  • Always use skipCheckAutomation=true for faster responses
  • Monetary values: Returned as strings to preserve precision
  • APR values: Returned as numbers (percentages)
  • Native tokens: Use NativeTokenAddress placeholders
  • Amounts: Always in wei (smallest unit)

Endpoints Reference

| Endpoint | Purpose | |----------|---------| | Top Pools | Discover pools by TVL, volume, APR | | Pool Detail | Get pool info, tick spacing, incentives | | Pool Chart | Liquidity distribution and price history | | Zap In | Build swap + mint transaction | | Swap and Increase | Add liquidity to existing position (swap + increase) | | Zap Out | Build withdraw + swap transaction | | Compound | Reinvest unclaimed fees into existing position | | Adjust Range | Rebalance position to new tick range | | User Positions | List wallet LP positions & stats | | Vaults | List shared & auto-farm vaults | | Token Search | Query wallet token balances |

Types Reference

See types.md for complete type definitions:

Core Types: Token, Pool, PoolDetail, ChainId, LPProtocolAlias

Chart Types: PoolChartData, Tick, PricePoint

Transaction Types: TxData, ZapTxInfo, SwapAmount

Position Types: UserPosition, PositionChainStats, PositionTokenAmount, PositionPool

Vault Types: Vault, VaultOwner, VaultSecurity, VaultStats

Wallet Types: WalletToken, TokenBalance

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/krystal-defi-api-ms1aw4xq/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/krystal-defi-api-ms1aw4xq' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/krystal-defi-api-ms1aw4xq/download' --output '.skill-downloads/krystal-defi-api-ms1aw4xq/SKILL.md.part' && mv '.skill-downloads/krystal-defi-api-ms1aw4xq/SKILL.md.part' '.skill-downloads/krystal-defi-api-ms1aw4xq/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/krystal-defi-api-ms1aw4xq/SKILL.md' && test -s '.skill-downloads/krystal-defi-api-ms1aw4xq/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/krystal-defi-api' && cp -R '.skill-downloads/krystal-defi-api-ms1aw4xq' '.claude/skills/krystal-defi-api'

Cursor
test -f '.skill-downloads/krystal-defi-api-ms1aw4xq/SKILL.md' && test -s '.skill-downloads/krystal-defi-api-ms1aw4xq/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/krystal-defi-api' && cp -R '.skill-downloads/krystal-defi-api-ms1aw4xq' '.cursor/skills/krystal-defi-api'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/krystal-defi-api-ms1aw4xq'

openskills read 'krystal-defi-api-ms1aw4xq'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/krystal-defi-api-ms1aw4xq/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills