From c4eb499337bd3d795e50a934b0e9b34aa3208e0a Mon Sep 17 00:00:00 2001 From: VeXHarbinger Date: Wed, 27 May 2026 18:41:46 -0400 Subject: [PATCH 1/5] PancakeSwap V3 CLMM fixes, binCount pool-info --- .github/copilot-instructions.md | 77 +++++++++++++++++++++++++++++++++ CLAUDE.md | 37 ++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000000..4a361f010f --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,77 @@ +# GitHub Copilot Instructions + +This file provides guidance to GitHub Copilot when working with code in this repository. +Keep this file in sync with `CLAUDE.md` — changes to one must be reflected in the other. + +## Lenses + +Apply all lenses before proposing any solution. Each lens constrains acceptable answers. + +- Hummingbot lens: Gateway is consumed by Hummingbot Python strategies via typed connector classes. API response shapes are parsed directly into Python dicts — breaking changes to field types or names silently corrupt live trading bots. Prefer additive changes (new optional fields) over mutations. `walletAddresses` must remain `string[]`. Use Tolerant Reader pattern for all response extensions. +- Blockchain lens: The `chain` field is the technology substrate (ethereum = all EVM, solana = SVM). `network` is the L1/L2 brand discriminator (mainnet, bsc, arbitrum, base, polygon, avalanche). A wallet address is chain-scoped, not network-scoped — the same keypair works across all EVM networks. Wallet files are stored under `conf/wallets//
.json` as `{encryptedKey, network}` JSON; legacy files contain a raw encrypted string and must be handled transparently. +- System Architect lens: Routes follow `/{resource}/{operation}` REST conventions. Schemas are TypeBox objects auto-published to Swagger — every new field must be typed. Backwards compatibility is enforced via optional fields, never field removal or type mutation. Singleton pattern governs chain/connector instances (`getInstance(network)`). Error responses must use Fastify `httpErrors` — never throw raw errors from route handlers. +- Bitcoin lens: Not directly supported, but cryptographic primitives (key derivation, encryption, signing) must remain chain-agnostic. Wallet encryption uses a passphrase-derived key stored outside source control. Never log or expose private keys or passphrases in any code path. +- Jest lens: Mock external deps (fs, RPC, chains) — never write real files during tests. Test both happy paths and regressions. 100% coverage on utils, 75%+ on routes. Use `jest.mock()` for file/crypto ops. Parallel tests should not share state. Validate schema contracts before business logic. Every test suite must cover three categories: (1) **Happy paths** — expected utilization with valid inputs for all parameter combinations; (2) **Edge cases** — boundary values, legacy file formats, same-address-multi-network, empty arrays, zero amounts; (3) **Missing/invalid parameters** — each required field omitted independently, unrecognized chain/network values, neither `chain` nor `chainNetwork` provided, malformed `chainNetwork` strings. Route handler tests must assert the HTTP status code, not just the response body shape. +- QA lens: Validate backwards compatibility at every response boundary. Legacy wallet files must parse identically. New optional fields should not break old consumers. Test migration scenarios: old wallets → new system, new fields with old clients. Regression suite covers all breaking-change-adjacent code paths. +- Security lens: Never log or expose private keys, passphrases, mnemonic seeds, or decrypted values. All file I/O must use `getSafeWalletFilePath()` with sanitized inputs. Wallet encryption keys derive from passphrase outside source control. Validate address formats to prevent injection. All secrets must be stored in `conf/` outside repo. + +- Markdown lens: All `.md` files must render cleanly — headings surrounded by blank lines, lists surrounded by blank lines, fenced code blocks surrounded by blank lines, no bare URLs (wrap in angle brackets or `[text](url)`), no trailing spaces, consistent ATX-style headings (`##` not underline). PR descriptions, README sections, and CLAUDE.md must follow these rules. Use `