MCPcopy Index your code
hub / github.com/0xNineteen/anchor-uniswap-v2

github.com/0xNineteen/anchor-uniswap-v2 @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
23 symbols 30 edges 10 files 4 documented · 17%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Uniswap V2 AMM implemented in Anchor

  • programs/ammv2/src/draft.rs: outline of program with comments -- drafted before implementation

Supported Instructions

  • programs/ammv2/src/
    • instructions/
      • init_pool.rs: initialize a new pool
      • liqduidity.rs: add and remove liquidity
      • swap.rs: perform a token swap

Implemented Tests

  • tests/ammv2.ts:
    • intialize a new pool
    • add liquidity (x3)
    • remove liquidity
    • swap
    • remove liquidity

Extension points exported contracts — how you extend this code

Pool (Interface)
(no doc)
tests/ammv2.ts
LPProvider (Interface)
(no doc)
tests/ammv2.ts

Core symbols most depended-on inside this repo

get_token_balance
called by 29
tests/ammv2.ts
lp_amount
called by 8
tests/ammv2.ts
setup_lp_provider
called by 3
tests/ammv2.ts
handler
called by 1
programs/ammv2/src/instructions/init_pool.rs
initialize_pool
called by 0
programs/ammv2/src/lib.rs
remove_liquidity
called by 0
programs/ammv2/src/lib.rs
add_liquidity
called by 0
programs/ammv2/src/lib.rs
swap
called by 0
programs/ammv2/src/lib.rs

Shape

Function 15
Class 5
Interface 2
Enum 1

Languages

Rust78%
TypeScript22%

Modules by API surface

tests/ammv2.ts5 symbols
programs/ammv2/src/draft.rs5 symbols
programs/ammv2/src/lib.rs4 symbols
programs/ammv2/src/instructions/liquidity.rs3 symbols
programs/ammv2/src/instructions/swap.rs2 symbols
programs/ammv2/src/instructions/init_pool.rs2 symbols
programs/ammv2/src/state.rs1 symbols
programs/ammv2/src/error.rs1 symbols

For agents

$ claude mcp add anchor-uniswap-v2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page