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

Expose key Build Boost economic data via subscription #4653

Open
5 of 8 tasks
Tartuffo opened this issue Feb 23, 2022 · 4 comments
Open
5 of 8 tasks

Expose key Build Boost economic data via subscription #4653

Tartuffo opened this issue Feb 23, 2022 · 4 comments
Assignees
Labels
BLD-Boost Issues relating to the BLD Boost contract and UI contract-api-change external contract API changes (that impact clients) Inter-protocol Overarching Inter Protocol vaults_triage DO NOT USE

Comments

@Tartuffo
Copy link
Contributor

Tartuffo commented Feb 23, 2022

This data can be used in Blockchain Explorers and via sites like The Graph for the community to get key information about the state of the RUN Protocol components.

From our meeting on Feb 22, here is the data we want to expose from getRUN:

  1. Per Contract (assetNotifier)
    1. Net amount minted (totalDebt)
    2. Total collateral
    3. Governance parameters (see Expose RUN protocol governance state via subscription #5268)
      1. debt limit
      2. allowed ratio
      3. interest rate
  2. Per Account
    1. Locked BLD amount (locked)
    2. Debt (debtSnapshot)
    3. Interest rate (?) interestRate (but see Refactor vault notifications to not cascade interest charge events #4540)
  • publicFacet method to get assetNotifier
@Tartuffo Tartuffo added BLD-Boost Issues relating to the BLD Boost contract and UI Inter-protocol Overarching Inter Protocol labels Feb 23, 2022
@Tartuffo Tartuffo added this to the Mainnet 1 milestone Mar 23, 2022
@dtribble dtribble changed the title Expose key getRUN economic data via RPC and notification stream Expose key runStake economic data via RPC and notification stream Apr 11, 2022
@dckc dckc self-assigned this Apr 11, 2022
@dckc
Copy link
Member

dckc commented Apr 11, 2022

The current code (52f60eb) has an assetNotifier on each offer result:

const assetNotifer: Notifier<{
    compoundedInterest: Ratio;
    interestRate: Ratio;
    latestInterestUpdate: bigint;
    totalDebt: Amount<"nat">;
}>

There's no publicFacet method to get that assetNotifier; the only way to get it is as a result of opening an account. That seems like a bug.

The Per Account notifier is updated as follows:

    /** @type {VaultUIState} */
    const result = harden({
      // TODO move manager state to a separate notifer https://github.com/Agoric/agoric-sdk/issues/4540
      interestRate: manager.getInterestRate(),
      liquidationRatio: manager.getMintingRatio(),
      debtSnapshot: { debt, interest },
      locked: getCollateralAmount(),
      // newPhase param is so that makeTransferInvitation can finish without setting the vault's phase
      // TODO refactor https://github.com/Agoric/agoric-sdk/issues/4415
      vaultState: newActive ? 'active' : 'closed',
    });

The VaultUIState type is not declared, so it defaults to any. :-/ (more interest on technical debt: #3916 )

@dckc
Copy link
Member

dckc commented Apr 11, 2022

@Tartuffo @rowgraus what is an "interest rate curve"?

@dckc
Copy link
Member

dckc commented Apr 11, 2022

And what does "Distribution of utilization of loan amount" mean, @rowgraus ? @Tartuffo ?

@dckc
Copy link
Member

dckc commented May 9, 2022

It's not clear how useful Total collateral is; @btulloh asks for "a detailed view into the state changes, rather than summary data".

@Tartuffo Tartuffo changed the title Expose key runStake economic data via RPC and notification stream Expose key Build Boost economic data via RPC and notification stream May 20, 2022
@turadg turadg changed the title Expose key Build Boost economic data via RPC and notification stream Expose key Build Boost economic data via subscription May 25, 2022
@dckc dckc mentioned this issue Jul 19, 2022
1 task
@dckc dckc added the contract-api-change external contract API changes (that impact clients) label Aug 3, 2022
@Tartuffo Tartuffo removed this from the Mainnet 1 RC0 milestone Sep 21, 2022
@rowgraus rowgraus added vaults_triage DO NOT USE and removed MUST-HAVE labels Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLD-Boost Issues relating to the BLD Boost contract and UI contract-api-change external contract API changes (that impact clients) Inter-protocol Overarching Inter Protocol vaults_triage DO NOT USE
Projects
None yet
Development

No branches or pull requests

3 participants