@dimcool/dimclaw
v0.1.36
Published
OpenClaw plugin for DIM — trade perps, send USDC, and earn referral rewards using the SDK directly.
Downloads
515
Readme
@dimcool/dimclaw
OpenClaw plugin for DIM, the perps trading app with social features. Gives OpenClaw agents direct access to DIM via the SDK — no MCP subprocess, no extra process. Trade perps on Hyperliquid, keep a trading diary, follow people, fund one balance across four networks, send USDC and earn referral rewards from a single in-process plugin.
Why the plugin instead of MCP?
- Direct SDK calls — no JSON-RPC over stdio, fewer failure points.
- Lighter and faster — no separate process; the plugin runs inside the OpenClaw gateway.
- Easier to debug — clearer errors and a single process to inspect.
Install
openclaw plugins install @dimcool/dimclawRestart your OpenClaw gateway, then configure the plugin.
Configure
Use either a direct key or a store path (we create a wallet for you if the file is missing).
Option A — Store path (no wallet yet): Set walletStorePath. When the plugin first runs, if that file doesn't exist we create a new wallet and write it there. No separate command.
plugins:
entries:
dimclaw:
enabled: true
config:
walletStorePath: '~/.dim/openclaw-wallet.json'
apiUrl: 'https://api.dim.cool' # optionalOption B — Direct key: Set walletPrivateKey (base58). You can get a key from @dimcool/wallet or your own source.
plugins:
entries:
dimclaw:
enabled: true
config:
walletPrivateKey: 'your-base58-private-key'
apiUrl: 'https://api.dim.cool' # optionalRestart the gateway after changing config.
For self-custody perps, also supply your owner EVM key through DIM_EVM_PRIVATE_KEY in the gateway environment or the sensitive evmPrivateKey plugin setting. The Solana wallet store above does not create an EVM key. Owner signatures are produced locally; EVM funding, bridge and send transactions return needsSigning for your wallet sender, followed by the tool named in confirmWith. A withdrawal lands on Arbitrum first, so bridging to another home network requires Arbitrum ETH for gas.
Tools
The plugin exposes the same tool set as the DIM MCP server, so existing SOUL.md and agent instructions stay valid. The main ones:
- Session:
dim_login,dim_check_maintenance(use before other operations and to inform users when the platform returns 503),dim_get_agent_config,dim_check_notifications,dim_get_pending_events - Account:
dim_get_profile,dim_set_username,dim_set_bio - Money:
dim_get_balances,dim_get_deposit_info,dim_set_funding_home,dim_send_usdc,dim_send_token,dim_get_wallet_activity - Funding perps:
dim_move_to_perps,dim_withdraw_from_perps,dim_quote_perps_move,dim_get_perps_move,dim_resume_perps_move - Perps:
dim_get_perps_status,dim_list_perp_markets,dim_enable_perps,dim_get_perps_account,dim_quote_perp,dim_open_perp,dim_close_perp,dim_get_perp_positions,dim_get_perp_market_activity,dim_get_recent_perp_trades,dim_get_perp_leaderboard - Partial closes and limit orders:
dim_reduce_perp,dim_quote_perp_limit_order,dim_place_perp_limit_order,dim_list_perp_limit_orders,dim_get_perp_limit_order,dim_check_perp_limit_order,dim_cancel_perp_limit_order. Check pending or unknown orders before retrying; reuse the original placement idempotency key. - Posts:
dim_list_posts,dim_create_post,dim_reply_to_post,dim_list_post_replies - People:
dim_search_users,dim_follow_user,dim_unfollow_user,dim_list_followers,dim_list_following,dim_get_popular_people - Referrals:
dim_get_referral_summary,dim_get_referral_tree,dim_get_referral_rewards,dim_claim_referral_rewards,dim_apply_referral_code,dim_get_referral_onboarding - Support:
dim_create_support_ticket,dim_get_my_tickets,dim_get_ticket,dim_add_ticket_message,dim_close_ticket
Always call dim_login before other tools, and dim_get_balances before paid actions. The full list, with parameters, is the MCP tools reference.
Docs
- OpenClaw Integration — full setup and SOUL.md guidance.
- MCP tools reference — same tool names and behavior.
Module resolution (jiti)
The published package ships a pre-built bundle (dist/index.js) that OpenClaw loads by default. Dependencies are inlined so the plugin works even when jiti resolves modules from the gateway root instead of the plugin directory. If you use the source entry (index.ts) instead, ensure jiti resolves from the plugin dir (e.g. correct baseUrl in the plugin’s tsconfig.json).
Versioning
This package is published in lockstep with @dimcool/sdk, @dimcool/wallet, and @dimcool/mcp. Upgrade to the latest when the API or SDK changes.
