Index of every page on this site: llms.txt
All skills
injectivelabs avatar

/injective-trading-chain-analysis

@6d68c2c
Run it yourself

Analyze Injective chain-level code and protocol specs. Read Go source from injective-core, explain exchange module features (position offsetting, liquidations, margin tiers, funding), and identify spec gaps. Use when discussing chain mechanics, reviewing Injective Go code, or explaining protocol behavior.

Use this Skill: https://skilld.dev/gh/injectivelabs/agent-skills/injective-trading-chain-analysis

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈85 tokens for metadata: the name and description. ≈744 when used: this file. ≈619 more on demand in 3 files.

Description uses 4.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈341 characters, or 4.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Injective Trading Chain Analysis, Skill Guide

Analyze Injective chain-level protocol code (Go/Cosmos SDK). Explain exchange module mechanics, review spec completeness, and trace execution paths for derivatives trading features.

When to apply

  • Understand how Injective's exchange module works under the hood

Sample prompts: ./references/sample-prompts.md

Important

Exchange module

Key files for the source code of the Injective exchange module may be found in: ./references/injective-core-key-files.md

Cosmos SDK Context

  • Injective is built on Cosmos SDK (currently v0.47.x)
  • Uses Tendermint BFT consensus
  • Exchange module is a custom Cosmos SDK module
  • State stored in IAVL tree via keeper pattern
  • Messages processed in DeliverTx phase of ABCI

Activities

Explain Injective's exchange module

The exchange module (x/exchange) handles all trading on Injective.

Key areas:

  • Derivative Markets
    • MsgCreateDerivativeMarketOrder / MsgCreateDerivativeLimitOrder
    • Position management: open, close, reduce, increase
    • Margin: initial margin, maintenance margin, margin ratio checks
    • Liquidation: forced closure when margin ratio < maintenance margin
  • Position Offsetting (MsgOffsetPosition)
    • Allows netting opposing positions between subaccounts
    • Reduces total margin requirements
    • Chain-level implementation in derivative_liquidations.go
  • Liquidation Engine
    • Triggered when position margin < maintenance margin requirement
    • Liquidator receives a portion of remaining margin as reward
    • Insurance fund covers negative PnL if position is underwater
    • Code path: derivative_liquidations.go → ExecuteLiquidation()
  • Funding Rates
    • Calculated every hour for perpetual markets
    • Formula: FundingRate = (TWAP_perp - TWAP_oracle) / TWAP_oracle
    • Capped by MaxFundingRate parameter per market
    • Applied to all open positions proportional to quantity
  • Market Parameters
    • InitialMarginRatio, MaintenanceMarginRatio
    • MakerFeeRate, TakerFeeRate (can be negative for rebates)
    • MinPriceTickSize, MinQuantityTickSize
    • OracleType, OracleScaleFactor

Analyze chain code

  1. Read the Go source from the user's local clone or fetch from GitHub (InjectiveLabs/injective-core)
  2. Trace the execution path from message handler → keeper → state changes
  3. Explain in plain English what the code does, step by step
  4. Identify spec gaps - what's missing, ambiguous, or could break
  5. Compare to docs - check if behavior matches published documentation

Related skills

  • injective-mcp-servers

If these skills are not available, selectively run the following commands to install them:

npx skills add InjectiveLabs/agent-skills --skill injective-mcp-servers

Prerequisites

  • Injective MCP server must be running
  • User prompts should be issued from an AI tool that is configured to talk to the Injective MCP server

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo4 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill is a tool for analyzing Injective protocol source code and mechanics. It is safe, focusing on analysis and explanation using vendor-controlled resources. While it processes external code, it lacks the capabilities to perform malicious actions based on that content.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

  • Runlayer8mo

    1/4 files flagged

Signed by skilld at 6d68c2c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 9 months ago
uses
[
  "injective-mcp-servers"
]
metadata
{
  "author": "ckhbtc",
  "version": "0.0.0"
}

README badge

README badge for injectivelabs/agent-skills/injective-trading-chain-analysis