Skip to content

bath: show Hipo's loans and validation rounds - #992

Merged
alpinskiy-top merged 1 commit into
masterfrom
malpinskiy/hippo
Oct 19, 2026
Merged

alpinskiy-top merged 1 commit into
masterfrom
malpinskiy/hippo

Conversation

@alpinskiy-top

Copy link
Copy Markdown
Collaborator

Hipo's treasury lends its stakers' coins to validators one round at a time, but none of that showed up as actions: a loan request, the stake sent to the elector, the repayment and its reward split, and the round's own stages all read as bare GRAM transfers between Hipo's contracts.

Four generic actions now cover the lending side of a staking pool, like DepositStake does for staking, each naming the pool implementation:

  • LoanRequest: a validator asks for a loan for the next round.
  • LoanIssue: the pool lends and the loan contract stakes it.
  • LoanRepayment: the loan comes back with its reward, split between the stakers, the protocol fee, the HPO burn and the borrower's payout.
  • PoolRoundTransition: a round moves through election, began, validated, ended and settled; a settled round carries its totals, and its preview shows the round's net result, negative for a losing round.

The treasury reports amounts only in its logs, which it writes by topic rather than by op-code. core now decodes the external-out logs of the treasury and of the burner, and a BubbleTx keeps its input message's lt and its sender's logs so a straw can read the log written next to the message it matches. The loan straws are anchored on such a log, since anyone may send these ops but only the treasury can write its logs. A round only absorbs the steps that succeeded; a failed one stays beside it as its own transaction. The coins of every transfer an action absorbs count towards that action rather than as an account's unexplained extra.

Unstake-all requests (send_unstake_all or the comment "w") also become a WithdrawStakeRequest, and Straw.Merge no longer adds the head's accounts and transactions twice when a straw extends an action it built before.

API: LoanRequest, LoanIssue, LoanRepayment and PoolRoundTransition actions. A loan request's amount and min_payment are optional, absent when too large to represent; round_since is 0 when the round's start is unknown, and the preview then leaves the date out rather than showing 1970.

Hipo's treasury lends its stakers' coins to validators one round at a time,
but none of that showed up as actions: a loan request, the stake sent to the
elector, the repayment and its reward split, and the round's own stages all
read as bare GRAM transfers between Hipo's contracts.

Four generic actions now cover the lending side of a staking pool, like
DepositStake does for staking, each naming the pool implementation:

- LoanRequest: a validator asks for a loan for the next round.
- LoanIssue: the pool lends and the loan contract stakes it.
- LoanRepayment: the loan comes back with its reward, split between the
  stakers, the protocol fee, the HPO burn and the borrower's payout.
- PoolRoundTransition: a round moves through election, began, validated,
  ended and settled; a settled round carries its totals, and its preview
  shows the round's net result, negative for a losing round.

The treasury reports amounts only in its logs, which it writes by topic
rather than by op-code. core now decodes the external-out logs of the
treasury and of the burner, and a BubbleTx keeps its input message's lt
and its sender's logs so a straw can read the log written next to the
message it matches. The loan straws are anchored on such a log, since
anyone may send these ops but only the treasury can write its logs. A
round only absorbs the steps that succeeded; a failed one stays beside it
as its own transaction. The coins of every transfer an action absorbs
count towards that action rather than as an account's unexplained extra.

Unstake-all requests (send_unstake_all or the comment "w") also become a
WithdrawStakeRequest, and Straw.Merge no longer adds the head's accounts
and transactions twice when a straw extends an action it built before.

API: LoanRequest, LoanIssue, LoanRepayment and PoolRoundTransition actions.
A loan request's amount and min_payment are optional, absent when too large
to represent; round_since is 0 when the round's start is unknown, and the
preview then leaves the date out rather than showing 1970.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alpinskiy-top
alpinskiy-top merged commit 2fd9499 into master Oct 19, 2026
1 check passed
@alpinskiy-top
alpinskiy-top deleted the malpinskiy/hippo branch October 19, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant