Liquidity Docs

Data Model

The Transfer Agent's state lives in three places that are kept reconcilable:

The Transfer Agent's state lives in three places that are kept reconcilable: Postgres (system of record), the on-chain ERC-3643 contracts, and the FBO cash ledger (also in Postgres). Migrations are goose files under transfer-agent-api/pkg/db/migrations/.

1. On-chain contracts (ERC-3643 suite)

The security is a permissioned ERC-3643 token; ownership and compliance are enforced on-chain.

ContractRole
SecurityTokenThe ERC-3643 permissioned security. Holds balances, freezes, and enforces transfer compliance.
IdentityRegistryMaps wallets to verified ONCHAINID identities; gates who may hold.
ModularCompliancePluggable transfer rules (jurisdiction, limits, lockups).
USDLStablecoin used for on-chain cash legs (USDL dividend path, settlement).
SettlementDelivery-vs-payment settlement of trades.

On the org devnet (wallet-api, chainId 8675399) the shared infra contracts are: token_settlement, settlement_verifier, venue_module, multisig_factory, multisig_impl, signer_guard, and usdl (deployed lazily on first deposit). Token amounts are base units (scaled by 10^decimals).

2. Core Postgres tables (ta-api read model + modules)

TableHolds
tokensRegistered securities (contract address, symbol, name, decimals, asset_type, supply)
positionsPer-holder balances (wallet, token, balance, frozen), linked to holders
holdersHolder identities (primary_wallet, onchain_id, kyc_status, accreditation, country, name, email)
identitiesRegistry state per holder (registered, frozen, onchain_id)
compliance_rulesCompliance rule definitions + versions
distributionsDeclared dividends (token_id, record_date_block, rate, status, total_holders, total_amount)
entitlementsPer-holder dividend amounts (distribution_id, holder_id, wallet, amount [USD cents], paid, tx_hash)
operationsMaker-checker operation ledger (kind, payload, state, maker, checker, failure_reason, tx_hash)
audit_logTamper-evident, hash-chained audit trail
chain_eventsRaw indexed on-chain events
indexer_checkpointsIndexer progress per contract
recon_runs, recon_diffsOn-chain vs DB reconciliation runs + drift
captableImported cap-table rows (Carta)
onchain_kvSmall on-chain-derived key/value cache
mpc_walletsMPC wallet provisioning saga state (keygen -> v42 -> onboarded -> ready)

3. FBO cash sub-ledger (subledger-api)

Strict double-entry over the omnibus. Append-only; every transaction balances. Money is integer minor units (USD cents).

TableHolds
ledger_accountsAccounts: fbo_control, investor_subaccount, suspense, fee_revenue, settlement_clearing
ledger_transactionsAppend-only transactions (type, reference, narrative, created_by, idempotency_key)
ledger_entriesThe debit/credit legs (transaction_id, account_id, direction, amount_minor)
account_balancesCached balances (recomputable from entries)
holdsReservations reducing available balance (reason, status, amount)
payoutsWithdrawals + dividend payouts (amount, destination, state, maker, checker, distribution_id, funding_mode, ledger_tx, bank_account_id)
bank_transactionsImported bank statement lines, matched to ledger
wire_intentsDeclared expected incoming wires (open/matched/cancelled)
bank_accountsPlaid-linked accounts (owner_type, owner_ref, plaid ids, mask, subtype, selected)
funding_eventsOperator funding of the omnibus (amount, plaid status, ledger_tx)
subledger_recon_runsFBO ledger vs bank reconciliation results

The reconciliation identity

fbo_control  =  suspense  +  Σ investor wallets  +  fee_revenue  +  settlement_clearing

Every posting preserves it. Examples:

EventDebitCredit
Deposit (wallet load)fbo_controlinvestor wallet
Operator fundingfbo_controlsuspense
Dividend (prefunded)suspenseinvestor wallet
Dividend (auto)fbo_controlinvestor wallet
Fee / interestinvestor wallet / fbo_controlfee_revenue
Withdrawal (settle)investor walletfbo_control

4. Units summary

DomainUnitExample
On-chain token amountsbase units (10^decimals)1000000000000000000 = 1 token (18 dp)
wallet-api wireDISPLAY units1000 = 1000 tokens
FBO cash / dividendsUSD minor units (cents)5000 = $50.00

The devnet-bridge converts wallet-api DISPLAY units to base units at the boundary; dividend entitlement amounts are computed in USD cents and map straight to the FBO ledger.