- Free and open source. The source is on GitHub under GPL-3.0-or-later.
- An app from the browser. P-Lens is opened at app.p-lens.jp and installed from there to the home screen. It is not in the app stores.
- Offline. Everything needed to record and read a book is kept on the device, so it works without a connection.
- No login, no ads. There is no account to make, and no advertising in the app.
- In Japanese. The app's screens are in Japanese, as are the parlors, machines and terms it deals with.
Overview
A book for your own pachinko and pachislot
P-Lens is a free, open-source bookkeeping app for a player's own pachinko and pachislot results in Japan. It records what each play cost, what was left, what is on deposit at which parlor and what was exchanged at the counter, and keeps it all as plain-text hledger journals on the player's own device.
The app
Free, open, and on your device
The book
What it records
One play at one machine is one entry. An entry can be as short as the cash spent and what came back, and as full as the following:
- Cash spent on renting balls or tokens.
- Balls and tokens, counted per parlor and per rental rate. A ball at one parlor is not a ball at another, so each is a unit of its own.
- Deposits (貯玉, cho-dah-ma): the balls or tokens left with a parlor to play another day, as a balance at that parlor, valued at that parlor's exchange rate.
- Prizes received at the parlor's counter in exchange for balls or tokens.
- Play time.
- Theoretical value (期待値, ki-tai-chi; players call it 仕事量, shi-go-to-ryoh): the cumulative theoretical gain or loss of the plays actually done, under their calculation conditions. It is kept beside the result, never mixed into it.
From these the app draws a calendar of each day's result and theoretical value, breakdowns by machine, parlor, weekday, tag or month, and each parlor's deposits valued on any day.


The file
A book in plain text
The book of record is a set of hledger journal files, kept in the browser's storage on the device. P-Lens runs hledger itself in the browser, compiled to WebAssembly, and every change is read by hledger before it is kept. Nothing the book adds up to is stored apart from it.
The files are the same ones hledger reads on a computer. A book can be exported as journal files, CSV or a zip, and backed up to Google Drive or to a file. If P-Lens went away, the journals would still read with hledger -f main.journal.

Theoretical value
The numbers behind each play
For each machine the app works from a calculation condition (算出条件): the machine's figures, as typed in or as worked out on the device from the machine's specification by an exact calculation in Rust and WebAssembly. Machines and their calculation conditions come from a catalog every user shares and adds to.
- Pachinko. The spin rate per 1,000 yen, measured while playing, or worked out afterwards from play time and the money in and out, gives the theoretical value and the break-even spin rate (ボーダー, boh-dah) at the parlor's rental and exchange rates.
- Pachislot. The figures on the data counter, and small wins counted while playing, give how likely each setting level is, by Bayesian inference, and the theoretical value that follows.
- The grounds. How a calculation condition was derived is built on the device as a proof tree by Trealla Prolog, and shown checked against the engine's answer.
A play can be followed live at the machine, each reading recalculating the figures, and becomes an entry in the book when it is recorded.
Sync and sharing
Between your devices, and with friends
A book can be kept in step between a phone and a computer, and shared with other players: to edit, to view, or only to receive their plays without seeing the book. Several books can be added up into one view, by book or by player.
Friends playing on the same day can also follow each other's machines live, joining by a QR code. That view is for the day at hand and writes nothing in anyone's book.
Everything that crosses devices is encrypted on the device before it leaves, and travels through a relay over the Nostr protocol. The relay passes it on; it cannot read the books or plays it carries.
Other apps
Bringing a record in, and taking it out
Past results can be imported from pRecord, ぱち簿, MAXBET, Myパチ収支表, マネクルSP and パチフォリオ, and exported in each one's own format. Any other app's records, or a spreadsheet of one's own, come in as a CSV in a general format, choosing what each column is.
Japan's rules
A book that ends at the prize counter
In Japan, you cannot cash out at the pachinko parlor. Balls and tokens are exchanged for prizes at the parlor's counter, and P-Lens records exactly that: its book ends at the counter, with prizes, and has no step that turns balls into cash.The page on Japan's pachinko parlors explains how a visit works and what the law says.
Cost
What it costs
Everything in P-Lens is free. Sync between devices and people goes through a relay server the project runs, and sync alone may become paid at some point. A relay can also be run by oneself, with one's own build of the app; then sync stays free, on one's own server.
Technology
How it is built
hledger compiled to WebAssembly keeps the books, calculation engines written in Rust work out the numbers, Trealla Prolog builds the proofs, SolidJS draws the screens, and Nostr carries what crosses devices. The source is on GitHub.
The engineering notes go into each part, with the code:
- Law shapes the ledger: modeling Japanese pachinko
- Modeling pachinko machines nobody has invented yet
- A Discord-like layout in SolidJS
- Beyond money: hledger as an aggregation engine
- Encrypted ledger sync over Nostr