Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ec040e8
feat: enhance pool storage with token addresses and fees
fengtality Oct 14, 2025
70d9548
feat: add configurable EIP-1559 gas pricing for Ethereum networks
fengtality Oct 15, 2025
1fee81b
test: fix pool routes tests for enhanced Pool interface
fengtality Oct 15, 2025
e7cd5a6
feat: migrate to Etherscan V2 API with unified API key configuration
fengtality Oct 15, 2025
1e572b4
docs: update gas configuration guide for Etherscan V2 API
fengtality Oct 15, 2025
03463a6
docs: update gas config guide to reflect new minimum gas prices
fengtality Oct 15, 2025
366e5da
docs: update Polygon config to 10 GWEI in gas guide
fengtality Oct 15, 2025
ee1fa1b
refactor: clean up CLMM open-position implementations
fengtality Oct 16, 2025
75beff7
chore: update BSC and Polygon gas config to match actual network cond…
fengtality Oct 16, 2025
435d212
refactor: extract getPool schema and fix type enum for Swagger UI
fengtality Oct 16, 2025
008bf12
chore: set default network to mainnet-beta in GetPoolRequestSchema
fengtality Oct 16, 2025
92e9151
fix: set network default to mainnet-beta and change tradingPair example
fengtality Oct 16, 2025
19e21e1
feat: enhance POST /pools to support all pool fields and allow duplic…
fengtality Oct 16, 2025
8c8393a
refactor: make baseTokenAddress and quoteTokenAddress required in POS…
fengtality Oct 16, 2025
6d3bb0c
feat: prevent duplicate pools with identical metadata
fengtality Oct 16, 2025
d0d010a
refactor: match pools by token pair only, ignore fee tier
fengtality Oct 16, 2025
54c8ffe
test: fix pool routes tests for required token address fields
fengtality Oct 16, 2025
a9aedf0
fix: remove incorrect priority fee parameter in closePosition
fengtality Oct 19, 2025
1374208
fix: apply Helius merged config to solana.config for priority fee est…
fengtality Oct 21, 2025
24e8c13
fix: improve Helius transaction sending messages to clarify what's used
fengtality Oct 21, 2025
7b48f80
test: add Infura configuration regression test and improve logging
fengtality Oct 21, 2025
dc409b7
fix: decode Universal Router errors and improve Permit2 expiration di…
fengtality Oct 21, 2025
d61342e
fix: handle empty string amount in approve route
fengtality Oct 21, 2025
d1f8c00
fix: only initialize HeliusService when API key is configured
fengtality Oct 21, 2025
1a439ac
test: fix Helius regression test to check rpcProvider config before r…
fengtality Oct 21, 2025
f248059
test: Helius regression test now sets up config instead of skipping
fengtality Oct 21, 2025
36dff19
fix: Helius regression test now properly reloads ConfigManagerV2
fengtality Oct 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,63 @@ This file provides guidance to AI coding assistants when working with code in th
- RPC provider configs: `src/templates/rpc/{provider}.yml`
- All configs validated against JSON schemas in `src/templates/namespace/`

### Pool Storage Format
Gateway stores pool configurations for each connector in `src/templates/pools/{connector}.json`. The pool storage format includes complete pool information fetched from on-chain data to ensure token ordering and fees match the actual pool state.

#### Pool Object Structure
Each pool entry contains:
```typescript
{
type: 'amm' | 'clmm', // Pool type: AMM (V2) or CLMM (V3)
network: string, // Network name (e.g., 'mainnet-beta', 'mainnet')
baseSymbol: string, // Base token symbol (e.g., 'SOL')
quoteSymbol: string, // Quote token symbol (e.g., 'USDC')
baseTokenAddress: string, // Base token contract address (authoritative)
quoteTokenAddress: string, // Quote token contract address (authoritative)
feePct: number, // Pool fee percentage (e.g., 0.25 for 0.25%)
address: string // Pool contract address
}
```

#### Adding Pools via API
Use `POST /pools` to add a new pool. The route automatically:
1. Fetches pool-info from the connector (authoritative source)
2. Extracts baseTokenAddress, quoteTokenAddress, and feePct
3. Resolves token symbols from addresses (if not provided)
4. Validates all required fields
5. Stores the enhanced pool object

Example request:
```bash
curl -X POST http://localhost:15888/pools \
-H "Content-Type: application/json" \
-d '{
"connector": "raydium",
"type": "amm",
"network": "mainnet-beta",
"address": "58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2"
}'
```

The API will fetch pool-info and store complete pool data including token addresses and fees.

#### Pool Template Migration
To migrate existing pool templates from the old format (symbol-only) to the new format (with token addresses and fees):

```bash
# Ensure RPC endpoints are configured in conf/rpc/*.yml
npx ts-node scripts/migrate-pool-templates.ts
```

The migration script:
- Processes raydium.json, meteora.json, and uniswap.json
- Fetches pool-info for each pool address
- Extracts baseTokenAddress, quoteTokenAddress, and feePct from on-chain data
- Writes updated template files with the new format
- Reports success/failure counts for each connector

After migration, review the updated template files before committing to ensure all pools were migrated successfully.

### RPC Provider Configuration
Gateway supports optimized RPC providers for enhanced performance:
- **Infura** (Ethereum): `conf/rpc/infura.yml` - Set `rpcProvider: infura` in network configs
Expand Down
Loading