DeveloperBags API

Bags API

Endpoints specific to the Bags.fm vertical.


GET /api/bags/tokens

Returns Bags.fm tokens tracked by Cupdiction.

Query parameters:

ParameterTypeDefaultDescription
statusstringallFilter by Bags lifecycle: PRE_LAUNCH, PRE_GRAD, MIGRATING, MIGRATED, all
has_marketstringalltrue — only tokens with active markets; false — tokens without markets
limitnumber40Max results (max: 100)

Response:

{
  "tokens": [
    {
      "id": "uuid",
      "mint_address": "BeVo4tXrZxdYjnkcvygrPYbF5rs63byrSXShNS3kBAGS",
      "symbol": "DFLASH",
      "name": "DFLASH",
      "image_url": "https://cloudflare-ipfs.com/ipfs/Qm...",
      "bags_status": "PRE_GRAD",
      "graduated": false,
      "graduation_at": null,
      "launch_at": "2026-05-31T10:00:00Z",
      "first_seen_at": "2026-05-31T10:05:00Z",
      "updated_at": "2026-05-31T15:00:00Z",
      "active_market": {
        "market_id": "bags-a1b2c3d4",
        "status": "open",
        "outcome": null,
        "trading_closes_at": "2026-06-01T11:00:00Z",
        "resolves_at": "2026-06-01T12:00:00Z"
      },
      "resolved_market": null
    }
  ],
  "total": 1
}

GET /api/bags/tokens/:mint

Returns full detail for a single Bags.fm token, including all associated markets and resolution snapshots.

Path parameters:

ParameterDescription
:mintSolana token mint address

Response:

{
  "token": {
    "mint_address": "...",
    "symbol": "DFLASH",
    "bags_status": "MIGRATED",
    "graduated": true,
    "graduation_at": "2026-05-30T08:00:00Z",
    "dbc_pool_key": "...",
    "twitter_url": "https://x.com/...",
    "website_url": ""
  },
  "markets": [
    {
      "market_id": "bags-a1b2c3d4",
      "market_type": "graduation",
      "status": "active",
      "oracleStatus": "open",
      "outcome": null,
      "trading_closes_at": "...",
      "resolves_at": "...",
      "q": "Will $DFLASH graduate...",
      "yes": 35,
      "no": 65
    }
  ],
  "snapshots": [
    {
      "resolution_attempted_at": "2026-06-01T10:00:00Z",
      "observed_bags_status": "MIGRATED",
      "observed_damm_pool_key": "...",
      "onchain_pool_exists": true,
      "outcome": "YES",
      "reason": "bags_migrated_and_onchain_pool_confirmed",
      "resolver_version": "v2"
    }
  ]
}

GET /api/bags/receipts

Returns recently resolved Bags.fm markets with outcome and token context.

Query parameters:

ParameterDefaultDescription
limit10Max results (max: 20)

Response:

{
  "receipts": [
    {
      "market_id": "bags-a1b2c3d4",
      "outcome": "YES",
      "resolved_at": "2026-06-01T12:05:00Z",
      "resolution_source": "bags_api_and_onchain",
      "token": {
        "mint_address": "...",
        "symbol": "DFLASH",
        "image_url": "..."
      },
      "question": "Will $DFLASH graduate to DAMM v2 within 24 hours?",
      "vol": "145.50"
    }
  ],
  "total": 1
}

GET /api/bags/fee-races

Returns active and recently resolved fee race markets.

Query parameters:

ParameterDefaultDescription
statusopenopen, resolved, or all

Response:

{
  "races": [
    {
      "id": "uuid",
      "market_id": "fees-e5f6g7h8",
      "deadline_at": "2026-06-07T00:00:00Z",
      "oracle_status": "open",
      "outcome_token_mint": null,
      "token_a": {
        "mint": "...",
        "symbol": "ALPHA",
        "image_url": "...",
        "start_fees": "500000000000",
        "end_fees": null,
        "delta_fees": null
      },
      "token_b": {
        "mint": "...",
        "symbol": "BETA",
        "image_url": "...",
        "start_fees": "300000000000",
        "end_fees": null,
        "delta_fees": null
      },
      "market": {
        "yes": 52,
        "no": 48,
        "vol": "0",
        "status": "active"
      }
    }
  ],
  "total": 1
}

Fees are in lamports (1 SOL = 1,000,000,000 lamports). Convert: lamports / 1e9 = SOL.