logiqical 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Logiqical
2
2
 
3
- The standalone agent wallet SDK for AI agents on Avalanche and Arena. 88 MCP tools, 11 modules, zero backend dependency.
3
+ The standalone agent wallet SDK for AI agents on Avalanche and Arena. 91 MCP tools, 15 modules, zero backend dependency.
4
4
 
5
- **Swap ARENA tokens, stake for rewards, trade launchpad tokens, bridge cross-chain, trade perps, chat on Arena Social, track whale signals** — all from a single SDK with built-in wallet, spending policies, and transaction simulation.
5
+ **Swap ARENA tokens, stake for rewards, trade launchpad tokens, bridge cross-chain, trade perps, copy trade top wallets, register agents on Arena, auto-post trades to feed, deposit USDC to Hyperliquid, chat on Arena Social, track whale signals** — all from a single SDK with built-in wallet, spending policies, and transaction simulation.
6
6
 
7
7
  ```typescript
8
8
  import { Logiqical } from "logiqical";
@@ -344,6 +344,91 @@ Liquid staking via Benqi (sAVAX) and any ERC-4626 vault on Avalanche.
344
344
  await agent.execute(agent.defi.buildSAvaxStake("10.0"));
345
345
  ```
346
346
 
347
+ ### `agent.copyTrading` — Copy Trading (Mirror Hyperliquid Wallets)
348
+
349
+ Mirror any Hyperliquid wallet's perpetual positions with proportional sizing.
350
+
351
+ | Method | Description |
352
+ |--------|-------------|
353
+ | `getTargetPositions(wallet)` | Get open positions of a target wallet |
354
+ | `getAgentPositions(wallet)` | Get your agent's current positions |
355
+ | `calculateMirrorOrders(target, agent, scale?)` | Compare positions and return orders to mirror |
356
+ | `executeMirrorOrders(orders, prices)` | Execute the mirror orders via Arena perps |
357
+ | `copyOnce(target, agent, scale?)` | One-shot: calculate + execute in one call |
358
+
359
+ ```typescript
360
+ // See what a top trader is holding
361
+ const positions = await agent.copyTrading.getTargetPositions("0xWhaleWallet");
362
+
363
+ // Calculate what orders you'd need to mirror them (10% of their size)
364
+ const { orders } = await agent.copyTrading.calculateMirrorOrders(
365
+ "0xWhaleWallet", agent.address, 0.1
366
+ );
367
+
368
+ // Or just copy in one shot
369
+ const result = await agent.copyTrading.copyOnce("0xWhaleWallet", agent.address, 0.1);
370
+ ```
371
+
372
+ ### `SocialModule.registerAgent()` — Agent Self-Registration
373
+
374
+ Register a new AI agent on Arena. Returns an API key (shown once — save immediately).
375
+
376
+ ```typescript
377
+ import { SocialModule } from "logiqical";
378
+
379
+ const registration = await SocialModule.registerAgent({
380
+ name: "My Trading Bot",
381
+ handle: "my-trading-bot",
382
+ address: agent.address,
383
+ bio: "Autonomous trading agent on Avalanche",
384
+ });
385
+
386
+ console.log(registration.apiKey); // Save this immediately
387
+ console.log(registration.verificationCode); // Owner must claim agent with this
388
+ ```
389
+
390
+ After registration, the owner must post from their personal Arena account:
391
+ `I'm claiming my AI Agent "My Trading Bot"\nVerification Code: <code>`
392
+
393
+ ### `agent.social.postTradeUpdate()` — Feed Auto-Posting
394
+
395
+ Automatically format and post trade updates to the Arena feed.
396
+
397
+ ```typescript
398
+ await agent.social.postTradeUpdate({
399
+ action: "buy", token: "ARENA", amount: "10000", price: "0.008",
400
+ hash: "0x...",
401
+ });
402
+
403
+ await agent.social.postTradeUpdate({
404
+ action: "swap", fromToken: "AVAX", toToken: "USDC", amount: "10",
405
+ });
406
+
407
+ await agent.social.postTradeUpdate({
408
+ action: "close", token: "ETH", pnl: "+$420",
409
+ });
410
+ ```
411
+
412
+ ### `agent.perps` — USDC Deposit to Hyperliquid
413
+
414
+ Deposit USDC into Hyperliquid on Arbitrum for perps trading.
415
+
416
+ ```typescript
417
+ // Check balances on Arbitrum
418
+ const usdc = await agent.perps.getArbitrumUSDCBalance(agent.address);
419
+ const eth = await agent.perps.getArbitrumETHBalance(agent.address);
420
+
421
+ // Get deposit info
422
+ const info = agent.perps.getDepositInfo();
423
+ // → { chain: 'Arbitrum One', usdcAddress: '0xaf88...', depositAddress: '0x2Df1...' }
424
+
425
+ // Build deposit tx (execute on Arbitrum)
426
+ const arbAgent = agent.switchNetwork("arbitrum");
427
+ await arbAgent.execute(agent.perps.buildDepositUSDC("100"));
428
+ ```
429
+
430
+ Full flow: Bridge USDC to Arbitrum (use `agent.bridge`), then deposit to Hyperliquid.
431
+
347
432
  ## Spending Policies
348
433
 
349
434
  Protect your agent with configurable guardrails.
@@ -381,7 +466,7 @@ await agent.call({
381
466
  });
382
467
  ```
383
468
 
384
- ## MCP Server (88 Tools)
469
+ ## MCP Server (91 Tools)
385
470
 
386
471
  Run as an MCP server for Claude, Cursor, or any MCP-compatible client.
387
472
 
@@ -413,7 +498,7 @@ Or add to your MCP config:
413
498
  }
414
499
  ```
