@agoric/inter-protocol 0.13.2-dev-8cbf697.0 → 0.13.2-dev-52646a8.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-amm-meta.js +132 -132
- package/bundles/bundle-amm.js +1 -1
- package/bundles/bundle-econCommitteeCharter-meta.js +77 -77
- package/bundles/bundle-econCommitteeCharter.js +1 -1
- package/bundles/bundle-feeDistributor-meta.js +56 -56
- package/bundles/bundle-feeDistributor.js +1 -1
- package/bundles/bundle-fluxAggregator-meta.js +113 -113
- package/bundles/bundle-fluxAggregator.js +1 -1
- package/bundles/bundle-interchainPool-meta.js +109 -109
- package/bundles/bundle-interchainPool.js +1 -1
- package/bundles/bundle-liquidateIncrementally-meta.js +71 -71
- package/bundles/bundle-liquidateIncrementally.js +1 -1
- package/bundles/bundle-liquidateMinimum-meta.js +71 -71
- package/bundles/bundle-liquidateMinimum.js +1 -1
- package/bundles/bundle-psm-meta.js +112 -112
- package/bundles/bundle-psm.js +1 -1
- package/bundles/bundle-reserve-meta.js +110 -110
- package/bundles/bundle-reserve.js +1 -1
- package/bundles/bundle-scaledPriceAuthority-meta.js +72 -72
- package/bundles/bundle-scaledPriceAuthority.js +1 -1
- package/bundles/bundle-stakeFactory-meta.js +118 -118
- package/bundles/bundle-stakeFactory.js +1 -1
- package/bundles/bundle-vaultFactory-meta.js +128 -128
- package/bundles/bundle-vaultFactory.js +1 -1
- package/package.json +16 -16
- package/scripts/add-collateral-core.js +2 -0
- package/scripts/init-core.js +4 -0
- package/scripts/start-local-chain.sh +2 -2
- package/src/proposals/addAssetToVault.js +11 -5
- package/src/proposals/core-proposal.js +9 -1
- package/src/proposals/econ-behaviors.js +4 -0
- package/src/vaultFactory/vaultFactory.js +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/inter-protocol",
|
|
3
|
-
"version": "0.13.2-dev-
|
|
3
|
+
"version": "0.13.2-dev-52646a8.0+52646a8",
|
|
4
4
|
"description": "Core cryptoeconomy contracts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@agoric/assert": "0.5.2-dev-
|
|
33
|
-
"@agoric/ertp": "0.15.4-dev-
|
|
34
|
-
"@agoric/governance": "0.9.2-dev-
|
|
35
|
-
"@agoric/internal": "0.2.2-dev-
|
|
36
|
-
"@agoric/notifier": "0.5.2-dev-
|
|
37
|
-
"@agoric/store": "0.8.4-dev-
|
|
38
|
-
"@agoric/swingset-liveslots": "0.9.1-dev-
|
|
39
|
-
"@agoric/swingset-vat": "0.30.3-dev-
|
|
40
|
-
"@agoric/time": "0.2.2-dev-
|
|
41
|
-
"@agoric/vat-data": "0.4.4-dev-
|
|
42
|
-
"@agoric/vats": "0.13.1-dev-
|
|
43
|
-
"@agoric/zoe": "0.25.4-dev-
|
|
32
|
+
"@agoric/assert": "0.5.2-dev-52646a8.0+52646a8",
|
|
33
|
+
"@agoric/ertp": "0.15.4-dev-52646a8.0+52646a8",
|
|
34
|
+
"@agoric/governance": "0.9.2-dev-52646a8.0+52646a8",
|
|
35
|
+
"@agoric/internal": "0.2.2-dev-52646a8.0+52646a8",
|
|
36
|
+
"@agoric/notifier": "0.5.2-dev-52646a8.0+52646a8",
|
|
37
|
+
"@agoric/store": "0.8.4-dev-52646a8.0+52646a8",
|
|
38
|
+
"@agoric/swingset-liveslots": "0.9.1-dev-52646a8.0+52646a8",
|
|
39
|
+
"@agoric/swingset-vat": "0.30.3-dev-52646a8.0+52646a8",
|
|
40
|
+
"@agoric/time": "0.2.2-dev-52646a8.0+52646a8",
|
|
41
|
+
"@agoric/vat-data": "0.4.4-dev-52646a8.0+52646a8",
|
|
42
|
+
"@agoric/vats": "0.13.1-dev-52646a8.0+52646a8",
|
|
43
|
+
"@agoric/zoe": "0.25.4-dev-52646a8.0+52646a8",
|
|
44
44
|
"@endo/bundle-source": "^2.4.2",
|
|
45
45
|
"@endo/captp": "^2.0.18",
|
|
46
46
|
"@endo/eventual-send": "^0.16.8",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@endo/promise-kit": "^0.2.52"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@agoric/deploy-script-support": "0.9.5-dev-
|
|
54
|
-
"@agoric/smart-wallet": "0.4.3-dev-
|
|
53
|
+
"@agoric/deploy-script-support": "0.9.5-dev-52646a8.0+52646a8",
|
|
54
|
+
"@agoric/smart-wallet": "0.4.3-dev-52646a8.0+52646a8",
|
|
55
55
|
"@endo/init": "^0.5.52",
|
|
56
56
|
"@fast-check/ava": "^1.1.3",
|
|
57
57
|
"ava": "^5.1.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "52646a8133d8fcf1bff2ad9b141b94c6dfd4e2ef"
|
|
82
82
|
}
|
|
@@ -21,6 +21,7 @@ export const defaultProposalBuilder = async (
|
|
|
21
21
|
decimalPlaces = 6,
|
|
22
22
|
keyword = 'IbcATOM',
|
|
23
23
|
proposedName = oracleBrand,
|
|
24
|
+
initialPricePct = undefined,
|
|
24
25
|
} = interchainAssetOptions;
|
|
25
26
|
|
|
26
27
|
if (!denom) {
|
|
@@ -38,6 +39,7 @@ export const defaultProposalBuilder = async (
|
|
|
38
39
|
denom,
|
|
39
40
|
issuerBoardId,
|
|
40
41
|
decimalPlaces,
|
|
42
|
+
initialPricePct,
|
|
41
43
|
keyword,
|
|
42
44
|
proposedName,
|
|
43
45
|
oracleBrand,
|
package/scripts/init-core.js
CHANGED
|
@@ -154,11 +154,13 @@ export const defaultProposalBuilder = async (
|
|
|
154
154
|
ROLE = env.ROLE || 'chain',
|
|
155
155
|
vaultFactoryControllerAddress = env.VAULT_FACTORY_CONTROLLER_ADDR,
|
|
156
156
|
minInitialPoolLiquidity = env.MIN_INITIAL_POOL_LIQUIDITY,
|
|
157
|
+
endorsedUi,
|
|
157
158
|
anchorOptions: {
|
|
158
159
|
anchorDenom = env.ANCHOR_DENOM,
|
|
159
160
|
anchorDecimalPlaces = '6',
|
|
160
161
|
anchorKeyword = 'AUSD',
|
|
161
162
|
anchorProposedName = anchorKeyword,
|
|
163
|
+
initialPricePct = undefined,
|
|
162
164
|
} = {},
|
|
163
165
|
econCommitteeOptions: {
|
|
164
166
|
committeeSize: econCommitteeSize = env.ECON_COMMITTEE_SIZE || '3',
|
|
@@ -172,6 +174,7 @@ export const defaultProposalBuilder = async (
|
|
|
172
174
|
const anchorOptions = anchorDenom && {
|
|
173
175
|
denom: anchorDenom,
|
|
174
176
|
decimalPlaces: parseInt(anchorDecimalPlaces, 10),
|
|
177
|
+
initialPricePct: optBigInt(initialPricePct),
|
|
175
178
|
keyword: anchorKeyword,
|
|
176
179
|
proposedName: anchorProposedName,
|
|
177
180
|
};
|
|
@@ -188,6 +191,7 @@ export const defaultProposalBuilder = async (
|
|
|
188
191
|
ROLE,
|
|
189
192
|
vaultFactoryControllerAddress,
|
|
190
193
|
minInitialPoolLiquidity: optBigInt(minInitialPoolLiquidity),
|
|
194
|
+
endorsedUi,
|
|
191
195
|
anchorOptions,
|
|
192
196
|
econCommitteeOptions,
|
|
193
197
|
installKeys: {
|
|
@@ -68,7 +68,7 @@ echo "Funding your wallet account..."
|
|
|
68
68
|
# After `fund-provision-pool` there is 900 IST remaining for other account funding.
|
|
69
69
|
# A wallet can be tested with 20 BLD for provisioning wallet and 20 USDC for psm trading
|
|
70
70
|
# Also include 1M IbcATOM
|
|
71
|
-
make ACCT_ADDR="$WALLET_BECH32" FUNDS=20000000ubld,20000000ibc/
|
|
71
|
+
make ACCT_ADDR="$WALLET_BECH32" FUNDS=20000000ubld,20000000ibc/toyusdc,1000000000000ibc/toyatom fund-acct
|
|
72
72
|
agd query bank balances "$WALLET_BECH32" | grep ubld || exit 1
|
|
73
73
|
|
|
74
74
|
echo "Provisioning your smart wallet..."
|
|
@@ -80,5 +80,5 @@ agoric wallet --keyring-backend=test list
|
|
|
80
80
|
agoric wallet --keyring-backend=test show --from "$WALLET"
|
|
81
81
|
|
|
82
82
|
echo "Repeating for oracle2 account..."
|
|
83
|
-
make ACCT_ADDR="$WALLET2_BECH32" FUNDS=20000000ubld,20000000ibc/
|
|
83
|
+
make ACCT_ADDR="$WALLET2_BECH32" FUNDS=20000000ubld,20000000ibc/toyusdc fund-acct
|
|
84
84
|
agoric wallet --keyring-backend=test provision --spend --account "$WALLET2"
|
|
@@ -15,6 +15,7 @@ export * from './startPSM.js';
|
|
|
15
15
|
* @property {string} [proposedName]
|
|
16
16
|
* @property {string} keyword
|
|
17
17
|
* @property {string} oracleBrand
|
|
18
|
+
* @property {number} [initialPricePct]
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -160,7 +161,7 @@ export const registerScaledPriceAuthority = async (
|
|
|
160
161
|
{ consume: { agoricNamesAdmin, zoe, priceAuthorityAdmin, priceAuthority } },
|
|
161
162
|
{ options: { interchainAssetOptions } },
|
|
162
163
|
) => {
|
|
163
|
-
const { keyword, oracleBrand } = interchainAssetOptions;
|
|
164
|
+
const { keyword, oracleBrand, initialPricePct } = interchainAssetOptions;
|
|
164
165
|
assert.typeof(keyword, 'string');
|
|
165
166
|
assert.typeof(oracleBrand, 'string');
|
|
166
167
|
|
|
@@ -215,12 +216,16 @@ export const registerScaledPriceAuthority = async (
|
|
|
215
216
|
10n ** BigInt(decimalPlacesRun),
|
|
216
217
|
runBrand,
|
|
217
218
|
);
|
|
219
|
+
const initialPrice = initialPricePct
|
|
220
|
+
? makeRatio(BigInt(initialPricePct), interchainBrand, 100n, runBrand)
|
|
221
|
+
: undefined;
|
|
218
222
|
|
|
219
223
|
const terms = await deeplyFulfilledObject(
|
|
220
224
|
harden({
|
|
221
225
|
sourcePriceAuthority,
|
|
222
226
|
scaleIn,
|
|
223
227
|
scaleOut,
|
|
228
|
+
initialPrice,
|
|
224
229
|
}),
|
|
225
230
|
);
|
|
226
231
|
const { publicFacet } = E.get(
|
|
@@ -270,11 +275,12 @@ export const addAssetToVault = async (
|
|
|
270
275
|
const vaultFactoryCreator = E.get(vaultFactoryKit).creatorFacet;
|
|
271
276
|
await E(vaultFactoryCreator).addVaultType(interchainIssuer, oracleBrand, {
|
|
272
277
|
debtLimit: AmountMath.make(stable, debtLimitValue),
|
|
273
|
-
// the rest of these are arbitrary, TBD by gov cttee
|
|
274
|
-
|
|
275
|
-
liquidationMargin: makeRatio(
|
|
278
|
+
// the rest of these are arbitrary but plausible, TBD by gov cttee
|
|
279
|
+
liquidationPadding: makeRatio(25n, stable),
|
|
280
|
+
liquidationMargin: makeRatio(150n, stable),
|
|
281
|
+
loanFee: makeRatio(50n, stable, 10_000n),
|
|
276
282
|
liquidationPenalty: makeRatio(1n, stable),
|
|
277
|
-
|
|
283
|
+
interestRate: makeRatio(1n, stable),
|
|
278
284
|
});
|
|
279
285
|
};
|
|
280
286
|
|
|
@@ -223,7 +223,12 @@ export const getManifestForEconCommittee = (
|
|
|
223
223
|
|
|
224
224
|
export const getManifestForMain = (
|
|
225
225
|
{ restoreRef },
|
|
226
|
-
{
|
|
226
|
+
{
|
|
227
|
+
installKeys,
|
|
228
|
+
vaultFactoryControllerAddress,
|
|
229
|
+
minInitialPoolLiquidity,
|
|
230
|
+
endorsedUi,
|
|
231
|
+
},
|
|
227
232
|
) => {
|
|
228
233
|
return {
|
|
229
234
|
manifest: SHARED_MAIN_MANIFEST,
|
|
@@ -238,6 +243,7 @@ export const getManifestForMain = (
|
|
|
238
243
|
options: {
|
|
239
244
|
vaultFactoryControllerAddress,
|
|
240
245
|
minInitialPoolLiquidity,
|
|
246
|
+
endorsedUi,
|
|
241
247
|
},
|
|
242
248
|
};
|
|
243
249
|
};
|
|
@@ -259,6 +265,7 @@ export const getManifestForInterProtocol = (
|
|
|
259
265
|
installKeys,
|
|
260
266
|
vaultFactoryControllerAddress,
|
|
261
267
|
minInitialPoolLiquidity,
|
|
268
|
+
endorsedUi,
|
|
262
269
|
},
|
|
263
270
|
) => {
|
|
264
271
|
const econCommitteeManifest = getManifestForEconCommittee(
|
|
@@ -271,6 +278,7 @@ export const getManifestForInterProtocol = (
|
|
|
271
278
|
installKeys,
|
|
272
279
|
vaultFactoryControllerAddress,
|
|
273
280
|
minInitialPoolLiquidity,
|
|
281
|
+
endorsedUi,
|
|
274
282
|
},
|
|
275
283
|
);
|
|
276
284
|
return {
|
|
@@ -357,6 +357,8 @@ export const setupReserve = async ({
|
|
|
357
357
|
* @param {EconomyBootstrapPowers} powers
|
|
358
358
|
* @param {object} config
|
|
359
359
|
* @param {LoanTiming} [config.loanParams]
|
|
360
|
+
* @param {object} [config.options]
|
|
361
|
+
* @param {string} [config.options.endorsedUi]
|
|
360
362
|
* @param {bigint} minInitialDebt
|
|
361
363
|
*/
|
|
362
364
|
export const startVaultFactory = async (
|
|
@@ -392,6 +394,7 @@ export const startVaultFactory = async (
|
|
|
392
394
|
chargingPeriod: SECONDS_PER_HOUR,
|
|
393
395
|
recordingPeriod: SECONDS_PER_DAY,
|
|
394
396
|
},
|
|
397
|
+
options: { endorsedUi } = {},
|
|
395
398
|
} = {},
|
|
396
399
|
minInitialDebt = 5_000_000n,
|
|
397
400
|
) => {
|
|
@@ -439,6 +442,7 @@ export const startVaultFactory = async (
|
|
|
439
442
|
minInitialDebt: AmountMath.make(centralBrand, minInitialDebt),
|
|
440
443
|
bootstrapPaymentValue: 0n,
|
|
441
444
|
shortfallInvitationAmount,
|
|
445
|
+
endorsedUi,
|
|
442
446
|
},
|
|
443
447
|
);
|
|
444
448
|
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
LIQUIDATION_INSTALL_KEY,
|
|
26
26
|
LIQUIDATION_TERMS_KEY,
|
|
27
27
|
MIN_INITIAL_DEBT_KEY,
|
|
28
|
+
ENDORSED_UI_KEY,
|
|
28
29
|
} from './params.js';
|
|
29
30
|
import { prepareVaultDirector } from './vaultDirector.js';
|
|
30
31
|
|
|
@@ -76,6 +77,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
76
77
|
[LIQUIDATION_INSTALL_KEY]: { value: liqInstall },
|
|
77
78
|
[LIQUIDATION_TERMS_KEY]: { value: liqTerms },
|
|
78
79
|
[MIN_INITIAL_DEBT_KEY]: { value: minInitialDebt },
|
|
80
|
+
[ENDORSED_UI_KEY]: { value: endorsedUi },
|
|
79
81
|
} = zcf.getTerms().governedParams;
|
|
80
82
|
/** a powerful object; can modify the invitation */
|
|
81
83
|
const vaultDirectorParamManager = await makeVaultDirectorParamManager(
|
|
@@ -86,6 +88,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
86
88
|
liqTerms,
|
|
87
89
|
minInitialDebt,
|
|
88
90
|
initialShortfallInvitation,
|
|
91
|
+
endorsedUi,
|
|
89
92
|
);
|
|
90
93
|
|
|
91
94
|
assertElectorateMatches(
|