{"id":50388243,"url":"https://github.com/0xsyncroot/opentrade","last_synced_at":"2026-05-30T16:30:32.451Z","repository":{"id":358913697,"uuid":"1243550472","full_name":"0xsyncroot/opentrade","owner":"0xsyncroot","description":"Fast GMGN trading — interactive terminal TUI (React + Ink) + Telegram bot. Base / Solana / Ethereum / BSC.","archived":false,"fork":false,"pushed_at":"2026-05-19T15:47:54.000Z","size":299,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T18:25:48.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xsyncroot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-19T12:52:46.000Z","updated_at":"2026-05-19T15:54:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/0xsyncroot/opentrade","commit_stats":null,"previous_names":["0xsyncroot/opentrade"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/0xsyncroot/opentrade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsyncroot%2Fopentrade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsyncroot%2Fopentrade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsyncroot%2Fopentrade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsyncroot%2Fopentrade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xsyncroot","download_url":"https://codeload.github.com/0xsyncroot/opentrade/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsyncroot%2Fopentrade/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33700863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-30T16:30:31.421Z","updated_at":"2026-05-30T16:30:32.438Z","avatar_url":"https://github.com/0xsyncroot.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opentrade\n\n\u003e Fast GMGN trading from your terminal — interactive TUI + Telegram bot, one install, one process.\n\n[![npm](https://img.shields.io/npm/v/%40hiepht%2Fopentrade?label=npm)](https://www.npmjs.com/package/@hiepht/opentrade)\n[![license](https://img.shields.io/npm/l/%40hiepht%2Fopentrade)](./LICENSE)\n[![tests](https://img.shields.io/badge/tests-131%20passing-brightgreen)](#dev)\n\nPaste a contract address, hit `1` to buy `0.01 ETH`, hit `2` for `0.03`, hit `Tab` to flip to sell. Or do the same thing from Telegram — same buttons, same safety gates, same audit log. Both run in the same process, share one GMGN client.\n\n```\n┌─ opentrade · base · 0xH3…4a · $1,234.56 · 3 pos · gas $0.18 ─────┐\n│                                                                  │\n│   PEPE  Pepe Coin                       $0.0000234   +12.4% ▲   │\n│   ─────────────────────────────────────────────────────────────  │\n│   MCap   $4.2M       Liq   $890k        Top10   38%             │\n│   Pool   V3 Aerodrome Tax 0/0          Hpot ✓   Rug 0.03        │\n│                                                                  │\n│   ⚡ Quick Buy                                                    │\n│     [1] 0.01 ETH   [2] 0.03 ETH   [3] 0.05 ETH   [4] 0.1 ETH    │\n│     Slip 8%  Anti-MEV auto  TP --  SL --                         │\n│                                                                  │\n└──────────────────────────────────────────────────────────────────┘\n\u003e _                       1-4 buy · Tab flip · i info · /cmd · ?\n```\n\nSupported chains: **Base · Solana · Ethereum · BSC**.\n\n---\n\n## Install\n\n```bash\nnpm i -g @hiepht/opentrade\n```\n\nThat's it. Just one package — the TUI, the GMGN client, and the Telegram bot are all bundled inside.\n\nRequires Node 20+.\n\n## Setup (first time)\n\n```bash\nopentrade init\n```\n\nThe wizard walks you through 6 steps:\n\n1. **Default chain** — pick `base` / `sol` / `eth` / `bsc`\n2. **Ed25519 keypair** — `[generate new]` if it's your first time, `[import existing PEM]` if you already have one\n3. **GMGN dashboard** — public key auto-copies to your clipboard. The wizard prints the exact steps to paste it into the GMGN API page and grab your API key\n4. **API key** — paste it back into the wizard\n5. **Wallet addresses** — paste one per chain (or skip and add later)\n6. **Telegram bot** — pick `[Yes]` to paste token + chat_id now, `[Skip]` to defer, or `[I don't want it]` to disable\n\nConfig lands in `~/.config/opentrade/config.json` (mode 600).\n\nYou can add or change Telegram at any time:\n\n```bash\nopentrade init --tg-only\n# or\nopentrade config set telegram.botToken=\u003ctoken\u003e\nopentrade config set telegram.ownerChatId=\u003cchat_id\u003e\n```\n\n## Usage\n\n### Interactive TUI\n\n```bash\nopentrade\n```\n\nThat's it — the terminal goes interactive. If Telegram is configured, the bot **also starts in the same process**, so you can trade from your phone and watch positions update in the terminal live.\n\nPaste any contract address — EVM `0x…` or Solana base58 — and the token card appears with quick-buy buttons. If you already hold the token, the **sell view shows first** (25 / 50 / 75 / 100 %); `Tab` flips back to buy.\n\n| Key | Action |\n|---|---|\n| `1` `2` `3` `4` | Fire preset (context: buy or sell) |\n| `b` / `s` | Force buy / sell mode |\n| `Tab` | Flip buy ↔ sell |\n| `i` | Expanded token info |\n| `r` | Refresh card |\n| `p` / `w` | Positions list / wallet summary |\n| `c` | Switch chain |\n| `/` | Slash command palette |\n| `T` | Toggle Telegram bot on / off at runtime |\n| `?` | Help overlay |\n| `q` / `Ctrl+C` | Graceful quit (stops bot first) |\n\nSlash commands inside the TUI mirror the CLI subcommands: `/buy 0.05`, `/sell 50`, `/ps`, `/info`, `/chain base`, `/help`.\n\n### Telegram\n\nPaste a contract address into your chat with the bot → it replies with the same token card + same preset buttons. Tap `[0.05 ETH]` to fire a buy, `[Sell 50%]` to dump half your position. The bot only accepts updates from the chat ID you set in config (single-owner whitelist) — every other update is dropped silently.\n\nHeadless mode (24/7 on a VPS, no terminal UI):\n\n```bash\nopentrade bot start          # spawn detached background bot\nopentrade bot status         # check + tail recent log\nopentrade bot stop           # graceful stop\n```\n\n### Non-interactive subcommands\n\nEvery action also runs without the TUI — handy for scripts, cron, or LLM agents. Cold start under 50 ms because Ink never loads.\n\n```bash\nopentrade buy   base 0xABC… 0.005 --tp 50 --sl 20 --yes\nopentrade sell  base 0xABC… 50 --yes\nopentrade limit buy base 0xABC… 0.01 --at 0.0001\nopentrade quote base 0xABC… 0.005\nopentrade ps    --json\nopentrade w\nopentrade info  base 0xABC…\nopentrade send  base usdc 0.5 @cold-wallet\nopentrade feed  trending base\n```\n\nCommon flags:\n\n| Flag | Effect |\n|---|---|\n| `--yes` | Skip the interactive confirm prompt |\n| `--dry-run` | Quote only — never submits a transaction |\n| `--json` | Emit machine-readable JSON instead of human output |\n| `--plain` | Force non-TUI mode even in a TTY |\n\nRun `opentrade \u003csubcommand\u003e --help` for all flags.\n\n## Safety\n\nBuilt-in gates block dangerous trades **before** they're submitted:\n\n| Condition | Action |\n|---|---|\n| `is_honeypot` / `is_blacklist` set | **Hard block** |\n| `rug_ratio \u003e 0.30` | **Hard block** |\n| Top-10 holder rate `\u003e 0.55` (ex Uniswap V4 PoolManager) | **Hard block** |\n| Buy or sell tax `\u003e 10 %` | Warn + force you to type the token symbol to confirm |\n| Liquidity `\u003c` 2× your trade size | Warn |\n| ETH gas `\u003e` 20 % of trade size | Warn |\n\nConfirmation tiers by trade size as a percentage of your wallet:\n\n| Tier | Trigger | UX |\n|---|---|---|\n| **T0** silent | `\u003c 1 %` | Fires on keypress, no confirm |\n| **T1** inline | `1–5 %` | 3-second countdown auto-fire, `Esc` to cancel |\n| **T2** typed YES | `\u003e 5 %` or ETH mainnet | Type `YES` to confirm |\n| **T3** typed symbol | safety warned | Type the exact token symbol |\n\n`--yes` skips T0 / T1 / T2 — never T3.\n\n**Send safety** (same-chain transfers to other wallets): address book with first-time-address protocol (paste address twice + explorer link + 60-second cool-down), optional `--whitelist-only` mode that blocks every recipient not in the book, contract-address auto-detect (`--allow-contract` to override), tiered amount confirms.\n\n## Config layout\n\n```\n~/.config/opentrade/\n├── config.json            # default chain, GMGN API key, wallets, Telegram (mode 600)\n├── presets.json           # per-chain buy/sell amounts + slippage overrides\n├── aliases.json           # saved trade aliases — `opentrade buy ape`\n├── address-book.json      # send recipients (mode 600)\n├── history.json           # last 20 contract addresses\n└── secrets/\n    ├── ed25519.pem        # signs GMGN critical requests (mode 600)\n    └── ed25519.pub        # paste this into the GMGN dashboard (mode 644)\n```\n\n## How it works\n\n```\n       paste / keypress / Telegram tap\n                  │\n                  ▼\n       classifier / slash parser\n                  │\n                  ▼\n            build Intent\n                  │\n                  ▼\n   dispatcher  (safety → service → audit)\n                  │\n                  ▼\n      GmgnClient → openapi.gmgn.ai\n```\n\n**One brain, two skins.** The TUI keypress handlers and the Telegram callback router both produce the same `Intent` object and push it through the same dispatcher. Safety + GMGN call + audit log run in exactly one place. Buy from your phone, see the position update in the terminal instantly.\n\n## Dev\n\n```bash\ngit clone https://github.com/0xsyncroot/opentrade.git\ncd opentrade\npnpm install\npnpm -r build       # builds the cli artifact (with bot + core bundled in)\npnpm -r test        # 131 tests\npnpm -r typecheck\n```\n\nThe monorepo has three workspace packages but only `@hiepht/opentrade` is published — `core` and `bot` are private, their source is bundled into the CLI artifact at build time so end-users install one thing.\n\nPRs welcome.\n\n## License\n\nMIT © [0xsyncroot](https://github.com/0xsyncroot)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsyncroot%2Fopentrade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xsyncroot%2Fopentrade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsyncroot%2Fopentrade/lists"}