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