trading

Installation
SKILL.md

GDEX Trading

For Claude: How to Use This Skill

Skill instructions are preloaded in context when this skill is active. Do not perform filesystem searches or tool-driven exploration to rediscover them; use the guidance below directly.

Overview

GDEX Trading gives AI agents access to cross-chain DeFi operations via managed-custody wallets. Agents can trade spot markets, open and manage perpetual futures positions, bridge assets, discover tokens, and monitor portfolios — all through a single unified API at https://trade-api.gemach.io/v1.

Supported chains: Solana, Sui, Ethereum, Base, Arbitrum, BSC, Avalanche, Polygon, and 8+ additional EVM networks.

Available Sub-Skills

Sub-skill Purpose
gdex-authentication API key login, session management
gdex-onboarding New user wallet setup and verification
gdex-wallet-setup Wallet configuration and key management
gdex-spot-trading Market buy/sell on any supported chain
gdex-perp-trading Open, close, and manage perp positions
gdex-perp-funding Deposit/withdraw perp margin
gdex-perp-copy-trading Copy top-trader perp strategies
gdex-copy-trading Copy top-trader spot strategies
gdex-limit-orders Place, update, and cancel limit orders
gdex-portfolio View balances, positions, trade history
gdex-token-discovery Trending tokens, OHLCV, token details
gdex-bridge Estimate and execute cross-chain bridges
gdex-ui-install-setup Frontend SDK install and setup
gdex-ui-page-layouts UI page layout components
gdex-ui-portfolio-dashboard Portfolio dashboard UI
gdex-ui-theming Theme and styling configuration
gdex-ui-trading-components Trading UI components
gdex-ui-wallet-connection Wallet connection UI
gdex-sdk-debugging SDK debugging and error diagnostics

Quick Decision Guide

  • Buy or sell a tokengdex-spot-trading
  • Open a leveraged positiongdex-perp-trading
  • Bridge assets cross-chaingdex-bridge
  • Find trending tokens or price datagdex-token-discovery
  • Check portfolio or balancesgdex-portfolio
  • Place limit ordersgdex-limit-orders
  • Follow top tradersgdex-copy-trading or gdex-perp-copy-trading
  • First-time setupgdex-authentication then gdex-onboarding

Installation

npm install @gdexsdk/gdex-skill

Authentication

GDEX uses a two-layer auth model:

  1. API Key — shared keys available via the GDEX dashboard or community keys. Set GDEX_API_KEY in your environment or call loginWithApiKey(apiKey).
  2. Managed-custody signing — trading actions require a secp256k1 session key derived from your control wallet's private key (CONTROL_WALLET_PRIVATE_KEY). The SDK handles AES-256-CBC payload encryption and SHA256 key derivation automatically.
import { GdexSkill } from '@gdexsdk/gdex-skill';

const skill = new GdexSkill();
await skill.loginWithApiKey(process.env.GDEX_API_KEY);

Critical Notes

  • walletAddress is your CONTROL address, NOT the managed address. Always use the control wallet address for authentication and identity fields.
  • Solana chainId is 622112261, not 900. Using the wrong value causes silent failures.
  • hlCloseAll is unreliable — use reduce-only orders instead to close Hyperliquid perp positions.
  • hlUpdateLeverage is not implemented on the backend; use set_perp_leverage instead.

Environment Variables

GDEX_API_KEY=                    # Shared API key
CONTROL_WALLET_PRIVATE_KEY=      # Control wallet private key (for managed-custody trading)

Source Repository

Full SDK source, examples, and sub-skill implementations: https://github.com/GemachDAO/gdex-skill

Related skills
Installs
1
GitHub Stars
5
First Seen
Mar 21, 2026