@agoric/inter-protocol 0.13.2-dev-0e039d9.0 → 0.13.2-dev-ed5ee58.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.
Files changed (71) hide show
  1. package/bundles/bundle-econCommitteeCharter-meta.js +78 -78
  2. package/bundles/bundle-econCommitteeCharter.js +1 -1
  3. package/bundles/bundle-feeDistributor-meta.js +61 -61
  4. package/bundles/bundle-feeDistributor.js +1 -1
  5. package/bundles/bundle-fluxAggregator-meta.js +114 -114
  6. package/bundles/bundle-fluxAggregator.js +1 -1
  7. package/bundles/bundle-psm-meta.js +112 -112
  8. package/bundles/bundle-psm.js +1 -1
  9. package/bundles/bundle-reserve-meta.js +110 -114
  10. package/bundles/bundle-reserve.js +1 -1
  11. package/bundles/bundle-scaledPriceAuthority-meta.js +78 -78
  12. package/bundles/bundle-scaledPriceAuthority.js +1 -1
  13. package/bundles/bundle-stakeFactory-meta.js +118 -118
  14. package/bundles/bundle-stakeFactory.js +1 -1
  15. package/bundles/bundle-vaultFactory-meta.js +128 -128
  16. package/bundles/bundle-vaultFactory.js +1 -1
  17. package/exported.js +0 -1
  18. package/package.json +16 -16
  19. package/scripts/deploy-contracts.js +0 -2
  20. package/scripts/init-core.js +0 -16
  21. package/src/feeDistributor.js +1 -1
  22. package/src/proposals/addAssetToVault.js +4 -57
  23. package/src/proposals/committee-proposal.js +3 -6
  24. package/src/proposals/core-proposal.js +1 -73
  25. package/src/proposals/demoIssuers.js +1 -232
  26. package/src/proposals/econ-behaviors.js +10 -193
  27. package/src/proposals/sim-behaviors.js +1 -1
  28. package/src/reserve/assetReserve.js +9 -170
  29. package/src/reserve/params.js +1 -4
  30. package/src/vaultFactory/liquidateIncrementally.js +16 -141
  31. package/src/vaultFactory/liquidateMinimum.js +19 -21
  32. package/src/vaultFactory/params.js +0 -29
  33. package/src/vaultFactory/types.js +0 -6
  34. package/src/vaultFactory/vault.js +1 -3
  35. package/src/vaultFactory/vaultDirector.js +1 -33
  36. package/src/vaultFactory/vaultFactory.js +2 -12
  37. package/src/vaultFactory/vaultManager.js +10 -217
  38. package/bundles/bundle-amm-meta.js +0 -686
  39. package/bundles/bundle-amm.js +0 -1
  40. package/bundles/bundle-interchainPool-meta.js +0 -606
  41. package/bundles/bundle-interchainPool.js +0 -1
  42. package/bundles/bundle-liquidateIncrementally-meta.js +0 -470
  43. package/bundles/bundle-liquidateIncrementally.js +0 -1
  44. package/bundles/bundle-liquidateMinimum-meta.js +0 -470
  45. package/bundles/bundle-liquidateMinimum.js +0 -1
  46. package/scripts/add-initial-liquidity.js +0 -179
  47. package/src/interchainPool.js +0 -134
  48. package/src/vpool-xyk-amm/AttackersGuide.md +0 -89
  49. package/src/vpool-xyk-amm/addLiquidity.js +0 -221
  50. package/src/vpool-xyk-amm/addPool.js +0 -200
  51. package/src/vpool-xyk-amm/constantProduct/AMM-Trade.jpeg +0 -0
  52. package/src/vpool-xyk-amm/constantProduct/README.md +0 -204
  53. package/src/vpool-xyk-amm/constantProduct/calcFees.js +0 -93
  54. package/src/vpool-xyk-amm/constantProduct/calcSwapPrices.js +0 -83
  55. package/src/vpool-xyk-amm/constantProduct/core.js +0 -145
  56. package/src/vpool-xyk-amm/constantProduct/defaults.js +0 -3
  57. package/src/vpool-xyk-amm/constantProduct/getXY.js +0 -48
  58. package/src/vpool-xyk-amm/constantProduct/internal-types.js +0 -114
  59. package/src/vpool-xyk-amm/constantProduct/invariants.js +0 -39
  60. package/src/vpool-xyk-amm/constantProduct/swap.js +0 -270
  61. package/src/vpool-xyk-amm/constantProduct/types.js +0 -30
  62. package/src/vpool-xyk-amm/doublePool.js +0 -200
  63. package/src/vpool-xyk-amm/estimate.js +0 -175
  64. package/src/vpool-xyk-amm/multipoolMarketMaker.js +0 -530
  65. package/src/vpool-xyk-amm/params.js +0 -59
  66. package/src/vpool-xyk-amm/pool.js +0 -398
  67. package/src/vpool-xyk-amm/priceAuthority.js +0 -92
  68. package/src/vpool-xyk-amm/removeLiquidity.js +0 -29
  69. package/src/vpool-xyk-amm/singlePool.js +0 -88
  70. package/src/vpool-xyk-amm/swap.js +0 -68
  71. package/src/vpool-xyk-amm/types.js +0 -152