415
500
 
416
- ### All 88 MCP Tools
501
+ ### All 91 MCP Tools
417
502
 
418
503
  | Category | Tools | Description |
419
504
  |----------|-------|-------------|
@@ -424,14 +509,16 @@ Or add to your MCP config:
424
509
  | Arena Launchpad | 6 | Buy/sell launchpad tokens, quotes, discovery |
425
510
  | Arena Tickets | 8 | Buy/sell tickets, prices, balances, supply, fees |
426
511
  | Cross-Chain Bridge | 8 | Bridge quotes, routes, status, chains, tokens, info |
427
- | Arena Perps | 9 | Place/cancel orders, positions, leverage, register |
512
+ | Arena Perps | 12 | Place/cancel orders, positions, leverage, register, USDC deposit |
428
513
  | Signals Intelligence | 6 | Market signals, technicals, whales, funding, scan |
429
- | Arena Social | 13 | Chat, DMs, posts, follow, search, profile |
514
+ | Arena Social | 14 | Chat, DMs, posts, follow, search, profile, trade updates |
515
+ | Agent Registration | 1 | Register AI agent on Arena |
516
+ | Copy Trading | 3 | Mirror wallet positions, calculate orders, one-shot copy |
430
517
  | Market Data | 6 | Prices, trending, top coins, search, AVAX/ARENA price |
431
518
  | DeFi | 8 | sAVAX staking, vault deposit/withdraw, quotes |
432
519
  | Policy | 3 | Get/set policy, budget status |
433
520
  | Contract Call | 1 | Call any smart contract method |
434
- | **Total** | **88** | |
521
+ | **Total** | **91** | |
435
522
 
436
523
  ## Multi-Chain Support
437
524
 
@@ -454,23 +541,24 @@ const baseAgent = agent.switchNetwork("arbitrum");
454
541
 
455
542
  ```
456
543
  logiqical
457
- ├── Logiqical # Main class — wallet + execute() + policy
458
- ├── AgentWallet # Generate, boot, keystore, sign, broadcast
459
- ├── PolicyEngine # Per-tx limits, budgets, simulation, dry-run
544
+ ├── Logiqical # Main class — wallet + execute() + policy
545
+ ├── AgentWallet # Generate, boot, keystore, sign, broadcast
546
+ ├── PolicyEngine # Per-tx limits, budgets, simulation, dry-run
460
547
  ├── Modules
461
- │ ├── SwapModule # ARENA token buy/sell
462
- │ ├── StakingModule # ARENA staking + rewards
463
- │ ├── LaunchpadModule # Arena launchpad bonding curves
464
- │ ├── DexModule # Any-token swaps (LFJ DEX)
465
- │ ├── TicketsModule # Arena social tickets
466
- │ ├── PerpsModule # Perpetual futures (Hyperliquid)
467
- │ ├── BridgeModule # Cross-chain (Li.Fi)
468
- │ ├── SocialModule # Arena chat, posts, follow
469
- │ ├── SignalsModule # Market intelligence
470
- │ ├── MarketModule # CoinGecko data
471
- └── DefiModule # sAVAX + ERC-4626 vaults
472
- ├── MCP Server # 88-tool server for AI agents
473
- └── Errors # Typed errors with codes
548
+ │ ├── SwapModule # ARENA token buy/sell
549
+ │ ├── StakingModule # ARENA staking + rewards
550
+ │ ├── LaunchpadModule # Arena launchpad bonding curves
551
+ │ ├── DexModule # Any-token swaps (LFJ DEX)
552
+ │ ├── TicketsModule # Arena social tickets
553
+ │ ├── PerpsModule # Perpetual futures + USDC deposit (Hyperliquid)
554
+ │ ├── BridgeModule # Cross-chain (Li.Fi)
555
+ │ ├── SocialModule # Arena chat, posts, follow, agent registration
556
+ │ ├── CopyTradingModule # Mirror Hyperliquid wallet positions
557
+ │ ├── SignalsModule # Market intelligence
558
+ ├── MarketModule # CoinGecko data
559
+ │ └── DefiModule # sAVAX + ERC-4626 vaults
560
+ ├── MCP Server # 91-tool server for AI agents
561
+ └── Errors # Typed errors with codes
474
562
  ```
475
563
 
476
564
  ## Features
@@ -480,8 +568,8 @@ logiqical
480
568
  - **execute() pattern** — one-liner: policy &rarr; simulate &rarr; sign &rarr; broadcast
481
569
  - **Spending policies** — per-tx limits, hourly/daily budgets, allowlists, dry-run
482
570
  - **Transaction simulation** — eth_call before broadcast catches reverts early
483
- - **88 MCP tools** — plug into Claude, Cursor, or any MCP client
484
- - **11 modules** — ARENA swap, staking, launchpad, DEX, tickets, perps, bridge, social, signals, market, DeFi
571
+ - **91 MCP tools** — plug into Claude, Cursor, or any MCP client
572
+ - **15 modules** — ARENA swap, staking, launchpad, DEX, tickets, perps, bridge, social, signals, market, DeFi, copy trading, agent registration, feed auto-posting
485
573
  - **20 EVM chains** — Avalanche, Ethereum, Base, Arbitrum, and 16 more
486
574
  - **Typed errors** — `LogiqicalError` with codes like `SLIPPAGE_EXCEEDED`, `CONTRACT_REVERT`
487
575
  - **Dual build** — ESM + CJS + TypeScript declarations