Babylon Segment Ledger CSV Specification
A Babylon segment is a ledger of transactions for a group of security positions, regardless of the brokerage accounts through which the transactions were executed. Each security and all its transactions should belong to one segment so that position and capital-gains calculations have a complete history.
The current CSV importer reads the headers below. Header order is not significant. Dates use YYYY-MM-DD, and numeric values should not contain thousands separators.
Core columns
SegmentLedger— segment identifier carried by the source file. The current segment-create service derives stored segment identifiers from the bourse and replaces this input value; the header remains part of the portable CSV format.AccountAlias— reporting alias for a brokerage account. The canonical form is<alias>-<accountType>. If the suffix is omitted, the parser usesGIA. The supported account types areGIA,ISA,SIPP,TFSA,TFIAandRA.TradeDate— trade date.SettleDate— settlement date.Bourse— exchange or fund-market code, for exampleLSE,JSE,XLON,XJSE,GBFUNDorZAFUND.Symbol— listing ticker. Use the SEDOL for a UK non-listed fund and the assigned JSE alpha code for a South African non-listed fund.Type—BuyorSell.Quantity— number of shares or units traded.NetAmount— total cash amount, including transaction costs.Currency— currency ofNetAmount.
AccountAlias names begin with a letter and may contain letters, digits, underscores and hyphens. Spaces are not accepted.
Optional columns
Price— price per unit.PriceCcy— currency in whichPriceis quoted.Commission— broker commission.StrateFee— Strate fee.VAT— value-added tax.Levy— transaction levy.SecuritiesTax— securities transfer tax.InvoiceNumber— source invoice or contract-note number.MessageId— source message identifier.
Sign convention
The CSV importer converts Quantity to its absolute value. Direction is therefore supplied by Type.
The importer preserves the sign supplied for NetAmount. Use the cash-direction convention exercised by the importer and service tests:
- a Buy has a negative
NetAmount; - a Sell has a positive
NetAmount.
The importer does not repair an inconsistent NetAmount sign, so producers should supply it correctly.
Example
SegmentLedger,AccountAlias,TradeDate,SettleDate,Bourse,Symbol,Type,Quantity,NetAmount,Currency
MyGBSegment,AJBell-ISA,2025-10-08,2025-10-10,LSE,PNL,Buy,100,-531.80,GBP
MyGBSegment,AJBell-ISA,2026-01-08,2026-01-12,LSE,PNL,Sell,25,145.20,GBP
The first row may also contain a negative quantity; the importer normalises it to 100. The net-amount signs are retained.