Forge Logo

    Forgepad API Documentation

    This document provides comprehensive documentation for all external API endpoints available in the Forgepad platform. The API is built using Next.js API Routes and is designed for token launches, rewards/mining system, and competition leaderboards on Solana.

    Base URL: https://forgepad.fun


    Authentication

    Most public endpoints do not require authentication. Admin endpoints require JWT authentication via cookies.

    For user-facing endpoints, wallet addresses are used as identifiers and must be valid Solana wallet addresses (Base58 encoded, 32-44 characters).


    Token Management

    Create Pool (Upload)

    Creates a new token pool with bonding curve configuration.

    Endpoint: POST /api/upload

    Content-Type: application/json

    Request Body:

    FieldTypeRequiredDescription
    tokenLogostringYesBase64 encoded image (data:image/png;base64,...)
    mintstringYesToken mint public key
    tokenNamestringYesName of the token
    tokenSymbolstringYesToken symbol (e.g., "FORGE")
    userWalletstringYesCreator's wallet address
    tokenSupplynumberYesTotal token supply
    bondingStartMarketcapnumberYesStarting market cap in USD
    bondingMarketcapnumberYesTarget migration market cap in USD
    bondingFeenumberYesTrading fee percentage (e.g., 1 for 1%)
    migrationFeenumberYesMigration fee in basis points
    devBuynumberYesInitial dev buy amount in quote token (0 for no dev buy)
    quoteMintstringYesQuote mint: "SOL", "USDC", "USD1", or "MET"
    tokenDescriptionstringNoToken description
    websitestringNoProject website URL
    twitterstringNoTwitter/X handle or URL
    telegramstringNoTelegram group URL
    distributionTypestringNo"Rewards", "Dividends", "Burn", or "Charity"
    charityOrganizationIdstringNoThe Giving Block organization ID (required for Charity)
    charityOrganizationNamestringNoCharity organization name
    charityOrganizationLogostringNoCharity organization logo URL
    charityThresholdnumberNoSOL threshold for charity donations
    competitionLaunchbooleanNoUse competition bonding curve config

    Example Request:

    json
    {
      "tokenLogo": "data:image/png;base64,iVBORw0KGgoAAAANSUhE...",
      "mint": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
      "tokenName": "My Token",
      "tokenSymbol": "MTK",
      "userWallet": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
      "tokenSupply": 1000000000,
      "bondingStartMarketcap": 5000,
      "bondingMarketcap": 100000,
      "bondingFee": 1,
      "migrationFee": 100,
      "devBuy": 0.5,
      "quoteMint": "SOL",
      "tokenDescription": "A revolutionary token",
      "website": "https://mytoken.com",
      "twitter": "@mytoken"
    }

    Success Response (200):

    json
    {
      "success": true,
      "poolTx": "<base64-encoded-transaction>",
      "curveConfig": "44VcSFBvrj9pUhXCEzv8436wxYTbiXxGvW79MUWuM2W2"
    }

    Notes:

    • The poolTx is a base64-encoded Solana transaction that needs to be signed by the user's wallet
    • For charity tokens, quoteMint must be "SOL"
    • Maximum body size: 10MB (for logo upload)

    Send Transaction

    Signs and sends a transaction with the mint keypair.

    Endpoint: POST /api/send-transaction

    Request Body:

    FieldTypeRequiredDescription
    walletSignedTransactionstringYesBase64 encoded transaction signed by user wallet
    mintSecretKeynumber[]YesMint keypair secret key as byte array
    mintFilenamestringNoFilename for cleanup
    mintSourcestringNo"bot" or "vanity"

    Example Request:

    json
    {
      "walletSignedTransaction": "<base64-transaction>",
      "mintSecretKey": [1, 2, 3, ...],
      "mintSource": "bot",
      "mintFilename": "mint-abc123.json"
    }

    Success Response (200):

    json
    {
      "success": true,
      "signature": "5wHu1qwD7q4XqY4WZ..."
    }

    Get Mint Keypair

    Generates or retrieves a mint keypair for token creation.

    Endpoint: POST /api/get-mint-keypair

    Request Body:

    json
    {
      "prefix": "ABC"
    }

    Success Response (200):

    json
    {
      "publicKey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
      "secretKey": [1, 2, 3, ...],
      "filename": "mint-abc123.json"
    }

    Vanity Keypair

    Generates a vanity keypair with a specific prefix.

    Endpoint: POST /api/vanity-keypair

    Request Body:

    json
    {
      "prefix": "FORGE",
      "caseSensitive": false
    }

    Success Response (200):

    json
    {
      "publicKey": "FORGEabc123...",
      "secretKey": [1, 2, 3, ...],
      "attempts": 15423
    }

    Get Token Distribution

    Gets holder distribution data for a specific token.

    Endpoint: GET /api/token-distribution/[contractAddress]

    Path Parameters:

    ParameterDescription
    contractAddressToken mint address

    Example: GET /api/token-distribution/7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU

    Success Response (200):

    json
    {
      "holders": [
        {
          "address": "9WzDXwBbmkg8...",
          "balance": "1000000",
          "percentage": 10.5
        }
      ],
      "totalHolders": 150,
      "totalSupply": "1000000000"
    }

    Explore/Discovery

    Get Explore Tokens

    Fetches tokens for the explore page, organized by category.

    Endpoint: POST /api/explore/tokens

    Request Body:

    FieldTypeRequiredDescription
    newobjectNoFilter options for new tokens
    graduatingobjectNoFilter options for graduating tokens
    graduatedobjectNoFilter options for graduated tokens

    Each category object supports:

    FieldTypeDefaultDescription
    timeframestring"24h""24h", "7d", or "all"
    sortBystringvariesSort field (see below)
    sortDirstring"desc""asc" or "desc"

    Valid sortBy values:

    • listedTime / launchTimestamp - Launch time
    • bondingCurve / bondingCurveProgress - Bonding curve progress
    • graduatedAt - Graduation timestamp
    • volume / volume24h - 24h trading volume
    • mcap / marketCap - Market capitalization
    • usdPrice - Token price in USD
    • liquidity - Pool liquidity
    • holderCount - Number of holders

    Example Request:

    json
    {
      "new": {
        "timeframe": "24h",
        "sortBy": "launchTimestamp",
        "sortDir": "desc"
      },
      "graduating": {
        "timeframe": "7d",
        "sortBy": "bondingCurveProgress",
        "sortDir": "desc"
      },
      "graduated": {
        "timeframe": "all",
        "sortBy": "mcap",
        "sortDir": "desc"
      }
    }

    Success Response (200):

    json
    {
      "new": {
        "pools": [
          {
            "tokenMint": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
            "name": "My Token",
            "symbol": "MTK",
            "logoUrl": "https://...",
            "mcap": 50000,
            "volume24h": 12500,
            "bondingCurveProgress": 0.45,
            "launchTimestamp": "2024-01-15T10:30:00Z",
            "migrated": false
          }
        ]
      },
      "graduating": {
        "pools": []
      },
      "graduated": {
        "pools": []
      }
    }

    Notes:

    • Maximum 30 tokens returned per category
    • If request body is empty, returns all three categories with default filters

    Get Explore Metrics

    Gets platform-wide metrics for the explore page.

    Endpoint: GET /api/explore/metrics

    Success Response (200):

    json
    {
      "totalTokens": 1500,
      "totalVolume24h": "5000000",
      "totalGraduated": 250,
      "averageBondingProgress": 0.35
    }

    Explore Stream (SSE)

    Server-Sent Events stream for real-time token updates.

    Endpoint: GET /api/explore/stream

    Response: Server-Sent Events stream

    Event Types:

    text
    event: token_created
    data: {"tokenMint": "...", "name": "...", "symbol": "..."}
    
    event: token_graduated
    data: {"tokenMint": "...", "graduatedAt": "..."}
    
    event: price_update
    data: {"tokenMint": "...", "price": 0.00001, "mcap": 50000}

    Competition Leaderboard

    Get Competition Leaderboard

    Fetches the competition leaderboard with real-time pricing data.

    Endpoint: GET /api/competition/leaderboard

    Query Parameters:

    ParameterTypeDefaultDescription
    limitnumber100Max tokens to return (max 500)
    searchstring-Search by token name or symbol
    badgesOnlybooleanfalseOnly return tokens with badges

    Example: GET /api/competition/leaderboard?limit=50&search=FORGE&badgesOnly=true

    Success Response (200):

    json
    {
      "generatedAt": "2024-01-15T10:30:00.000Z",
      "dataFreshnessSeconds": 15,
      "dbcConfigId": "44VcSFBvrj9pUhXCEzv8436wxYTbiXxGvW79MUWuM2W2",
      "tokens": [
        {
          "tokenMint": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
          "name": "Forge Token",
          "symbol": "FORGE",
          "logoUrl": "https://...",
          "twitter": "@forgetoken",
          "telegram": "https://t.me/forgetoken",
          "website": "https://forgepad.fun",
          "mcap": 500000,
          "mcapAth": 750000,
          "volume24h": 125000,
          "usdPrice": 0.0005,
          "liquidity": 50000,
          "fdv": 500000,
          "priceChange24h": 15.5,
          "badge100k": true,
          "badge500k": false,
          "badge1m": false,
          "leaderboardUpdatedAt": "2024-01-15T10:29:45.000Z",
          "marketCapSource": "dbc_sqrt_price",
          "priceSource": "dbc_sqrt_price",
          "debug": null
        }
      ]
    }

    Badge Thresholds:

    • badge100k: Market cap reached $100,000
    • badge500k: Market cap reached $500,000
    • badge1m: Market cap reached $1,000,000

    Rewards System

    The rewards system uses an "ORE" mining metaphor where users earn ORE through trading activity, which can be "smelted" into SOL during smelting cycles.

    User Registration

    Register User

    Registers a user for the rewards program.

    Endpoint: POST /api/rewards/user/register

    Request Body:

    FieldTypeRequiredDescription
    walletAddressstringYesUser's Solana wallet address
    referralCodestringNoReferral code from another user

    Example Request:

    json
    {
      "walletAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
      "referralCode": "FORGE123"
    }

    Success Response (200):

    json
    {
      "success": true,
      "user": {
        "walletAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
        "username": null,
        "points": 0,
        "lifetimePoints": 0,
        "referralCode": "USER_ABC123",
        "referredBy": "FORGE123",
        "tier": "bronze",
        "isRegistered": true
      },
      "isNew": true,
      "registered": true,
      "referralSet": true
    }

    Check Username Availability

    Checks if a username is available.

    Endpoint: POST /api/rewards/user/check-username

    Request Body:

    json
    {
      "username": "CryptoKing"
    }

    Success Response (200):

    json
    {
      "available": true,
      "username": "CryptoKing"
    }

    Error Response (409):

    json
    {
      "available": false,
      "error": "Username already taken"
    }

    Set Username

    Sets or updates the user's display name.

    Endpoint: POST /api/rewards/user/username

    Request Body:

    json
    {
      "walletAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
      "username": "CryptoKing"
    }

    Success Response (200):

    json
    {
      "success": true,
      "username": "CryptoKing"
    }

    Validation Rules:

    • 3-20 characters
    • Alphanumeric and underscores only
    • Case-insensitive uniqueness check

    User Data

    Get User Dashboard Data

    Retrieves comprehensive dashboard data for a user.

    Endpoint: GET /api/rewards/user/[wallet]

    Path Parameters:

    ParameterDescription
    walletUser's wallet address

    Example: GET /api/rewards/user/9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM

    Success Response (200):

    json
    {
      "walletAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
      "username": "CryptoKing",
      "isRegistered": true,
      "currentEpoch": "2024-01",
      "currentOre": 15000,
      "oreExpiringSoon": 5000,
      "oreLifetime": 150000,
      "oreTotalSmelted": 100000,
      "volumeCurrentEpoch": "50000000000",
      "volumeLifetime": "500000000000",
      "referral": {
        "referrerWallet": "4xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
        "referrerUsername": "Referrer123",
        "totalReferees": 10,
        "totalRefereePoints": 5000,
        "selfBonusEarned": 2500
      },
      "rewards": [
        {
          "epochId": "2024-01",
          "cycleId": "cycle_001",
          "points": 10000,
          "claimableSol": "0.5",
          "claimed": false,
          "expiresAt": "2024-02-15T00:00:00.000Z",
          "startedAt": "2024-01-01T00:00:00.000Z",
          "smelterOpenUntil": "2024-01-03T00:00:00.000Z"
        }
      ]
    }

    Volume Values:

    • Volumes are returned as strings representing lamports (1 SOL = 1,000,000,000 lamports)
    • Convert to SOL: parseFloat(volume) / 1e9

    Get Points History

    Gets a user's point event history.

    Endpoint: GET /api/rewards/points/history

    Query Parameters:

    ParameterTypeDefaultDescription
    walletstringRequiredWallet address
    limitnumber50Max events to return
    offsetnumber0Pagination offset

    Example: GET /api/rewards/points/history?wallet=9WzDXw...&limit=20

    Success Response (200):

    json
    {
      "events": [
        {
          "eventType": "trade",
          "basePoints": 1000,
          "selfBonusPoints": 50,
          "referrerBonusPoints": 0,
          "totalPoints": 1050,
          "epochId": "2024-01",
          "createdAt": "2024-01-15T10:30:00.000Z",
          "expiresAt": "2024-02-14T10:30:00.000Z"
        }
      ],
      "pagination": {
        "limit": 20,
        "offset": 0,
        "hasMore": true
      }
    }

    Leaderboard

    Get ORE/Volume Leaderboard

    Fetches the rewards leaderboard.

    Endpoint: GET /api/rewards/leaderboard

    Query Parameters:

    ParameterTypeDefaultDescription
    typestring"ore""ore" or "volume"
    limitnumber50Max entries (max 100)
    offsetnumber0Pagination offset
    walletstring-Get user's rank

    Example: GET /api/rewards/leaderboard?type=ore&limit=50&wallet=9WzDXw...

    Success Response (200):

    json
    {
      "epochId": "2024-01",
      "type": "ore",
      "entries": [
        {
          "rank": 1,
          "walletAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
          "username": "TopMiner",
          "currentOre": 500000,
          "tier": "platinum"
        },
        {
          "rank": 2,
          "walletAddress": "4xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
          "username": null,
          "currentOre": 350000,
          "tier": "gold"
        }
      ],
      "userRank": {
        "oreRank": 15,
        "volumeRank": 23
      },
      "pagination": {
        "limit": 50,
        "offset": 0,
        "hasMore": true
      }
    }

    Tier Thresholds:

    • Bronze: 0+ ORE
    • Silver: 10,000+ ORE
    • Gold: 100,000+ ORE
    • Platinum: 1,000,000+ ORE

    Smelting

    Get Smelt Status

    Gets the current smelter status and user's smelting info.

    Endpoint: GET /api/rewards/smelt/status

    Query Parameters:

    ParameterTypeRequiredDescription
    walletstringYesUser's wallet address

    Example: GET /api/rewards/smelt/status?wallet=9WzDXw...

    Success Response (200):

    json
    {
      "smelter": {
        "is_open": true,
        "manual_override": false,
        "current_window": {
          "opens": "2024-01-15T00:00:00.000Z",
          "closes": "2024-01-17T00:00:00.000Z"
        },
        "next_window_opens": "2024-01-29T00:00:00.000Z",
        "next_window_closes": "2024-01-31T00:00:00.000Z",
        "hours_until_open": 0
      },
      "user": {
        "available_ore": 15000,
        "ore_expiring_soon": 5000,
        "expired_ore": 0,
        "already_smelted_ore": 10000,
        "pool_balance_sol": "10.5",
        "total_unsmelted_ore": 500000,
        "estimated_sol": "0.315",
        "can_smelt": true,
        "message": "Smelter is open! You can smelt your ORE now."
      }
    }

    Smelting Schedule:

    • Smelter opens every 14 days
    • Smelter window: 48 hours
    • ORE expires after 30 days if not smelted
    • Claims expire 30 days after smelting completes

    Execute Smelt

    Submits ORE to the current smelting cycle.

    Endpoint: POST /api/rewards/smelt/execute

    Request Body:

    json
    {
      "walletAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
    }

    Success Response (200):

    json
    {
      "success": true,
      "cycleId": "cycle_001",
      "oreSubmitted": 15000,
      "estimatedSol": "0.315",
      "message": "Successfully submitted 15,000 ORE to smelting cycle"
    }

    Error Response (400):

    json
    {
      "error": "Smelter is not currently open"
    }

    Claims

    Claim Smelted SOL

    Claims SOL rewards from a completed smelting cycle.

    Endpoint: POST /api/rewards/claim

    Request Body:

    FieldTypeRequiredDescription
    cycleIdstringYesSmelting cycle ID
    walletAddressstringYesUser's wallet address

    Example Request:

    json
    {
      "cycleId": "679a1b2c3d4e5f6789012345",
      "walletAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
    }

    Success Response (200):

    json
    {
      "success": true,
      "txSignature": "5wHu1qwD7q4XqY4WZ...",
      "claimedSol": "0.499000000",
      "grossSol": "0.5",
      "gasReserve": "0.001"
    }

    Notes:

    • Gas reserve of 0.001 SOL is deducted to cover transaction fees
    • Rate limited: 60 requests per minute
    • Claims expire 30 days after cycle completion

    Error Responses:

    StatusErrorDescription
    400"Missing cycleId"Cycle ID not provided
    400"Invalid cycle ID format"Invalid MongoDB ObjectId
    400"Claim amount too small"Less than gas reserve
    400"Claim window expired"30-day window passed
    400"Reward has been forfeited"Already expired
    403"Wallet banned"User is banned
    403"ORE balance verification failed"Security check failed
    404"Cycle reward not found"No reward for this wallet/cycle
    409"Already claimed"Reward already claimed
    503"Claims disabled"Kill switch activated

    Referrals

    Get Referral Stats

    Gets referral statistics for a user.

    Endpoint: GET /api/rewards/referrals/stats

    Query Parameters:

    ParameterTypeRequiredDescription
    walletstringYesUser's wallet address

    Example: GET /api/rewards/referrals/stats?wallet=9WzDXw...

    Success Response (200):

    json
    {
      "totalTrades": 150,
      "totalVolume": "500000000000",
      "averageOrePerMiner": 12500,
      "topMiner": {
        "walletAddress": "4xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
        "username": "TopReferee",
        "totalOre": 50000
      },
      "miners": [
        {
          "walletAddress": "4xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
          "username": "TopReferee",
          "totalOre": 50000,
          "volumeLifetime": "100000000000",
          "joinedAt": "2024-01-10T10:30:00.000Z"
        }
      ]
    }

    Get Referral Earnings

    Gets detailed referral earnings breakdown.

    Endpoint: GET /api/rewards/referrals/earnings

    Query Parameters:

    ParameterTypeRequiredDescription
    walletstringYesUser's wallet address

    Success Response (200):

    json
    {
      "totalEarnings": 25000,
      "earningsThisEpoch": 5000,
      "refereeCount": 10,
      "bonusRate": 10
    }

    Bonus Rates:

    • Referrer bonus: 10% of referee's earned ORE
    • Self bonus: 5% bonus for having a referrer

    Bonus Pool

    Get Bonus Pool Status

    Gets the current status of the ember drop bonus pool.

    Endpoint: GET /api/rewards/bonus/status

    Success Response (200):

    json
    {
      "balance": "5.25",
      "isActive": true,
      "recentDrops": [
        {
          "amount": "0.05",
          "timestamp": "2024-01-15T10:30:00.000Z",
          "walletAddress": "9WzDXw..."
        }
      ]
    }

    Ember Drop Mechanics:

    • 0.1% probability per qualifying trade
    • Maximum 0.5 SOL per drop
    • Minimum 0.1 SOL trade volume required

    Platform Stats

    Get Platform Statistics

    Gets platform-wide reward statistics.

    Endpoint: GET /api/rewards/stats/platform

    Success Response (200):

    json
    {
      "totalMiners": 1500,
      "totalOreEarned": 50000000,
      "totalSolDistributed": "1250.5",
      "activeCycle": {
        "cycleId": "cycle_002",
        "status": "active",
        "solPool": "15.5",
        "totalOre": 750000
      },
      "currentEpoch": "2024-01"
    }

    Charity

    Get Charity Organizations

    Fetches available charity organizations from The Giving Block.

    Endpoint: GET /api/charity/organizations

    Query Parameters:

    ParameterTypeDefaultDescription
    debugstring-Set to "1" for raw response

    Example: GET /api/charity/organizations

    Success Response (200):

    json
    {
      "organizations": [
        {
          "id": "org_123abc",
          "name": "Save the Children",
          "logo": "https://...",
          "description": "Global children's charity",
          "category": "Children & Youth"
        },
        {
          "id": "org_456def",
          "name": "Red Cross",
          "logo": "https://...",
          "description": "Humanitarian aid organization",
          "category": "Disaster Relief"
        }
      ]
    }

    Get Charity Transactions

    Gets donation transactions for charity tokens.

    Endpoint: GET /api/charity/transactions

    Query Parameters:

    ParameterTypeRequiredDescription
    tokenMintstringNoFilter by token
    limitnumberNoMax results

    Success Response (200):

    json
    {
      "transactions": [
        {
          "txSignature": "5wHu1qwD7q4...",
          "tokenMint": "7xKXtg2CW87d...",
          "organizationId": "org_123abc",
          "organizationName": "Save the Children",
          "amount": "1.5",
          "timestamp": "2024-01-15T10:30:00.000Z"
        }
      ]
    }

    Error Handling

    All endpoints follow a consistent error response format:

    json
    {
      "error": "Human-readable error message"
    }

    HTTP Status Codes

    CodeDescription
    200Success
    400Bad Request - Invalid input
    401Unauthorized - Authentication required
    403Forbidden - Access denied
    404Not Found - Resource doesn't exist
    405Method Not Allowed - Wrong HTTP method
    409Conflict - Resource already exists
    429Too Many Requests - Rate limited
    500Internal Server Error
    503Service Unavailable - System disabled

    Rate Limiting

    The API implements rate limiting to prevent abuse:

    Endpoint CategoryLimitWindow
    Authentication5 requests15 minutes
    General API60 requests1 minute
    Claims60 requests1 minute

    Rate limit responses return:

    json
    {
      "error": "Too many requests"
    }

    With header: Retry-After: <seconds>


    Types Reference

    UserTier

    typescript
    type UserTier = 'bronze' | 'silver' | 'gold' | 'platinum';

    PointEventType

    typescript
    type PointEventType = 'trade' | 'referral' | 'bonus' | 'smelter' | 'adjustment' | 'ember_drop';

    CycleStatus

    typescript
    type CycleStatus = 'pending' | 'active' | 'smelting' | 'completed' | 'cancelled';

    TradeDirection

    typescript
    type TradeDirection = 'buy' | 'sell';

    QuoteMint

    typescript
    type QuoteMint = 'SOL' | 'USDC' | 'USD1' | 'MET';

    DistributionType

    typescript
    type DistributionType = 'Rewards' | 'Dividends' | 'Burn' | 'Charity';

    Constants

    ORE Economics

    ConstantValueDescription
    ORE per SOL Volume1,000ORE earned per 1 SOL traded
    ORE Lifetime30 daysBefore expiration
    Claim Window30 daysAfter cycle completion
    Smelter Window48 hoursHow long smelter stays open
    Smelter Interval14 daysBetween smelting cycles

    Referral Bonuses

    Bonus TypeRateDescription
    Self Bonus5%Bonus for having a referrer
    Referrer Bonus10%Bonus from referee's earnings

    Ember Drops

    SettingValueDescription
    Drop Probability0.1%Per qualifying trade
    Max Drop Amount0.5 SOLMaximum per drop
    Min Trade Volume0.1 SOLMinimum to qualify

    WebSocket/SSE Events

    The explore stream endpoint (GET /api/explore/stream) provides real-time updates via Server-Sent Events:

    Connection

    javascript
    const eventSource = new EventSource('/api/explore/stream');
    
    eventSource.addEventListener('token_created', (event) => {
      const data = JSON.parse(event.data);
      console.log('New token:', data);
    });
    
    eventSource.addEventListener('token_graduated', (event) => {
      const data = JSON.parse(event.data);
      console.log('Token graduated:', data);
    });
    
    eventSource.addEventListener('price_update', (event) => {
      const data = JSON.parse(event.data);
      console.log('Price update:', data);
    });

    SDK Usage Examples

    Creating a Token

    javascript
    // 1. Get mint keypair
    const mintRes = await fetch('/api/get-mint-keypair', { method: 'POST' });
    const { publicKey, secretKey, filename } = await mintRes.json();
    
    // 2. Create pool transaction
    const poolRes = await fetch('/api/upload', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        tokenLogo: logoBase64,
        mint: publicKey,
        tokenName: 'My Token',
        tokenSymbol: 'MTK',
        userWallet: walletAddress,
        tokenSupply: 1000000000,
        bondingStartMarketcap: 5000,
        bondingMarketcap: 100000,
        bondingFee: 1,
        migrationFee: 100,
        devBuy: 0.5,
        quoteMint: 'SOL'
      })
    });
    const { poolTx } = await poolRes.json();
    
    // 3. Sign with wallet
    const tx = Transaction.from(Buffer.from(poolTx, 'base64'));
    const signedTx = await wallet.signTransaction(tx);
    
    // 4. Send transaction
    const sendRes = await fetch('/api/send-transaction', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        walletSignedTransaction: signedTx.serialize().toString('base64'),
        mintSecretKey: Array.from(secretKey),
        mintFilename: filename,
        mintSource: 'bot'
      })
    });
    const { signature } = await sendRes.json();

    Claiming Rewards

    javascript
    // 1. Check smelt status
    const statusRes = await fetch(`/api/rewards/smelt/status?wallet=${walletAddress}`);
    const { smelter, user } = await statusRes.json();
    
    // 2. Get user dashboard for available rewards
    const dashRes = await fetch(`/api/rewards/user/${walletAddress}`);
    const { rewards } = await dashRes.json();
    
    // 3. Claim unclaimed reward
    const unclaimedReward = rewards.find(r => !r.claimed && !r.forfeited);
    if (unclaimedReward) {
      const claimRes = await fetch('/api/rewards/claim', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          cycleId: unclaimedReward.cycleId,
          walletAddress
        })
      });
      const { txSignature, claimedSol } = await claimRes.json();
    }

    Documentation generated for Forgepad API v1.0