skills/aftermathfinance/skills/aftermath-perpetuals

aftermath-perpetuals

SKILL.md

Aftermath Perpetuals Skill

Verified against OpenAPI: https://aftermath.finance/api/openapi/spec.json Last validated: 2026-02-25 Canonical docs UI: https://aftermath.finance/docs

Fast Routing

Choose one file first; do not load everything by default.

Default preference: start with native perpetuals endpoints (/api/perpetuals/*) because they expose the full Aftermath feature set. Use CCXT endpoints when you specifically need exchange-style compatibility.

  1. CCXT endpoint work -> ccxt.md
  2. Native perpetuals endpoint work -> native.md
  3. SDK method usage -> sdk-reference.md
  4. API failures/retries -> error-handling.md
  5. Trading safeguards -> safety-and-risk.md
  6. Builder codes/referrals/rewards/coins utility routes -> auxiliary-endpoints.md
  7. Edge-case pitfalls -> gotchas.md

Integration Modes

Preferred by default: Native perpetuals (/api/perpetuals/*) for complete API coverage.

Mode Best for Primary file
CCXT compatibility (/api/ccxt/*) Exchange-style payloads and build-sign-submit bots ccxt.md
Native perpetuals (/api/perpetuals/*) Full account/vault previews + tx builders native.md
TypeScript SDK (@aftermath-finance/sdk) Typed app integrations sdk-reference.md

High-Risk Guardrails

  • Sign signingDigest, not transactionBytes.
  • Keep ID types strict: CCXT write accountId (object ID) vs native accountId (numeric).
  • Treat preview responses as success/error unions.
  • Re-sync snapshots after stream reconnect before applying deltas.
  • Serialize coin/gas-object-sensitive operations to avoid version conflicts.

Recent API Updates

  • Native account/vault routes include place-scale-order and cancel-and-place-orders transaction support.
  • Account history payloads use orders (order history) and collateralChanges (collateral history).
  • Margin history requests use timeframe (1D | 1W | 1M | ALL) with accountId.
  • Stop-order data requests support optional marketIds filtering.
  • CCXT submit supports one-or-more signatures when sender and gas owner differ.

Progressive Disclosure

File Read when
ccxt.md You need /api/ccxt/* endpoints or stream setup
native.md You need /api/perpetuals/* account/market/vault APIs
auxiliary-endpoints.md You need builder-codes, referrals, rewards, coins, utility txs
sdk-reference.md You are coding with SDK classes and methods
error-handling.md You are implementing retry, backoff, and failure parsing
safety-and-risk.md You are shipping a bot or live strategy safeguards
gotchas.md You need a pre-launch pitfalls checklist

24h Change Check

Use the local helper script to check for OpenAPI changes after the 24h window.

  • Script: skills/api/scripts/check_api_changes.py
  • Behavior: if less than 24h since Last validated, it exits without querying.
  • If 24h+ elapsed, it prompts before querying: Query ... for API changes now? [y/N].
  • It never auto-updates skill markdown files; it only records spec hash state in skills/api/.api-spec-state.json.

Run:

python3 skills/api/scripts/check_api_changes.py
Weekly Installs
4
GitHub Stars
4
First Seen
13 days ago
Installed on
opencode4
github-copilot4
codex4
amp4
cline4
kimi-cli4