@agoric/inter-protocol 0.13.3 → 0.13.4-dev-d32a66a.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/README.md +26 -20
- package/bundles/bundle-auctioneer-js-meta.json +722 -0
- package/bundles/bundle-auctioneer.js +1 -0
- package/bundles/bundle-econCommitteeCharter-js-meta.json +514 -0
- package/bundles/bundle-econCommitteeCharter.js +1 -0
- package/bundles/bundle-feeDistributor-js-meta.json +458 -0
- package/bundles/bundle-feeDistributor.js +1 -1
- package/bundles/bundle-fluxAggregatorKit-js-meta.json +674 -0
- package/bundles/bundle-fluxAggregatorKit.js +1 -0
- package/bundles/bundle-psm-js-meta.json +666 -0
- package/bundles/bundle-psm.js +1 -1
- package/bundles/bundle-reserve-js-meta.json +662 -0
- package/bundles/bundle-reserve.js +1 -1
- package/bundles/bundle-scaledPriceAuthority-js-meta.json +542 -0
- package/bundles/bundle-scaledPriceAuthority.js +1 -1
- package/bundles/bundle-vaultFactory-js-meta.json +786 -0
- package/bundles/bundle-vaultFactory.js +1 -1
- package/exported.js +0 -2
- package/package.json +34 -31
- package/scripts/add-collateral-core.js +14 -4
- package/scripts/build-bundles.js +9 -2
- package/scripts/deploy-contracts.js +1 -4
- package/scripts/init-core.js +20 -38
- package/scripts/invite-committee-core.js +1 -1
- package/scripts/manual-price-feed.js +2 -2
- package/scripts/price-feed-core.js +7 -6
- package/scripts/start-local-chain.sh +84 -0
- package/src/auction/auctionBook.js +755 -0
- package/src/auction/auctioneer.js +720 -0
- package/src/auction/offerBook.js +221 -0
- package/src/auction/params.js +174 -0
- package/src/auction/scheduleMath.js +167 -0
- package/src/auction/scheduler.js +370 -0
- package/src/auction/sortedOffers.js +136 -0
- package/src/auction/util.js +55 -0
- package/src/clientSupport.js +324 -0
- package/src/collectFees.js +8 -14
- package/src/contractSupport.js +24 -68
- package/src/econCommitteeCharter.js +161 -77
- package/src/feeDistributor.js +60 -20
- package/src/index.js +2 -0
- package/src/interest-math.js +1 -4
- package/src/interest.js +20 -13
- package/src/price/README.md +57 -0
- package/src/price/fluxAggregatorContract.js +190 -0
- package/src/price/fluxAggregatorKit.js +375 -0
- package/src/price/priceOracleKit.js +127 -0
- package/src/price/roundsManager.js +726 -0
- package/src/proposals/addAssetToVault.js +89 -94
- package/src/proposals/committee-proposal.js +141 -40
- package/src/proposals/core-proposal.js +100 -167
- package/src/proposals/econ-behaviors.js +320 -564
- package/src/proposals/price-feed-proposal.js +175 -78
- package/src/proposals/startEconCommittee.js +25 -12
- package/src/proposals/startPSM.js +231 -211
- package/src/proposals/utils.js +31 -17
- package/src/psm/README.md +71 -0
- package/src/psm/psm.js +272 -160
- package/src/psm/types.js +2 -0
- package/src/reserve/assetReserve.js +56 -413
- package/src/reserve/assetReserveKit.js +303 -0
- package/src/reserve/doc.md +1 -3
- package/src/reserve/params.js +2 -5
- package/src/typeGuards.js +13 -0
- package/src/vaultFactory/Liquidation.md +100 -0
- package/src/vaultFactory/burn.js +2 -1
- package/src/vaultFactory/liquidation.js +270 -108
- package/src/vaultFactory/math.js +95 -0
- package/src/vaultFactory/orderedVaultStore.js +0 -1
- package/src/vaultFactory/params.js +133 -112
- package/src/vaultFactory/prioritizedVaults.js +36 -79
- package/src/vaultFactory/storeUtils.js +67 -9
- package/src/vaultFactory/type-imports.js +2 -0
- package/src/vaultFactory/types.js +22 -26
- package/src/vaultFactory/vault.js +772 -709
- package/src/vaultFactory/vaultDirector.js +480 -483
- package/src/vaultFactory/vaultFactory.js +99 -60
- package/src/vaultFactory/vaultHolder.js +121 -95
- package/src/vaultFactory/vaultKit.js +39 -31
- package/src/vaultFactory/vaultManager.js +1249 -868
- package/bundles/bundle-amm-meta.js +0 -618
- package/bundles/bundle-amm.js +0 -1
- package/bundles/bundle-feeDistributor-meta.js +0 -346
- package/bundles/bundle-interchainPool-meta.js +0 -534
- package/bundles/bundle-interchainPool.js +0 -1
- package/bundles/bundle-liquidateIncrementally-meta.js +0 -442
- package/bundles/bundle-liquidateIncrementally.js +0 -1
- package/bundles/bundle-liquidateMinimum-meta.js +0 -442
- package/bundles/bundle-liquidateMinimum.js +0 -1
- package/bundles/bundle-psm-meta.js +0 -538
- package/bundles/bundle-psmCharter-meta.js +0 -418
- package/bundles/bundle-psmCharter.js +0 -1
- package/bundles/bundle-reserve-meta.js +0 -542
- package/bundles/bundle-scaledPriceAuthority-meta.js +0 -442
- package/bundles/bundle-stakeFactory-meta.js +0 -574
- package/bundles/bundle-stakeFactory.js +0 -1
- package/bundles/bundle-vaultFactory-meta.js +0 -598
- package/scripts/add-initial-liquidity.js +0 -180
- package/src/collect.js +0 -13
- package/src/interchainPool.js +0 -135
- package/src/makeTracer.js +0 -36
- package/src/my-lien.js +0 -85
- package/src/proposals/demoIssuers.js +0 -685
- package/src/proposals/sim-behaviors.js +0 -40
- package/src/psm/psmCharter.js +0 -139
- package/src/stakeFactory/README.md +0 -62
- package/src/stakeFactory/attestation.js +0 -267
- package/src/stakeFactory/attestationTool.js +0 -66
- package/src/stakeFactory/constants.js +0 -16
- package/src/stakeFactory/params.js +0 -31
- package/src/stakeFactory/stakeFactory.js +0 -236
- package/src/stakeFactory/stakeFactoryKit.js +0 -455
- package/src/stakeFactory/stakeFactoryManager.js +0 -296
- package/src/stakeFactory/types.js +0 -42
- package/src/vaultFactory/liquidateIncrementally.js +0 -350
- package/src/vaultFactory/liquidateMinimum.js +0 -100
- package/src/vpool-xyk-amm/AttackersGuide.md +0 -89
- package/src/vpool-xyk-amm/addLiquidity.js +0 -222
- package/src/vpool-xyk-amm/addPool.js +0 -197
- package/src/vpool-xyk-amm/constantProduct/AMM-Trade.jpeg +0 -0
- package/src/vpool-xyk-amm/constantProduct/README.md +0 -204
- package/src/vpool-xyk-amm/constantProduct/calcFees.js +0 -99
- package/src/vpool-xyk-amm/constantProduct/calcSwapPrices.js +0 -85
- package/src/vpool-xyk-amm/constantProduct/core.js +0 -153
- package/src/vpool-xyk-amm/constantProduct/defaults.js +0 -5
- package/src/vpool-xyk-amm/constantProduct/getXY.js +0 -52
- package/src/vpool-xyk-amm/constantProduct/internal-types.js +0 -116
- package/src/vpool-xyk-amm/constantProduct/invariants.js +0 -43
- package/src/vpool-xyk-amm/constantProduct/swap.js +0 -272
- package/src/vpool-xyk-amm/constantProduct/types.js +0 -32
- package/src/vpool-xyk-amm/doublePool.js +0 -194
- package/src/vpool-xyk-amm/estimate.js +0 -155
- package/src/vpool-xyk-amm/multipoolMarketMaker.js +0 -520
- package/src/vpool-xyk-amm/params.js +0 -61
- package/src/vpool-xyk-amm/pool.js +0 -396
- package/src/vpool-xyk-amm/priceAuthority.js +0 -94
- package/src/vpool-xyk-amm/removeLiquidity.js +0 -31
- package/src/vpool-xyk-amm/singlePool.js +0 -73
- package/src/vpool-xyk-amm/swap.js +0 -69
- package/src/vpool-xyk-amm/types.js +0 -154
package/README.md
CHANGED
|
@@ -30,6 +30,8 @@ To maintain that the keys of vaults to liquidate are stable requires that its ke
|
|
|
30
30
|
|
|
31
31
|
VaultFactory publishes data using StoredPublishKit which tees writes to off-chain storage. These can then be followed off-chain like so,
|
|
32
32
|
```js
|
|
33
|
+
import { makeFollower } from '@agoric/casting';
|
|
34
|
+
|
|
33
35
|
const key = `published.vaultFactory.metrics`; // or whatever the stream of interest is
|
|
34
36
|
const leader = makeDefaultLeader();
|
|
35
37
|
const follower = makeFollower(storeKey, leader);
|
|
@@ -40,30 +42,34 @@ VaultFactory publishes data using StoredPublishKit which tees writes to off-chai
|
|
|
40
42
|
|
|
41
43
|
The canonical keys (under `published`) are as follows. Non-terminal nodes could have data but don't yet. A `0` indicates the index of that child in added order. To get the actual key look it up in parent. High cardinality types get a parent key for enumeration (e.g. `vaults`.)
|
|
42
44
|
- `published`
|
|
43
|
-
- `vaultFactory`
|
|
45
|
+
- `vaultFactory` - [snapshot of details](./test/vaultFactory/snapshots/test-vaultFactory.js.md)
|
|
44
46
|
- `governance`
|
|
45
47
|
- `metrics`
|
|
46
|
-
- `
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- `
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
- `managers`
|
|
49
|
+
- `manager0`
|
|
50
|
+
- `metrics`
|
|
51
|
+
- `governance`
|
|
52
|
+
- `vaults`
|
|
53
|
+
- `vault0`
|
|
54
|
+
- `auction` - [snapshot of details](./test/auction/snapshots/test-auctionContract.js.md)
|
|
55
|
+
- `schedule`
|
|
53
56
|
- `governance`
|
|
54
|
-
- `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
- `book0`
|
|
58
|
+
- `reserve` - [snapshot of details](./test/reserve/snapshots/test-reserve.js.md)
|
|
59
|
+
- `governance`
|
|
60
|
+
- `metrics`
|
|
61
|
+
- `priceFeed` - [snapshot of details](./test/price/snapshots/test-fluxAggregatorKit.js.md)
|
|
62
|
+
- `${inputBrand}-${outputBrand}_price_feed`
|
|
63
|
+
- `${inputBrand}-${outputBrand}_price_feed.latestRound`
|
|
64
|
+
- `psm` - [snapshot of details](./test/psm/snapshots/test-psm.js.md)
|
|
58
65
|
- `<minted>`
|
|
59
66
|
- `<anchor>`
|
|
60
67
|
- `governance`
|
|
61
68
|
- `metrics`
|
|
62
|
-
- `
|
|
63
|
-
- `governance`
|
|
64
|
-
- `committees`
|
|
69
|
+
- `committees` - [snapshot of details](../governance/test/unitTests/snapshots/test-committee.js.md)
|
|
65
70
|
- `Economic_Committee`
|
|
66
71
|
- `latestQuestion`
|
|
72
|
+
- `latestOutcome`
|
|
67
73
|
|
|
68
74
|
### Demo
|
|
69
75
|
|
|
@@ -77,9 +83,9 @@ Once you see a string like `block 17 commit` then the chain is available. In ano
|
|
|
77
83
|
# shows keys of the vaultFactory
|
|
78
84
|
agd query vstorage keys 'published.vaultFactory'
|
|
79
85
|
# lists vaults
|
|
80
|
-
agd query vstorage keys 'published.vaultFactory.manager0.vaults'
|
|
86
|
+
agd query vstorage keys 'published.vaultFactory.managers.manager0.vaults'
|
|
81
87
|
# follow metrics
|
|
82
|
-
agoric follow :published.vaultFactory.manager0.metrics
|
|
88
|
+
agoric follow :published.vaultFactory.managers.manager0.metrics
|
|
83
89
|
```
|
|
84
90
|
|
|
85
91
|
Start a new terminal to get a prompt.
|
|
@@ -102,16 +108,16 @@ vaultFactoryInstance = E(home.agoricNames).lookup('instance', 'VaultFactory')
|
|
|
102
108
|
vaultFactoryPublicFacet = E(home.zoe).getPublicFacet(vaultFactoryInstance)
|
|
103
109
|
# get a reference to the minted brand (soon to be IST)
|
|
104
110
|
E(home.agoricNames).lookup('brand', 'IST');
|
|
105
|
-
|
|
111
|
+
stableBrand=history[-1]
|
|
106
112
|
# get a reference to the collateral brand
|
|
107
|
-
E(home.agoricNames).lookup('brand', '
|
|
113
|
+
E(home.agoricNames).lookup('brand', 'ATOM')
|
|
108
114
|
atomBrand=history[-1]
|
|
109
115
|
# get a reference to the collateral manager, using history because the brand must be the same object
|
|
110
116
|
collateralManager = E(vaultFactoryPublicFacet).getCollateralManager(atomBrand)
|
|
111
117
|
# proposal
|
|
112
118
|
proposal = ({
|
|
113
119
|
give: { Collateral: { brand: atomBrand, value: 1000n } },
|
|
114
|
-
want: { IST: { brand:
|
|
120
|
+
want: { IST: { brand: stableBrand, value: 1n } },
|
|
115
121
|
})
|
|
116
122
|
# get the ATOM purse
|
|
117
123
|
E(home.wallet).getPurses()
|