@agoric/inter-protocol 0.14.1-dev-13c169c.0 → 0.14.1-dev-72b0aa9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/bundle-auctioneer-js-meta.json +116 -116
- package/bundles/bundle-auctioneer.js +1 -1
- package/bundles/bundle-econCommitteeCharter-js-meta.json +71 -71
- package/bundles/bundle-feeDistributor-js-meta.json +57 -57
- package/bundles/bundle-fluxAggregatorKit-js-meta.json +111 -111
- package/bundles/bundle-fluxAggregatorKit.js +1 -1
- package/bundles/bundle-psm-js-meta.json +145 -145
- package/bundles/bundle-psm.js +1 -1
- package/bundles/bundle-reserve-js-meta.json +108 -108
- package/bundles/bundle-reserve.js +1 -1
- package/bundles/bundle-scaledPriceAuthority-js-meta.json +78 -78
- package/bundles/bundle-vaultFactory-js-meta.json +136 -132
- package/bundles/bundle-vaultFactory.js +1 -1
- package/package.json +17 -17
- package/src/contractSupport.js +16 -45
- package/src/price/fluxAggregatorKit.js +1 -15
- package/src/proposals/econ-behaviors.js +4 -4
- package/src/reserve/assetReserveKit.js +1 -7
- package/src/reserve/doc.md +4 -4
- package/src/vaultFactory/Liquidation.md +1 -1
- package/src/vaultFactory/liquidation.js +8 -23
- package/src/vaultFactory/proceeds.js +274 -0
- package/src/vaultFactory/types.js +1 -10
- package/src/vaultFactory/vaultDirector.js +3 -42
- package/src/vaultFactory/vaultFactory.js +3 -3
- package/src/vaultFactory/vaultHolder.js +1 -9
- package/src/vaultFactory/vaultManager.js +163 -350
|
@@ -15,9 +15,6 @@ import {
|
|
|
15
15
|
import { assertKeywordName } from '@agoric/zoe/src/cleanProposal.js';
|
|
16
16
|
import {
|
|
17
17
|
atomicRearrange,
|
|
18
|
-
getAmountIn,
|
|
19
|
-
getAmountOut,
|
|
20
|
-
makeRatioFromAmounts,
|
|
21
18
|
makeRecorderTopic,
|
|
22
19
|
provideEmptySeat,
|
|
23
20
|
SubscriberShape,
|
|
@@ -87,7 +84,7 @@ const shortfallInvitationKey = 'shortfallInvitation';
|
|
|
87
84
|
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit} makeRecorderKit
|
|
88
85
|
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeERecorderKit} makeERecorderKit
|
|
89
86
|
*/
|
|
90
|
-
|
|
87
|
+
const prepareVaultDirector = (
|
|
91
88
|
baggage,
|
|
92
89
|
zcf,
|
|
93
90
|
directorParamManager,
|
|
@@ -299,9 +296,7 @@ export const prepareVaultDirector = (
|
|
|
299
296
|
}),
|
|
300
297
|
public: M.interface('public', {
|
|
301
298
|
getCollateralManager: M.call(BrandShape).returns(M.remotable()),
|
|
302
|
-
|
|
303
|
-
getMetrics: M.call().returns(SubscriberShape),
|
|
304
|
-
getRunIssuer: M.call().returns(IssuerShape),
|
|
299
|
+
getDebtIssuer: M.call().returns(IssuerShape),
|
|
305
300
|
getSubscription: M.call({ collateralBrand: BrandShape }).returns(
|
|
306
301
|
SubscriberShape,
|
|
307
302
|
),
|
|
@@ -454,44 +449,10 @@ export const prepareVaultDirector = (
|
|
|
454
449
|
/** @type {VaultManager} */
|
|
455
450
|
return managerForCollateral(brandIn).getPublicFacet();
|
|
456
451
|
},
|
|
457
|
-
|
|
458
|
-
* @deprecated get `collaterals` list from metrics
|
|
459
|
-
*/
|
|
460
|
-
async getCollaterals() {
|
|
461
|
-
// should be collateralManagers.map((vm, brand) => ({
|
|
462
|
-
return harden(
|
|
463
|
-
Promise.all(
|
|
464
|
-
[...collateralManagers.entries()].map(
|
|
465
|
-
async ([brand, managerIndex]) => {
|
|
466
|
-
const vm = vaultManagers.get(managerIndex).self;
|
|
467
|
-
const priceQuote = await vm.getCollateralQuote();
|
|
468
|
-
return {
|
|
469
|
-
brand,
|
|
470
|
-
interestRate: vm.getGovernedParams().getInterestRate(),
|
|
471
|
-
liquidationMargin: vm
|
|
472
|
-
.getGovernedParams()
|
|
473
|
-
.getLiquidationMargin(),
|
|
474
|
-
stabilityFee: vm.getGovernedParams().getMintFee(),
|
|
475
|
-
marketPrice: makeRatioFromAmounts(
|
|
476
|
-
getAmountOut(priceQuote),
|
|
477
|
-
getAmountIn(priceQuote),
|
|
478
|
-
),
|
|
479
|
-
};
|
|
480
|
-
},
|
|
481
|
-
),
|
|
482
|
-
),
|
|
483
|
-
);
|
|
484
|
-
},
|
|
485
|
-
/** @deprecated use getPublicTopics */
|
|
486
|
-
getMetrics() {
|
|
487
|
-
return metricsKit.subscriber;
|
|
488
|
-
},
|
|
489
|
-
getRunIssuer() {
|
|
452
|
+
getDebtIssuer() {
|
|
490
453
|
return debtMint.getIssuerRecord().issuer;
|
|
491
454
|
},
|
|
492
455
|
/**
|
|
493
|
-
* @deprecated get from the CollateralManager directly
|
|
494
|
-
*
|
|
495
456
|
* subscription for the paramManager for a particular vaultManager
|
|
496
457
|
*
|
|
497
458
|
* @param {{ collateralBrand: Brand }} selector
|
|
@@ -13,9 +13,9 @@ import '@agoric/zoe/src/contracts/exported.js';
|
|
|
13
13
|
|
|
14
14
|
// This contract wants to be managed by a contractGovernor, but it isn't
|
|
15
15
|
// compatible with contractGovernor, since it has a separate paramManager for
|
|
16
|
-
// each
|
|
17
|
-
// to satisfy contractGovernor. It needs to return a creatorFacet
|
|
18
|
-
// { getParamMgrRetriever, getInvitation, getLimitedCreatorFacet }.
|
|
16
|
+
// each VaultManager. This requires it to manually replicate the API of
|
|
17
|
+
// contractHelper to satisfy contractGovernor. It needs to return a creatorFacet
|
|
18
|
+
// with { getParamMgrRetriever, getInvitation, getLimitedCreatorFacet }.
|
|
19
19
|
|
|
20
20
|
import { CONTRACT_ELECTORATE } from '@agoric/governance';
|
|
21
21
|
import { makeParamManagerFromTerms } from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { AmountShape } from '@agoric/ertp';
|
|
5
5
|
import { M, prepareExoClassKit } from '@agoric/vat-data';
|
|
6
|
-
import {
|
|
7
|
-
SubscriberShape,
|
|
8
|
-
TopicsRecordShape,
|
|
9
|
-
} from '@agoric/zoe/src/contractSupport/index.js';
|
|
6
|
+
import { TopicsRecordShape } from '@agoric/zoe/src/contractSupport/index.js';
|
|
10
7
|
import { UnguardedHelperI } from '../typeGuards.js';
|
|
11
8
|
|
|
12
9
|
const { Fail } = assert;
|
|
@@ -22,7 +19,6 @@ const HolderI = M.interface('holder', {
|
|
|
22
19
|
getCollateralAmount: M.call().returns(AmountShape),
|
|
23
20
|
getCurrentDebt: M.call().returns(AmountShape),
|
|
24
21
|
getNormalizedDebt: M.call().returns(AmountShape),
|
|
25
|
-
getSubscriber: M.call().returns(SubscriberShape),
|
|
26
22
|
getPublicTopics: M.call().returns(TopicsRecordShape),
|
|
27
23
|
makeAdjustBalancesInvitation: M.call().returns(M.promise()),
|
|
28
24
|
makeCloseInvitation: M.call().returns(M.promise()),
|
|
@@ -91,10 +87,6 @@ export const prepareVaultHolder = (baggage, makeRecorderKit) => {
|
|
|
91
87
|
},
|
|
92
88
|
},
|
|
93
89
|
holder: {
|
|
94
|
-
/** @deprecated use getPublicTopics */
|
|
95
|
-
getSubscriber() {
|
|
96
|
-
return this.state.topicKit.subscriber;
|
|
97
|
-
},
|
|
98
90
|
getPublicTopics() {
|
|
99
91
|
const { topicKit } = this.state;
|
|
100
92
|
return harden({
|