@@ -1,152 +0,0 @@
1
- /**
2
- * @typedef {object} VPoolPriceQuote
3
- * @property {Amount<'nat'>} amountIn
4
- * @property {Amount<'nat'>} amountOut
5
- */
6
-
7
- /**
8
- * @typedef {object} SinglePoolSwapResult
9
- *
10
- * @property {Amount<'nat'>} xIncrement
11
- * @property {Amount<'nat'>} swapperGives
12
- * @property {Amount<'nat'>} yDecrement
13
- * @property {Amount<'nat'>} swapperGets
14
- * @property {Amount<'nat'>} protocolFee
15
- * @property {Amount<'nat'>} poolFee
16
- * @property {Amount<'nat'>} newY
17
- * @property {Amount<'nat'>} newX
18
- */
19
-
20
- /**
21
- * @typedef {import('./multipoolMarketMaker.js').MetricsNotification} MetricsNotification
22
- * @typedef {import('./pool.js').PoolMetricsNotification} PoolMetricsNotification
23
- */
24
-
25
- /**
26
- * @typedef {object} DoublePoolSwapResult
27
- * @property {Amount<'nat'>} swapperGives
28
- * @property {Amount<'nat'>} swapperGets
29
- * @property {Amount<'nat'>} inPoolIncrement
30
- * @property {Amount<'nat'>} inPoolDecrement
31
- * @property {Amount<'nat'>} outPoolIncrement
32
- * @property {Amount<'nat'>} outPoolDecrement
33
- * @property {Amount<'nat'>} protocolFee
34
- */
35
-
36
- /**
37
- * @typedef {Arity extends 'single' ? SinglePoolSwapResult
38
- * : Arity extends 'double' ? DoublePoolSwapResult
39
- * : SinglePoolSwapResult | DoublePoolSwapResult} SwapResult
40
- * @template {'single' | 'double' | unknown} Arity
41
- */
42
-
43
- /**
44
- * @typedef {object} VirtualPool - virtual pool for price quotes and trading
45
- * @property {(seat: ZCFSeat, prices: SwapResult<Arity>) => string} allocateGainsAndLosses
46
- * @property {(amountIn: Amount, amountOut: Amount) => SwapResult<Arity>} getPriceForInput
47
- * @property {(amountIn: Amount, amountOut: Amount) => SwapResult<Arity>} getPriceForOutput
48
- * @template {'single' | 'double' | unknown} [Arity=unknown]
49
- */
50
-
51
- /**
52
- * @callback AddLiquidityActual
53
- * @param {XYKPool} pool
54
- * @param {ZCFSeat} zcfSeat
55
- * @param {Amount<'nat'>} secondaryAmount
56
- * @param {Amount<'nat'>} poolCentralAmount
57
- * @param {ZCFSeat} [feeSeat]
58
- * @returns {string}
59
- */
60
-
61
- /**
62
- * @callback AddLiquidityInternal
63
- * @param {ZCFSeat} zcfSeat
64
- * @param {Amount<'nat'>} secondaryAmount
65
- * @param {Amount<'nat'>} poolCentralAmount
66
- * @param {ZCFSeat} [feeSeat]
67
- */
68
-
69
- /**
70
- * @typedef {object} XYKPool
71
- * @property {() => bigint} getLiquiditySupply
72
- * @property {() => Issuer<'nat'>} getLiquidityIssuer
73
- * @property {(seat: ZCFSeat) => string} addLiquidity
74
- * @property {(seat: ZCFSeat) => string} removeLiquidity
75
- * @property {() => ZCFSeat} getPoolSeat
76
- * @property {() => Amount<'nat'>} getSecondaryAmount
77
- * @property {() => Amount<'nat'>} getCentralAmount
78
- * @property {() => Subscriber<Record<string, Amount>>} getSubscriber
79
- * @property {() => void} updateState
80
- * @property {() => PriceAuthority} getToCentralPriceAuthority
81
- * @property {() => PriceAuthority} getFromCentralPriceAuthority
82
- * @property {() => VirtualPool} getVPool
83
- * @property {() => StoredSubscription<PoolMetricsNotification>} getMetrics
84
- */
85
-
86
- /**
87
- * @typedef {object} PoolFacets
88
- * @property {XYKPool} pool
89
- * @property {{addLiquidityActual: AddLiquidityActual, addLiquidityInternal: AddLiquidityInternal}} helper
90
- * @property {VirtualPool<'single'>} singlePool
91
- */
92
-
93
- /**
94
- * @typedef {object} XYKAMMCreatorFacet
95
- * @property {() => Promise<Invitation>} makeCollectFeesInvitation
96
- * @property {(facet: AssetReservePublicFacet) => void} resolveReserveFacet
97
- */
98
-
99
- /**
100
- * @typedef {object} XYKAMMPublicFacet
101
- * @property {() => Promise<Invitation>} addPoolInvitation
102
- * add a new liquidity pool
103
- * @property {(secondaryIssuer: ERef<Issuer>, keyword: Keyword) => Promise<Issuer<'nat'>>} addIssuer
104
- * @property {() => Promise<Invitation>} makeSwapInvitation synonym for
105
- * makeSwapInInvitation
106
- * @property {() => Promise<Invitation>} makeSwapInInvitation make an invitation
107
- * that allows one to do a swap in which the In amount is specified and the Out
108
- * amount is calculated
109
- * @property {() => Promise<Invitation>} makeSwapOutInvitation make an invitation
110
- * that allows one to do a swap in which the Out amount is specified and the In
111
- * amount is calculated
112
- * @property {() => Promise<Invitation>} makeAddLiquidityInvitation make an
113
- * invitation that allows one to add liquidity to the pool.
114
- * @property {() => Promise<Invitation>} makeAddLiquidityAtRateInvitation make
115
- * an invitation that allows one to add liquidity to the pool at an arbitrary
116
- * ratio of collateral to Central.
117
- * @property {() => Promise<Invitation>} makeRemoveLiquidityInvitation make an
118
- * invitation that allows one to remove liquidity from the pool.
119
- * @property {(brand: Brand<'nat'>) => Issuer<'nat'>} getLiquidityIssuer
120
- * @property {(brand: Brand<'nat'>) => bigint} getLiquiditySupply get the current value of
121
- * liquidity in the pool for brand held by investors.
122
- * @property {(brand: Brand<'nat'>) => Issuer<'nat'>} getSecondaryIssuer
123
- * @property {(amountIn: Amount, amountOut: Amount) => VPoolPriceQuote} getInputPrice
124
- * calculate the amount of brandOut that will be returned if the amountIn is
125
- * offered using makeSwapInInvitation at the current price.
126
- * @property {(amountOut: Amount, amountIn: Amount) => VPoolPriceQuote} getOutputPrice
127
- * calculate the amount of brandIn that is required in order to get amountOut
128
- * using makeSwapOutInvitation at the current price
129
- * @property {(brand: Brand) => Record<string, Amount<'nat'>>} getPoolAllocation get an
130
- * AmountKeywordRecord showing the current balances in the pool for brand.
131
- * @property {() => Issuer<'set'>} getQuoteIssuer - get the Issuer that attests to
132
- * the prices in the priceQuotes issued by the PriceAuthorities
133
- * @property {(brand: Brand) => {toCentral: PriceAuthority, fromCentral: PriceAuthority}} getPriceAuthorities
134
- * get a pair of PriceAuthorities { toCentral, fromCentral } for requesting
135
- * Prices and notifications about changing prices.
136
- * @property {() => Brand<'nat'>[]} getAllPoolBrands
137
- * @property {() => Allocation} getProtocolPoolBalance
138
- * @property {() => StoredSubscription<MetricsNotification>} getMetrics
139
- * @property {(brand: Brand) => StoredSubscription<PoolMetricsNotification>} getPoolMetrics
140
- * @property {() => bigint} getProtocolFee
141
- * @property {() => bigint} getPoolFee
142
- * @property {() => Amount<'nat'>} getMinInitialPoolLiquidity
143
- */
144
-
145
- /**
146
- * @callback MakeAmmParamManager
147
- * @param {ERef<ZoeService>} zoe
148
- * @param {bigint} poolFeeBP
149
- * @param {bigint} protocolFeeBP
150
- * @param {Invitation} poserInvitation - invitation for the question poser
151
- * @returns {Promise<ParamManagerFull>}
152
- */