-
-
Notifications
You must be signed in to change notification settings - Fork 260
Open
Description
Summary
Add PumpSwap as a new AMM connector to Gateway. PumpSwap is the AMM from Pump.fun on Solana.
References
- PumpSwap Documentation: https://github.com/pump-fun/pump-public-docs
- Hummingbot Gateway Connector Guide: https://hummingbot.org/connectors/gateway-connectors/
- Reference Implementation: Use the existing Raydium AMM connector as a template (
src/connectors/raydium/amm-routes/)
Requirements
1. Connector Implementation
Create the connector structure following the existing patterns:
src/connectors/pumpswap/
├── pumpswap.ts # Main connector class
├── pumpswap.config.ts # Configuration handling
├── schemas.ts # TypeBox schemas for requests/responses
└── amm-routes/
├── quoteSwap.ts # GET /quote-swap
├── executeSwap.ts # POST /execute-swap
├── poolInfo.ts # GET /pool-info
├── addLiquidity.ts # POST /add-liquidity
├── removeLiquidity.ts # POST /remove-liquidity
├── quoteLiquidity.ts # GET /quote-liquidity
└── positionInfo.ts # GET /position-info
2. Configuration
- Add config template:
src/templates/connectors/pumpswap.yml - Add JSON schema:
src/templates/namespace/pumpswap-schema.json - Register in
src/templates/root.yml
3. Required AMM Endpoints
| Endpoint | Method | Description |
|---|---|---|
/connectors/pumpswap/amm/quote-swap |
GET | Get swap quote |
/connectors/pumpswap/amm/execute-swap |
POST | Execute swap transaction |
/connectors/pumpswap/amm/pool-info |
GET | Get pool information |
/connectors/pumpswap/amm/add-liquidity |
POST | Add liquidity to pool |
/connectors/pumpswap/amm/remove-liquidity |
POST | Remove liquidity from pool |
/connectors/pumpswap/amm/quote-liquidity |
GET | Quote liquidity amounts |
/connectors/pumpswap/amm/position-info |
GET | Get LP position info |
4. Tests
Add comprehensive tests following existing patterns:
test/connectors/pumpswap/
├── pumpswap.test.ts
└── amm-routes/
├── quoteSwap.test.ts
├── executeSwap.test.ts
├── poolInfo.test.ts
├── addLiquidity.test.ts
├── removeLiquidity.test.ts
└── positionInfo.test.ts
5. Documentation
- Add pool template:
src/templates/pools/pumpswap.json - Update connector routes to register PumpSwap
Implementation Notes
- Follow Raydium AMM patterns - The Raydium AMM connector (
src/connectors/raydium/amm-routes/) is a good reference for Solana AMM implementation - Use httpErrors - Return proper HTTP status codes (400 for bad requests, 404 for not found, 500 for server errors)
- Singleton pattern - Use
getInstance()pattern for the connector class - TypeBox schemas - Define all request/response schemas using TypeBox
- Logging - Use the logger service, not console.log
- Error handling - Add
if (e.statusCode) throw e;pattern in route handlers to preserve error codes
Acceptance Criteria
- All AMM endpoints implemented and working
- Configuration files added
- Unit tests with >75% coverage
- Manual testing with real PumpSwap pools
- Swagger documentation auto-generated at
/docs - No TypeScript errors (
pnpm typecheck) - Linting passes (
pnpm lint)
Resources
- PumpSwap Program ID and other constants should be sourced from the pump-public-docs
- Test with several memecoin/SOL pools on PumpSwap
Metadata
Metadata
Assignees
Labels
No labels