{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "IPSAS-aligned GL codes for OMNL Hybx (Fineract). Includes core M0/M1, FX/XAU (IAS 21), fees, and IAS 37 provisions.",
  "version": "1.1.0",
  "currencyCode": "USD",
  "accounts": [
    {
      "glCode": "1000",
      "name": "USD Settlement & Reserve Assets",
      "fineractType": "ASSET",
      "usage": "Cash and cash equivalents (IPSAS 2); settlement balances",
      "ipsasStandards": ["IPSAS 2", "IPSAS 28", "IPSAS 29"],
      "ifrsRefs": ["IAS 1", "IFRS 7"],
      "roles": ["settlement", "cash_equivalent"]
    },
    {
      "glCode": "1050",
      "name": "USD Treasury Conversion Reserve (M0)",
      "fineractType": "ASSET",
      "usage": "Reserve backing M1 capacity; financial asset",
      "ipsasStandards": ["IPSAS 28", "IPSAS 29"],
      "ifrsRefs": ["IAS 32", "IFRS 9"],
      "roles": ["m0_reserve", "treasury_reserve"]
    },
    {
      "glCode": "12010",
      "name": "FX reserves — USD",
      "fineractType": "ASSET",
      "usage": "Foreign currency reserves — USD",
      "ipsasStandards": ["IPSAS 29"],
      "ifrsRefs": ["IAS 21"],
      "roles": ["fx_reserve"]
    },
    {
      "glCode": "12020",
      "name": "FX reserves — EUR",
      "fineractType": "ASSET",
      "usage": "Foreign currency reserves — EUR (SEPA settlement)",
      "ipsasStandards": ["IPSAS 29"],
      "ifrsRefs": ["IAS 21"],
      "roles": ["fx_reserve", "eur_settlement"]
    },
    {
      "glCode": "12090",
      "name": "FX reserves — other",
      "fineractType": "ASSET",
      "usage": "Other ISO-4217 and special units including XAU-linked",
      "ipsasStandards": ["IPSAS 29"],
      "ifrsRefs": ["IAS 21", "IFRS 13"],
      "roles": ["fx_reserve", "xau_collateral"]
    },
    {
      "glCode": "12015",
      "name": "Digital asset reserves — BTC (L1 mainnet custody)",
      "fineractType": "ASSET",
      "usage": "HO native BTC L1 custody; debit on confirmed receipt to registered HO address",
      "ipsasStandards": ["IPSAS 2", "IPSAS 28", "IPSAS 29"],
      "ifrsRefs": ["IAS 21", "IFRS 13"],
      "roles": ["digital_asset_reserve", "btc_l1_custody"],
      "inLiveRegistry": false
    },
    {
      "glCode": "12424",
      "name": "Office 24 — digital asset custody — BTC (sent to HO)",
      "fineractType": "ASSET",
      "usage": "Credit on sender-office leg when HO confirms L1 BTC from HOSPITALLERS-24",
      "ipsasStandards": ["IPSAS 28", "IPSAS 29"],
      "ifrsRefs": ["IFRS 13"],
      "roles": ["digital_asset_custody", "interoffice_btc"],
      "officeId": 24,
      "inLiveRegistry": false
    },
    {
      "glCode": "13010",
      "name": "FX settlement — nostro",
      "fineractType": "ASSET",
      "usage": "Settlement balances with correspondent banks",
      "ipsasStandards": ["IPSAS 2", "IPSAS 28"],
      "ifrsRefs": ["IFRS 7"],
      "roles": ["nostro", "correspondent"]
    },
    {
      "glCode": "2000",
      "name": "USD Central Deposits (M1)",
      "fineractType": "LIABILITY",
      "usage": "Demand deposits; financial liability",
      "ipsasStandards": ["IPSAS 28", "IPSAS 29"],
      "ifrsRefs": ["IAS 32", "IFRS 7"],
      "roles": ["m1_liability", "demand_deposit"]
    },
    {
      "glCode": "2100",
      "name": "USD Restricted / Escrow (M1)",
      "fineractType": "LIABILITY",
      "usage": "Restricted liabilities; escrow / fiduciary",
      "ipsasStandards": ["IPSAS 28", "IPSAS 29"],
      "ifrsRefs": ["IAS 32"],
      "roles": ["m1_restricted", "escrow", "fiduciary"]
    },
    {
      "glCode": "21010",
      "name": "M00 — Bank reserves (control)",
      "fineractType": "LIABILITY",
      "usage": "GRU M00 base reserve control (gold-referenced)",
      "ipsasStandards": ["IPSAS 28", "IPSAS 29"],
      "ifrsRefs": ["IAS 32"],
      "roles": ["m00_liability", "gru_base"]
    },
    {
      "glCode": "23010",
      "name": "Provisions — contingent liabilities (IAS 37)",
      "fineractType": "LIABILITY",
      "usage": "Recognized provisions",
      "ipsasStandards": ["IPSAS 19"],
      "ifrsRefs": ["IAS 37"],
      "roles": ["provision"]
    },
    {
      "glCode": "3000",
      "name": "Opening Balance Control",
      "fineractType": "EQUITY",
      "usage": "Migration control; equity",
      "ipsasStandards": ["IPSAS 1", "IPSAS 3"],
      "ifrsRefs": ["IAS 1"],
      "roles": ["equity", "migration_control"]
    },
    {
      "glCode": "42000",
      "name": "FX gains (realized)",
      "fineractType": "INCOME",
      "usage": "Realized foreign exchange gains",
      "ipsasStandards": ["IPSAS 9"],
      "ifrsRefs": ["IAS 21"],
      "roles": ["fx_gain_realized"]
    },
    {
      "glCode": "42100",
      "name": "Unrealized FX gain (P&L)",
      "fineractType": "INCOME",
      "usage": "Unrealized FX gain on revaluation",
      "ipsasStandards": ["IPSAS 9"],
      "ifrsRefs": ["IAS 21", "IFRS 9"],
      "roles": ["fx_gain_unrealized"]
    },
    {
      "glCode": "51000",
      "name": "FX losses (realized)",
      "fineractType": "EXPENSE",
      "usage": "Realized foreign exchange losses",
      "ipsasStandards": ["IPSAS 9"],
      "ifrsRefs": ["IAS 21"],
      "roles": ["fx_loss_realized"]
    },
    {
      "glCode": "52100",
      "name": "Unrealized FX loss (P&L)",
      "fineractType": "EXPENSE",
      "usage": "Unrealized FX loss on revaluation",
      "ipsasStandards": ["IPSAS 9"],
      "ifrsRefs": ["IAS 21", "IFRS 9"],
      "roles": ["fx_loss_unrealized"]
    },
    {
      "glCode": "11040",
      "name": "M00 Gold-Backed Asset Inventory (3FR M00)",
      "fineractType": "ASSET",
      "usage": "Face-value M00 from 3FR discounted exchange (T-3FR-001/002)",
      "ipsasStandards": ["IPSAS 28", "IPSAS 29"],
      "ifrsRefs": ["IFRS 9", "IFRS 13"],
      "usGaapRefs": ["ASC 820", "ASC 860"],
      "roles": ["m00_inventory", "gold_backed"]
    },
    {
      "glCode": "32200",
      "name": "M00 Discount / FVR — 3FR Exchange",
      "fineractType": "EQUITY",
      "usage": "Discount, haircut, monetization reserve / fair value reconciliation",
      "ipsasStandards": ["IPSAS 1", "IPSAS 29"],
      "ifrsRefs": ["IFRS 13", "IAS 1"],
      "usGaapRefs": ["ASC 820"],
      "roles": ["fvr_adjustment", "revaluation_deficit"]
    }
  ],
  "allowedJournalPairs": [
    { "debitGlCode": "1000", "creditGlCode": "2000", "ipsasRef": "IPSAS 3, 28", "memo": "T-001", "ifrsRef": "IAS 32 issuance" },
    { "debitGlCode": "1050", "creditGlCode": "2000", "ipsasRef": "IPSAS 28, 29", "memo": "T-001B", "ifrsRef": "IAS 32 M0 reserve" },
    { "debitGlCode": "2000", "creditGlCode": "2000", "ipsasRef": "IPSAS 28", "memo": "T-002A" },
    { "debitGlCode": "2000", "creditGlCode": "2100", "ipsasRef": "IPSAS 28", "memo": "T-002B" },
    { "debitGlCode": "12020", "creditGlCode": "42100", "ipsasRef": "IPSAS 29", "memo": "FX-REVAL-GAIN", "ifrsRef": "IAS 21 revaluation" },
    { "debitGlCode": "52100", "creditGlCode": "12020", "ipsasRef": "IPSAS 29", "memo": "FX-REVAL-LOSS", "ifrsRef": "IAS 21 revaluation" },
    { "debitGlCode": "52100", "creditGlCode": "23010", "ipsasRef": "IPSAS 19", "memo": "IAS37-PROVISION", "ifrsRef": "IAS 37" },
    { "debitGlCode": "13010", "creditGlCode": "2000", "ipsasRef": "IPSAS 28", "memo": "SETTLE-NOSTRO", "ifrsRef": "IFRS 7 settlement" }
  ],
  "compoundJournalEntries": [
    {
      "memo": "T-3FR-001",
      "debitGlCodes": ["11040", "32200"],
      "creditGlCodes": ["2000"],
      "totalAmountUsd": 900000000000,
      "ipsasRef": "IPSAS 3, 28, 29",
      "ifrsRef": "IFRS 9, IFRS 13, IAS 32",
      "usGaapRef": "ASC 820, ASC 860, ASC 606 excluded",
      "narrative": "3FR M00 substance-only compound — replaces T-001"
    },
    {
      "memo": "T-3FR-002",
      "debitGlCodes": ["11040", "32200"],
      "creditGlCodes": ["1000"],
      "totalAmountUsd": 900000000000,
      "ipsasRef": "IPSAS 28, 29",
      "ifrsRef": "IFRS 9, IFRS 13",
      "usGaapRef": "ASC 820, ASC 860",
      "narrative": "Substance reclass after T-001 settlement receipt — full compliant path"
    }
  ],
  "monetaryLayerHints": {
    "m0_reserve": { "primaryGlCodes": ["1050"], "ipsasNarrative": "Treasury / M0 reserve assets (IPSAS 28, 29)" },
    "m1_liability": { "primaryGlCodes": ["2000", "2100"], "ipsasNarrative": "Financial liabilities — deposits (IPSAS 28, 29)" },
    "m00_gru": { "primaryGlCodes": ["21010"], "ipsasNarrative": "GRU M00 base reserve (gold-referenced)" },
    "settlement": { "primaryGlCodes": ["1000", "13010"], "ipsasNarrative": "Cash and cash equivalents (IPSAS 2)" },
    "equity": { "primaryGlCodes": ["3000"], "ipsasNarrative": "Equity / control (IPSAS 1)" },
    "fx_xau": { "primaryGlCodes": ["12010", "12020", "12090"], "ipsasNarrative": "FX and XAU reserves (IPSAS 29, IAS 21)" },
    "provisions": { "primaryGlCodes": ["23010"], "ipsasNarrative": "Provisions (IPSAS 19, IAS 37)" }
  }
}
