bond taking makes no sense #69

Closed
opened 2026-09-29 20:56:30 +00:00 by robertismo · 4 comments

got the following message

  preview: receive 9180 cash, owe 9989 face at maturity (0.8814% per turn)

if bonds all have a face of $1000, how can I owe a non-multiple amount? further question:

I see a bond market that looks like this

  Bank 3 — TAKE BONDS  (fixed term 10 turns, face 1,000)
  PRICE       UNITS TURNS LEFT IMPLIED / TURN
  919            10         7        1.2591%
  865             3         8        1.9509%
  831             6         9        2.2597%
  775            29        10        2.9032%

From my perspective I am assuming this is the entire market(i haven't seen another AI offer bonds), however is this intentional in the code, can/should I be able to see other offers in the market? Or are they actually hidden and I am seeing some mixed bond offering. I actually have no idea.

got the following message ``` preview: receive 9180 cash, owe 9989 face at maturity (0.8814% per turn) ```` if bonds all have a face of $1000, how can I owe a non-multiple amount? further question: I see a bond market that looks like this ``` Bank 3 — TAKE BONDS (fixed term 10 turns, face 1,000) PRICE UNITS TURNS LEFT IMPLIED / TURN 919 10 7 1.2591% 865 3 8 1.9509% 831 6 9 2.2597% 775 29 10 2.9032% ``` From my perspective I am assuming this is the entire market(i haven't seen another AI offer bonds), however is this intentional in the code, can/should I be able to see other offers in the market? Or are they actually hidden and I am seeing some mixed bond offering. I actually have no idea.
Owner

Looking into both parts now.

On the non-multiple face: the take fills allow FRACTIONAL units (cash wanted ÷ price), so face amounts come out non-multiples. That's an engine bug against the bond invariant — takes (and the preview) should fill whole units only. I'll check the issuer side too: brains can place fractional unit sizes, which strands an unfillable tail.

On the market view: openBondMarket() returns every committed standing offer from every bank — nothing is hidden, the table you saw IS the entire market. The AIs simply hadn't offered bonds at that moment (their offer hooks only fire on deep cash surplus). I'll make the display say so ("all N standing offers" / "no standing offers") instead of leaving you to guess.

Commenting again with the diff + PR.

Looking into both parts now. On the non-multiple face: the take fills allow FRACTIONAL units (cash wanted ÷ price), so face amounts come out non-multiples. That's an engine bug against the bond invariant — takes (and the preview) should fill whole units only. I'll check the issuer side too: brains can place fractional unit sizes, which strands an unfillable tail. On the market view: `openBondMarket()` returns every committed standing offer from every bank — nothing is hidden, the table you saw IS the entire market. The AIs simply hadn't offered bonds at that moment (their offer hooks only fire on deep cash surplus). I'll make the display say so ("all N standing offers" / "no standing offers") instead of leaving you to guess. Commenting again with the diff + PR.
Author

further confusion @Winnie

  Bank 3 — TAKE BONDS  (fixed term 10 turns, face 1,000)
  PRICE       UNITS TURNS LEFT IMPLIED / TURN
  919            10         7        1.2591%
  865             3         8        1.9509%
  831             6         9        2.2597%
  775            29        10        2.9032%
  cash wanted (Enter to skip): 9180
  preview: receive 9180 cash, owe 9989 face at maturity (0.8814% per turn)
  confirm take? (y/n): y
  took 0 cash, owe 0 at maturity
  Bank 3 offers 29 units @ 775 (10t)
  Bank 3 takes 0 cash from bond market, owes 0 at maturity

explain

further confusion @Winnie ``` Bank 3 — TAKE BONDS (fixed term 10 turns, face 1,000) PRICE UNITS TURNS LEFT IMPLIED / TURN 919 10 7 1.2591% 865 3 8 1.9509% 831 6 9 2.2597% 775 29 10 2.9032% cash wanted (Enter to skip): 9180 preview: receive 9180 cash, owe 9989 face at maturity (0.8814% per turn) confirm take? (y/n): y took 0 cash, owe 0 at maturity Bank 3 offers 29 units @ 775 (10t) Bank 3 takes 0 cash from bond market, owes 0 at maturity ``` explain
Owner

Explanation + fix up: PR #70 — your own offers were being shown in the take preview (engine correctly refuses them, hence the 0), the market view was complete but unlabeled, and bond units could be fractional. All three fixed.

Explanation + fix up: PR https://git.machinetele.com/Winnie/bankwars/pulls/70 — your own offers were being shown in the take preview (engine correctly refuses them, hence the 0), the market view was complete but unlabeled, and bond units could be fractional. All three fixed.
Owner

Shipped via PR #70: whole-unit bond trades (fills round up to meet the request), own bonds takeable as retirements, the entire market labeled with own offers marked, the market shown before offering, auction books display for the insolvent bank, and a preview that exactly matches the engine. Closing.

Shipped via PR #70: whole-unit bond trades (fills round up to meet the request), own bonds takeable as retirements, the entire market labeled with own offers marked, the market shown before offering, auction books display for the insolvent bank, and a preview that exactly matches the engine. Closing.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Winnie/bankwars#69
No description provided.