agentleFS
InjectiveLabsInjectiveLabs/agent-skills/skills/injective-trading-account/SKILL.md

injective-trading-account

Skill6 starsChanged 4 months agoApache-2.0View on GitHub

Analyze any Injective wallet address. Query bank balances across all token types (INJ, USDT, IBC assets, Peggy ERC-20s), inspect trading subaccount balances, and view open perpetual positions with unrealized P&L. Useful for portfolio monitoring, position management, and pre-trade checks. Requires the Injective MCP server to be connected.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No transactions/ signatures required.

    line 14
  2. Distinctive:

    All reads are public.

    line 15
  3. Distinctive:

    When you are trading on Injective, and need information about your account

    line 19
  4. Distinctive:

    When you are performing queries but not intending to perform transactions

    line 20
  5. Very specific:

    Use the injective-mcp-servers skill for instructions on set up and usage.

    line 25
  6. Distinctive:

    When the user's request contains the following questions, map them to the MCP tool calls indicated.

    line 79
  7. Very specific:

    If bank balance has USDT but subaccount doesn't: Use subaccount_deposit to move funds in.

    line 95
  8. Very specific:

    Use subaccount_deposit to move funds in.

    line 96
  9. Very specific:

    Use token_metadata to resolve any denom to a human-readable symbol.

    line 121
  10. Distinctive:

    When estimating required margin for a position:

    line 125
  11. Distinctive:

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

    line 147

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Injective Trading Account, Skill Guide

Query balances and open positions for any Injective account. No transactions/ signatures required. All reads are public.

When to apply

  • When you are trading on Injective, and need information about your account
  • When you are performing queries but not intending to perform transactions

MCP Tools

The following tools in the Injective MCP Server are used by this skill. Use the injective-mcp-servers skill for instructions on set up and usage. The "activities" section describes the when and how to make these tool calls.

account_balances

Returns bank + subaccount balances for an address.

account_balances
  address: inj1...
  denom: usdt         ← optional: filter to one token

Returns:

  • bankBalances[] - wallet-level balances (all denoms or filtered)
  • subaccountBalances[] - per-subaccount trading balances
    • subaccountId - 0x... hex ID
    • denom - token denom
    • deposit.totalBalance - total (available + in orders)
    • deposit.availableBalance - free to trade

account_positions

Returns open perpetual positions with P&L.

account_positions
  address: inj1...
  market: BTC         ← optional: filter by symbol

Returns per position:

  • market - symbol (BTC, ETH, etc.)
  • direction - long | short
  • quantity - contracts held
  • entryPrice - average entry in USDT
  • markPrice - current oracle price
  • unrealizedPnl - USDT P&L at mark price
  • margin - posted margin
  • leverage - effective leverage

token_metadata

Resolve any denom to human-readable metadata.

token_metadata
  denom: peggy0xdac17f958d2ee523a2206206994597c13d831ec7

Returns: { symbol, name, decimals, type, peggyDenom }

Activities

When the user's request contains the following questions, map them to the MCP tool calls indicated.

"What's my balance?"

account_balances(address: inj1...)
→ show bankBalances + subaccountBalances summary

"Do I have enough USDT to trade?"

account_balances(address: inj1..., denom: usdt)
→ check subaccountBalances[0].deposit.availableBalance

If bank balance has USDT but subaccount doesn't: Use subaccount_deposit to move funds in. Note that this is not a read/ query, and will involve a transaction.

Important: Bank balance (wallet) ≠ exchange subaccount balance. Funds must be deposited to the exchange subaccount via MsgDeposit before placing derivative orders. Always check subaccount balance and auto-deposit if needed before trading.

"Show my positions and P&L"

account_positions(address: inj1...)
→ display each position with entry vs mark price and unrealizedPnl

"What's my total portfolio value?"

account_balances    → sum all balances in USD equivalent
account_positions   → add unrealized P&L

Denoms

Denoms are analogous to cryptocurrencies and fungible tokens. Injective, being a MultiVM blockchain, supports multiple categories of denoms.

Denoms of different categories have different formats. See: ./references/denom-formats.md Use token_metadata to resolve any denom to a human-readable symbol.

Margin Calculation

When estimating required margin for a position:

  • Add 1–2% buffer above the exact minimum (price × qty × initialMarginRatio). The chain may reject orders at the exact minimum due to rounding.
  • Use max(oraclePrice, markPrice) for margin validation. The chain validates against the higher of the two. Margin calculated from oracle price alone may be insufficient if mark price is higher.
  • stakeUsdt is margin, not notional. The user's stake is their margin (collateral). qty = stake × leverage / price.

Subaccount IDs

Injective uses subaccounts for isolated margin.

The default subaccount index is 0: subaccountId = address + "000000000000000000000000" + "0".padStart(24, "0") + "0000"

In practice, the MCP tools default to subaccount index 0 automatically. Advanced users can specify subaccountId explicitly on trade tools.

Related skills

This skill uses the following 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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.