-
Notifications
You must be signed in to change notification settings - Fork 229
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
Standalone line of credit #3991
Comments
We do? This is news to me. In our Sep 8 community call, we (i.e. @rowgraus ) said the scope of mainnet 0 is:
Did something change? Or did I misunderstand the Sep 8 scope? |
Check with @dtribble as to whether this is a change to mainnet 0 scope, or just a feature that didn't get top billing. |
Input from @michaelfig: just use the same command as for creating a new periodic vesting account, but with a I considered having it, at merge time, rolling up vesting events which had passed, but I think this adds complexity for no specific benefit. |
Also:
|
I'm thinking the conversion is from the "staking token denom" (never explicitly This is more in line with how, say, the gas fees are handled. |
Notes from conversation with @rowgraus
|
Draft interface: Golang keeper API:
The
The configuration will specify the size of loan that can be taken for one unit of collateral, specifying both denominations. In the expected case of a RUN LoC on BLD, this gives an amount of RUN per liened BLD, which should be more immediately legible than the inverse price of BLD. Question: should we specialize the API to list loan and collateral to |
Since the |
To adjust the standalone line of credit, I'm only requiring that the requestor specify the new loan amount, with the collateral calculated automatically from the configured collateralization ratio. There is no need to make the requestor do a computation that the chain needs to do anyhow. I'm reconsidering whether to make the requestor specify the current line of credit details, originally thought to be a guard against conflicting, concurrent loan adjustment requests. But on further reflection, I don't think it's necessary. The parameter settings ought to resolve conflicts between JS- and standalone-initiated actions, and there isn't such protection around, e.g. bank transfer requests. The loan adjustment specifies the desired state, rather than the desired delta, which provides additional integrity. Lastly, the collateral amount might not be rounded, so specifying such a large number exactly is not at good user experience. Thoughts? |
Does this accommodate if the user wants to overcollateralize the loan? Maybe have a talk with @dckc and @btulloh to see what they arrived on in their recent discussions. As for specifying the desired loan state, that makes sense to me. |
That seems reasonable. Again, though, maybe involve @dckc to see how that lines up with the JS side. |
I expect this is all fine, but I don't understand what "loan coins" means. I would appreciate a worked example. I can stand by for tests. |
Notes on today's conversation with @dckc and @rowgraus
|
Question on the desired UI: do we want to support setting collateral and obtaining a loan as a single action? Or do we always want to do this as separate actions? @rowgraus |
I reviewed the treasury vault management UI. It's not an exact match, as we're intentionally allowing the loan to be less than the maximum allowed by the collateral. Here's my proposal for the commands and queries for the standalone LoC:
|
The name I don't have a suggested alternative, though. |
I agree that the bare Another alternative to the above is to make commands for deltas instead of just setting the new state, e.g. |
That all makes sense. I look forward to hearing from @rowgraus . |
Apologies for delay. On idempotency - not the best person to answer. Could imagine delays in blockchain processing causing users to make errors (e.g., sending too many transactions) which idempotency would help with. On the If so to the above this all looks good to me |
Yes to all - both transactions allow the loan amount to be adjusted up or down, to come from or go to zero, and the system will check that the loan is compatible with the amount of collateral. The |
Details on checking a change to LoC. Balance-independent checks, considering only new vs old loan and collateral:
Balance-dependent checks:
The composition of legal commands is also legal, which explains the behavior of, e.g. increasing loan while decreasing collateral in a single operation. |
ConfigurationThe standalone code uses a single config parameter: maximum RUN loan per BLD. @dckc has been using two parameters: a base BLD price in RUN, and a dimensionless overcollateralization ratio, e.g. 200% means that we need to lien twice as much BLD as we'd need to sell in order to obtain the desired amount of RUN. Either way works, but we should be consistent for terminology, docs, common tests, etc. - @rowgraus should weigh in on which he'd like to see. Division of Labor between JS and GoSince Go needs to be able to handle all checks and actions to run in standalone mode, it makes sense for JS to rely on these checks, at least initially. The JS will have to validate the checks related to the collateralization ratio (new loan doesn't exceed max loan for the given collateral when increasing loan or decreasing collateral), since Go will no longer know what the ratio is, but Go will handle the checks related to the balance, and the actions of adjusting the lien or minting and burning RUN. While we're still reserving the option of reverting to standalone mode, we'll still want the Go layer to be the authoritative store of LoC state. But once we're ready to run only in JS mode, JS can import the LoC state and then use the |
this is no longer plan of record |
What is the Problem Being Solved?
We need a way to generate RUN in the mainnet0 timeframe. Some accounts will have BLD, and no fees will be charged yet.
Description of the Design
x/lien
module to serve as the source-of-truth for liens.SetLien
request.Security Considerations
Must ensure conservation of liened BLD vs RUN.
Test Plan
Unit tests.
Manual testing on testnet:
The text was updated successfully, but these errors were encountered: