-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RUN rewards go first to pay off getRUN balance #4244
Comments
Investigate alternative mechanism - a tool to run through everything and pay off debts. @dtribble to find out fro Zaki what is new in the Cosmos space for this. Then Dan can pick it up, but lowest prio for MN-1. |
@JimLarson to add a ticket to do the design of doing this in Golang, using the hook Jim put in. They we will decide between implementing this in Go or in JS. Doing it in Go will likely be faster to impl. |
Wrote a rough design in #4466. It's complicated a little by the need to do some duplicate bookkeeping on the Golang side so it can synchronously know the remaining debt. The golang side could even be the record of truth for the getRUN state. But this interacts with the planned design of the JS level code. |
On 3 March, @dtribble had an idea: `claimUpTo(address, qty) => claimedQty`
or in batch:
```js
claimUpTo: async (addresses, debts) => {
return zip(addresses, debts).map(([a, q]) =>
min(rewardsPending.get(a) || 0n, q),
);
},
```
oops... that's missing denom. Anyway...
We had a good discussion of this and #4466 last Fri (18 March). We recalled
that on 16 Feb, we decided to go with the approach in #4466. That approach
seems to involve having the JS layer keep the golang layer informed about
balance changes. But what about accrued interest? Does this mean a bridge
crossing for every account for every epoch? OTOH, is the claimUpTo approach
any more efficient? My head was too full to think about it further that day.
Today, I wonder: perhaps the golang side can do the same calculation to
apply interest to the debt on demand?
…
|
Note that RUN rewards for clawback vesting accounts will first segregate the unvested fraction of the reward, then the getRUN (or WYLawayTheHours) repayment is taken out of the vested fraction. |
@Tartuffo @rowgraus @dtribble @jessysaurusrex thoughts on priority of this for the May 30 target? @Tartuffo should this be on my radar? It fell off a bit; the issue history shows I was un-assigned by you Apr 6. |
Closing as discussed in today's Triage meeting. |
What is the Problem Being Solved?
BLD stakers can getRUN to get liquid RUN in exchange for a lien on their BLD.
This is somewhat like a vault, but it doesn't liquidate. Instead, until the balance is paid off, any RUN rewards for the relevant account go to pay down the balance.
This ticket covers the functionality needed to intervene in the RUN rewards stream and pay down user debts.
Note: Current plan is this functionality does not launch with Mainnet 1
Description of the Design
Mainnet 1 Design: N/A; launch with manual payback
Future Design:
After each epoch, when RUN rewards are collected, service iterates over users with outstanding getRUN balances, calculates expected RUN rewards, and reduces balance in lieu of paying out RUN.
Acceptance Criteria
Security Considerations
Test Plan
cc @rowgraus @dtribble @Chris-Hibbert
The text was updated successfully, but these errors were encountered: