TokenTax Integration

We design and develop full-cycle blockchain solutions: from smart contract architecture to launching DeFi protocols, NFT marketplaces and crypto exchanges. Security audits, tokenomics, integration with existing infrastructure.
Showing 1 of 1 servicesAll 1306 services
TokenTax Integration
Simple
~2-3 business days
FAQ
Blockchain Development Services
Blockchain Development Stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1214
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_logo-advance_0.png
    B2B Advance company logo design
    561
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823

TokenTax Integration

TokenTax is a crypto tax service oriented toward advanced users: supports DeFi transactions, margin trading, futures, and NFT. Suitable for traders with complex portfolios.

Supported Formats

TokenTax accepts data in several formats:

// TokenTax Generic CSV
interface TokenTaxRow {
  type: "Trade" | "Income" | "Mining" | "Gift" | "Expense" | "Transfer";
  buyAmount: string;
  buyCurrency: string;
  sellAmount: string;
  sellCurrency: string;
  feeAmount: string;
  feeCurrency: string;
  exchange: string;
  group: string;  // for grouping related transactions
  comment: string;
  date: string;   // "YYYY-MM-DD HH:mm:ss"
}

function exportToTokenTaxCSV(transactions: InternalTransaction[]): string {
  const headers = [
    "Type", "BuyAmount", "BuyCurrency", "SellAmount", "SellCurrency",
    "FeeAmount", "FeeCurrency", "Exchange", "Group", "Comment", "Date"
  ];
  
  const rows = transactions.map(tx => [
    mapToTokenTaxType(tx.taxCategory),
    tx.amountIn?.toString() ?? "",
    tx.assetIn ?? "",
    tx.amountOut?.toString() ?? "",
    tx.assetOut ?? "",
    tx.feeAmount?.toString() ?? "",
    tx.feeCurrency ?? "",
    tx.source ?? "",
    tx.groupId ?? "",          // group LP operations together
    tx.notes ?? "",
    format(tx.timestamp, "yyyy-MM-dd HH:mm:ss"),
  ].join(","));
  
  return [headers.join(","), ...rows].join("\n");
}

function mapToTokenTaxType(category: TaxCategory): string {
  const typeMap: Record<TaxCategory, string> = {
    [TaxCategory.SWAP]: "Trade",
    [TaxCategory.BUY]: "Trade",
    [TaxCategory.SELL]: "Trade",
    [TaxCategory.STAKING_REWARD]: "Income",
    [TaxCategory.AIRDROP]: "Income",
    [TaxCategory.MINING_REWARD]: "Mining",
    [TaxCategory.TRANSFER]: "Transfer",
    [TaxCategory.GAS_FEE]: "Expense",
  };
  return typeMap[category] || "Trade";
}

DeFi Grouping

TokenTax can handle complex DeFi operations if you group them correctly:

// For LP deposit — group related transactions
function exportLPOperationAsGroup(
  lpDeposit: LiquidityDepositEvent,
  groupId: string
): TokenTaxRow[] {
  // Two tokens given → LP token received
  return [
    {
      type: "Trade",
      buyAmount: lpDeposit.lpTokenAmount.toString(),
      buyCurrency: `${lpDeposit.token0}-${lpDeposit.token1}-LP`,
      sellAmount: lpDeposit.token0Amount.toString(),
      sellCurrency: lpDeposit.token0,
      feeAmount: "",
      feeCurrency: "",
      exchange: "Uniswap",
      group: groupId,
      comment: "LP deposit token0",
      date: format(lpDeposit.timestamp, "yyyy-MM-dd HH:mm:ss"),
    },
    // second token in separate row of same group
    {
      type: "Trade",
      buyAmount: "",
      buyCurrency: "",
      sellAmount: lpDeposit.token1Amount.toString(),
      sellCurrency: lpDeposit.token1,
      feeAmount: lpDeposit.gasUSD?.toString() ?? "",
      feeCurrency: "USD",
      exchange: "Uniswap",
      group: groupId,
      comment: "LP deposit token1",
      date: format(lpDeposit.timestamp, "yyyy-MM-dd HH:mm:ss"),
    },
  ];
}

TokenTax integration via CSV export with DeFi grouping support — 2-4 business days.