Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions .github/workflows/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# GitHub Workflows

## Overview

CI/CD workflows for linting, testing, and security scanning on pull requests and main branch pushes.

## Key Files

- `lint.yml` - Runs prettier on push/PR, uses bullfrog security
- `test.yml` - Runs `npm run build`, `test:unit`, and `test:integ`
- `trufflehog.yml` - Scans for secrets/credentials in code

## Notes

- All workflows use bullfrog security action in audit mode
- Tests require `GQL_URL` and `GQL_H_ORGN` secrets
- Node 18.x is used across all workflows

## Auto-Update Instructions

After changes to files in this directory or subdirectories, run `/update-claude-md`
to keep this documentation synchronized with the codebase.
46 changes: 46 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Uniswap Routing API

## Overview

AWS Lambda-based API that uses `@uniswap/smart-order-router` to find optimal swap routes for Uniswap V2/V3/V4 protocols across multiple chains.

## Commands

- `npm run build` - Compile TypeScript and generate contract types
- `npm run test:unit` - Run unit tests (Jest + Mocha)
- `npm run test:integ` - Run integration tests (requires local DynamoDB)
- `npm run test:e2e` - Run end-to-end tests against deployed API
- `npm run fix` - Run prettier and eslint fixes
- `cdk deploy RoutingAPIStack` - Deploy to AWS

## Dependencies

<!-- AUTO-GENERATED - Updated by /update-claude-md -->

- **@uniswap/smart-order-router** - Core routing algorithm
- **@uniswap/sdk-core** - Token/chain definitions
- **@uniswap/v2-sdk, v3-sdk, v4-sdk** - Protocol-specific logic
- **aws-cdk-lib** - Infrastructure as code
- **@middy/core** - Lambda middleware
- **ethers** - Ethereum interactions

## Structure

- `bin/` - CDK app entry and stack definitions
- `lib/handlers/` - Lambda handlers (quote endpoint, caching)
- `lib/rpc/` - RPC provider management with health monitoring
- `lib/graphql/` - GraphQL client for subgraph queries
- `lib/util/` - Shared utilities and configurations
- `test/` - Unit, integration, and e2e tests

## Key Patterns

- Quote handler at `lib/handlers/quote/quote.ts`
- Injector pattern for dependency injection (`lib/handlers/injector-sor.ts`)
- DynamoDB caching for pools and routes
- Multi-chain RPC gateway with failover

## Auto-Update Instructions

After changes to files in this directory or subdirectories, run `/update-claude-md`
to keep this documentation synchronized with the codebase.
23 changes: 23 additions & 0 deletions lib/abis/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ABIs

## Overview

JSON ABI files for Ethereum smart contracts used by the routing API.

## Key Files

- `erc20.json` - Standard ERC20 token interface
- `Permit2.json` - Uniswap Permit2 contract ABI
- `Router.json` - Universal Router contract ABI

## Usage

ABIs are compiled to TypeScript types via typechain:
```
npm run compile-external-types
```

## Auto-Update Instructions

After changes to files in this directory or subdirectories, run `/update-claude-md`
to keep this documentation synchronized with the codebase.
15 changes: 15 additions & 0 deletions lib/config/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Config

## Overview

Static configuration files for RPC providers and token lists.

## Key Files

- `rpcProviderProdConfig.json` - Production RPC provider URLs and health check settings per chain
- `unsupported.tokenlist.json` - Token list of unsupported/blocked tokens

## Auto-Update Instructions

After changes to files in this directory or subdirectories, run `/update-claude-md`
to keep this documentation synchronized with the codebase.
22 changes: 22 additions & 0 deletions scripts/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Scripts

## Overview

Utility scripts for local development and testing.

## Key Files

- `get_quote.ts` - Test script to fetch quotes from deployed API

## Usage

```bash
ts-node --project=tsconfig.cdk.json scripts/get_quote.ts
```

Requires `UNISWAP_ROUTING_API` environment variable set.

## Auto-Update Instructions

After changes to files in this directory or subdirectories, run `/update-claude-md`
to keep this documentation synchronized with the codebase.
Loading