Skip to content
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

getRUN contract, bootstrap integration (WIP) #4092

Closed
wants to merge 43 commits into from
Closed

getRUN contract, bootstrap integration (WIP) #4092

wants to merge 43 commits into from

Conversation

dckc
Copy link
Member

@dckc dckc commented Nov 17, 2021

refs #3788

cc @Chris-Hibbert

Description

related issues:

  • new issue? no calls to sortedVaultKits.remove. every vault is charged interested at every epoch - is that sufficiently scalable?
  • ISSUE: why aren't HIGH_FEE etc. exported from @agoric/zoe?
  • @ts-ignore governance wrapper obscures publicFace type

Security Considerations

  • has access to RUN mint

Documentation Considerations

Testing Considerations

  • accrue interest
  • golang bridge for lien
  • partial payoff

Copy link
Contributor

@Chris-Hibbert Chris-Hibbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few thoughts on the use of governance. I'll wait till you're ready before I do a full review

makePublicFacet,
makeCreatorFacet,
getParamValue,
} = handleParamGovernance(zcf, harden(initialValue));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is taking the creator's word for what the governed parameters should look like.

The AMM declares its expectations in params.js, in a way that is used in the contract, and should have been used in the tests when creating parameters for terms.

stablecoinMachine asserts that the governed params from terms match the local declaration to ensure that all and only the required params are present. If there are params that aren't used or verified at startup, this seems crucial to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how the sameStructure in stablecoinMachine works; it seems to be comparing the list ['ChargingPeriod', ...] with something that looks like [{name, type, value}, ...].

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should both be { "vaultParams": ["ChargingPeriod", "RecordingPeriod", "InitialMargin", "LiquidationMargin", "InterestRate", "LoanFee"] }, which comes directly from params.js.

When setting up the treasury in test-stablecoin, treasuryTerms contains governedParams: governedParameterTerms, where the latter is imported from params.

Comment on lines 31 to 170
const getRatio = name => {
const x = getParamValue(name);
assertIsRatio(x);
return /** @type { Ratio } */ (x);
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems generally useful. I'm fine with generalizing and adding these into the governance pkg.

Is it already time to refactor paramManager so it splits out all the different types? Or should we add helper tools like this for a while longer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now would be a good time for me, while it's swapped in. And before we dig the hole deeper by using this API in more contracts.

@dckc dckc added the RUN LoC label Dec 10, 2021
@dckc dckc force-pushed the dc-run-loc branch 6 times, most recently from b0fd103 to c70ceb2 Compare December 16, 2021 05:40
@rowgraus rowgraus added the MN-1 label Jan 19, 2022
@dckc dckc force-pushed the dc-run-loc branch 3 times, most recently from da926b7 to fa54794 Compare January 21, 2022 20:45
@michaelfig michaelfig force-pushed the dc-run-loc branch 2 times, most recently from 4957dd2 to a66d2ae Compare January 24, 2022 20:07
@dckc dckc changed the title RUN LoC (WIP) getRUN contract (WIP) Jan 25, 2022
@dckc dckc mentioned this pull request Jan 25, 2022
10 tasks
@dckc dckc force-pushed the dc-run-loc branch 5 times, most recently from 63d1ce1 to 7b2b29f Compare January 29, 2022 05:43
dckc added 24 commits January 31, 2022 15:25
 - spell binaryVoteCounter consistently
 - move board out of EconomyBootstrapPowers (postpone uiConfig)
 - test-vaultFactory.js: subsume makePriceAuthority(),
   setupVaultFactory(), bundleInstalls() using produce / consume space
   - manage bundles, installations as records with
     Collect.allValues
   - provide param types for setupServices() etc.
 - add config.loanParams to startVaultFactory
 - split consume.economyBundles into consume.ammBundle,
   consume.vaultBundles
 - factor out configureVaultFactoryUI so that board
   is not needed for unit testing
 - get centralIssuer from agoricNames so it doesn't
   have to be created by zoe.
 - spell VaultFactory, liquidate consistently
 - use export const x = () => { ... }; harden(X)
 - shareEconomyBundles
 - EconomyBootstrapPowers type tweaks
@Tartuffo
Copy link
Contributor

@dckc @Chris-Hibbert When I first started working on our ZH board, I marked this as being for the Mainnet 1 release because it was already in the Review/QA pipeline. This PR is from Nov. Should this be closed?

@dckc
Copy link
Member Author

dckc commented Feb 11, 2022

Closed? Why?

@dckc dckc changed the title getRUN contract (WIP) getRUN contract, bootstrap integration (WIP) Mar 6, 2022
@dckc dckc closed this Apr 19, 2022
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.

4 participants