Trading with villagers
Villager Trading · mechanic · Tradery
Right-clicking a villager opens Tradery's trade window in place of the vanilla one. The offers are the same, with the same levels, use limits, discounts, Hero of the Village prices and experience. One thing differs: every emerald in an offer is shown and paid as money, 3 per emerald unless the server changed villagerTrading.emeraldValue.

Who pays whom
When you buy, the price leaves your balance. 10% of it goes to the village treasury as trade tax and the rest into the villager's wallet.
When you sell, the villager pays you out of its wallet. An empty wallet ends the selling for the day: "… is out of money for today. Come back tomorrow". Wallets refill once per in-game day; the amounts are under villagers.
The window shows your balance, "Villager's money" and "Trades left" for the selected offer. A discounted offer shows its old price struck out.
Buttons
"Trade" does the selected offer once, and so does a double-click on it. "Trade all" repeats it while your money, your items, the villager's money and the offer's uses last, up to 64 times in one go.
What happens to emeralds
Emeralds stay an ordinary item. The changer on a village market sells them for 3 and buys them for 2, a vending block with an item price can ask for them, and wandering traders still trade in emeralds. A caravan trader is the exception: it uses this window and money.
Getting the vanilla window back
Set villagerTrading.enabled to false in server.json5. Villagers then trade in emeralds as usual, and trade crates handle emeralds as items.