Documentation

Quickstart + configuration

What is SolGate?

SolGate is a minimal HTTP 402 payment layer. Add a configurable fee on every paid request and route it into a buyback vault — converting real usage into real buy pressure.

Fee split

// Payment split math (example)
basePrice = 0.01 USDC
feeBps    = 50        // 0.50%
fee       = basePrice * (feeBps / 10_000) = 0.00005 USDC
merchant  = basePrice - fee = 0.00995 USDC

Install

npm i solgate
# or
pnpm add solgate

Usage

import express from "express";
import { solgate } from "solgate";

const app = express();

app.get(
  "/api/pro",
  solgate({
    merchant: {
      address: "MERCHANT_WALLET",
      priceUSDC: 0.01
    },
    fee: {
      bps: 50,
      destination: "BUYBACK_VAULT_WALLET"
    }
  }),
  async (req, res) => {
    res.json({ ok: true });
  }
);

Config reference

Minimal config you need to run SolGate.

type SolGateConfig = {
  merchant: {
    address: string;     // merchant destination address
    priceUSDC: number;   // base price per request
  };
  fee: {
    bps: number;         // basis points (e.g. 50 = 0.50%)
    destination: string; // buyback vault / treasury address
  };
};

// Example
solgate({
  merchant: {
    address: "MERCHANT_WALLET",
    priceUSDC: 0.01
  },
  fee: {
    bps: 50,
    destination: "BUYBACK_VAULT_WALLET"
  }
});

Buyback vault

SolGate routes fee revenue to a vault address. Buybacks can be run on a schedule (cron) or manually — publish receipts either way.

// buyback-bot pseudocode
// 1) read vault USDC balance
// 2) if balance >= MIN_SWAP:
//    - swap USDC -> target token via DEX aggregator
//    - send bought tokens to burn/treasury
// 3) log tx hash + amount for receipts

Security notes

  • Use a dedicated vault wallet per project.
  • Log every buyback transaction publicly (tx hash, amounts).
  • Set minimum swap thresholds to avoid dust swaps.
  • Do not promise “guaranteed profits.” Focus on fee routing and transparent receipts.

FAQ

Does this create sell pressure?
No transfer taxes. Fees come from paid usage, then can be swapped into buybacks.

Can any project use it?
Yes. They set their vault + fee parameters in config.

Do buybacks have to be automatic?
No. You can run scheduled buybacks or manual buybacks with public receipts.