# shakeebshams/swiper architecture

> Architecture diagram of the GitHub repository shakeebshams/swiper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shakeebshams/swiper
- Repository: https://github.com/shakeebshams/swiper

## Overview

This repository is a Solana memecoin trading bot with separate buy-scanning and sell-monitoring runtimes. The buy scanner fetches GMGN trending tokens, filters for newly created tokens, then calls placeholder buy logic that checks and records positions in Supabase. A separate buy module implements Jupiter quoting, transaction signing, and Solana submission, but the shown scanner does not call it. The sell loop reads open positions, fetches prices, applies exit checks, and updates Supabase; its sell function is explicitly a dummy. The README documents broader strategy capabilities, but sampled code does not show all of them.

Main entry points: [`sell/main.py`](https://github.com/shakeebshams/swiper/blob/master/sell/main.py) (Sell Monitor), [`buy/gmgn_trending.py`](https://github.com/shakeebshams/swiper/blob/master/buy/gmgn_trending.py) (Trend Scanner), [`buy/buy.py`](https://github.com/shakeebshams/swiper/blob/master/buy/buy.py) (Jupiter Buy), [`buy/main.py`](https://github.com/shakeebshams/swiper/blob/master/buy/main.py) (Buy Scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_buy_discovery["Buy Discovery"]
  node_buy_runner["Buy Scanner<br/>[main.py]"]
  node_trend_scanner["Trend Scanner<br/>[gmgn_trending.py]"]
  node_gmgn_trends{{"GMGN Trends"}}
end

subgraph group_buy_execution["Buy Execution"]
  node_buy_placeholder["Buy Placeholder<br/>[swap.py]"]
  node_jupiter_buy["Jupiter Buy<br/>[buy.py]"]
  node_jupiter_api{{"Jupiter API"}}
  node_solana_rpc{{"Solana RPC"}}
end

subgraph group_sell_monitoring["Sell Monitoring"]
  node_sell_runner["Sell Monitor<br/>[main.py]"]
  node_gmgn_price["Price Fetcher<br/>[gmgn_price.py]"]
  node_gmgn_prices{{"GMGN Prices"}}
  node_sell_action["Sell Placeholder<br/>[main.py]"]
end

subgraph group_position_data["Position Data"]
  node_supabase[("Supabase Positions")]
end

node_operator(("Bot Operator"))

node_operator -->|"starts"| node_buy_runner
node_buy_runner -->|"calls"| node_trend_scanner
node_trend_scanner -->|"fetches"| node_gmgn_trends
node_trend_scanner -->|"calls for new tokens"| node_buy_placeholder
node_buy_placeholder -->|"checks and inserts"| node_supabase
node_operator -->|"runs separately"| node_jupiter_buy
node_jupiter_buy -->|"quotes and builds swap"| node_jupiter_api
node_jupiter_buy -->|"submits signed transaction"| node_solana_rpc
node_operator -->|"starts"| node_sell_runner
node_sell_runner -->|"reads open positions"| node_supabase
node_sell_runner -->|"requests token price"| node_gmgn_price
node_gmgn_price -->|"fetches"| node_gmgn_prices
node_sell_runner -->|"calls on exit condition"| node_sell_action
node_sell_runner -->|"updates closed position"| node_supabase

click node_buy_runner "https://github.com/shakeebshams/swiper/blob/master/buy/main.py"
click node_trend_scanner "https://github.com/shakeebshams/swiper/blob/master/buy/gmgn_trending.py"
click node_buy_placeholder "https://github.com/shakeebshams/swiper/blob/master/buy/swap.py"
click node_jupiter_buy "https://github.com/shakeebshams/swiper/blob/master/buy/buy.py"
click node_sell_runner "https://github.com/shakeebshams/swiper/blob/master/sell/main.py"
click node_gmgn_price "https://github.com/shakeebshams/swiper/blob/master/sell/gmgn_price.py"
click node_sell_action "https://github.com/shakeebshams/swiper/blob/master/sell/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_buy_runner,node_trend_scanner,node_gmgn_trends toneBlue
class node_buy_placeholder,node_jupiter_buy,node_jupiter_api,node_solana_rpc toneAmber
class node_sell_runner,node_gmgn_price,node_gmgn_prices,node_sell_action toneMint
class node_supabase toneRose
class node_operator toneIndigo
```

## Components

### Buy Discovery

- [Buy Scanner](https://github.com/shakeebshams/swiper/blob/master/buy/main.py): `buy/main.py`
- [Trend Scanner](https://github.com/shakeebshams/swiper/blob/master/buy/gmgn_trending.py): `buy/gmgn_trending.py`
- **GMGN Trends**

### Buy Execution

- [Buy Placeholder](https://github.com/shakeebshams/swiper/blob/master/buy/swap.py): `buy/swap.py`
- [Jupiter Buy](https://github.com/shakeebshams/swiper/blob/master/buy/buy.py): `buy/buy.py`
- **Jupiter API**
- **Solana RPC**

### Sell Monitoring

- [Sell Monitor](https://github.com/shakeebshams/swiper/blob/master/sell/main.py): `sell/main.py`
- [Price Fetcher](https://github.com/shakeebshams/swiper/blob/master/sell/gmgn_price.py): `sell/gmgn_price.py`
- **GMGN Prices**
- [Sell Placeholder](https://github.com/shakeebshams/swiper/blob/master/sell/main.py): `sell/main.py`

### Position Data

- **Supabase Positions**

### Other components

- **Bot Operator**

## Connections

- Bot Operator → Buy Scanner: starts (evidence: `README.MD`)
- Buy Scanner → Trend Scanner: calls (evidence: `buy/main.py`)
- Trend Scanner → GMGN Trends: fetches (evidence: `buy/gmgn_trending.py`)
- Trend Scanner → Buy Placeholder: calls for new tokens (evidence: `buy/gmgn_trending.py`)
- Buy Placeholder → Supabase Positions: checks and inserts (evidence: `buy/swap.py`)
- Bot Operator → Jupiter Buy: runs separately (evidence: `buy/buy.py`)
- Jupiter Buy → Jupiter API: quotes and builds swap (evidence: `buy/buy.py`)
- Jupiter Buy → Solana RPC: submits signed transaction (evidence: `buy/buy.py`)
- Bot Operator → Sell Monitor: starts (evidence: `README.MD`)
- Sell Monitor → Supabase Positions: reads open positions (evidence: `sell/main.py`)
- Sell Monitor → Price Fetcher: requests token price (evidence: `sell/main.py`)
- Price Fetcher → GMGN Prices: fetches (evidence: `sell/gmgn_price.py`)
- Sell Monitor → Sell Placeholder: calls on exit condition (evidence: `sell/main.py`)
- Sell Monitor → Supabase Positions: updates closed position (evidence: `sell/main.py`)
