@agoric/inter-protocol 0.16.2-other-dev-1f26562.0 → 0.16.2-other-dev-3eb1a1d.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 +6 -6
- package/package.json +42 -36
- package/scripts/build-bundles.js +5 -21
- package/src/auction/auctionBook.d.ts +147 -0
- package/src/auction/auctionBook.d.ts.map +1 -0
- package/src/auction/auctionBook.js +156 -150
- package/src/auction/auctionMath.d.ts +17 -0
- package/src/auction/auctionMath.d.ts.map +1 -0
- package/src/auction/auctionMath.js +81 -0
- package/src/auction/auctioneer.d.ts +69 -0
- package/src/auction/auctioneer.d.ts.map +1 -0
- package/src/auction/auctioneer.js +70 -59
- package/src/auction/offerBook.d.ts +45 -0
- package/src/auction/offerBook.d.ts.map +1 -0
- package/src/auction/offerBook.js +13 -12
- package/src/auction/params.d.ts +144 -0
- package/src/auction/params.d.ts.map +1 -0
- package/src/auction/params.js +10 -9
- package/src/auction/scheduleMath.d.ts +5 -0
- package/src/auction/scheduleMath.d.ts.map +1 -0
- package/src/auction/scheduleMath.js +18 -16
- package/src/auction/scheduler.d.ts +50 -0
- package/src/auction/scheduler.d.ts.map +1 -0
- package/src/auction/scheduler.js +53 -47
- package/src/auction/sortedOffers.d.ts +8 -0
- package/src/auction/sortedOffers.d.ts.map +1 -0
- package/src/auction/sortedOffers.js +10 -9
- package/src/auction/util.d.ts +30 -0
- package/src/auction/util.d.ts.map +1 -0
- package/src/auction/util.js +9 -6
- package/src/clientSupport.d.ts +167 -0
- package/src/clientSupport.d.ts.map +1 -0
- package/src/clientSupport.js +155 -97
- package/src/collectFees.d.ts +2 -0
- package/src/collectFees.d.ts.map +1 -0
- package/src/contractSupport.d.ts +28 -0
- package/src/contractSupport.d.ts.map +1 -0
- package/src/contractSupport.js +19 -13
- package/src/econCommitteeCharter.d.ts +40 -0
- package/src/econCommitteeCharter.d.ts.map +1 -0
- package/src/econCommitteeCharter.js +21 -20
- package/src/feeDistributor.d.ts +224 -0
- package/src/feeDistributor.d.ts.map +1 -0
- package/src/feeDistributor.js +37 -33
- package/src/index.d.ts +2 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +1 -0
- package/src/interest-math.d.ts +3 -0
- package/src/interest-math.d.ts.map +1 -0
- package/src/interest.d.ts +28 -0
- package/src/interest.d.ts.map +1 -0
- package/src/interest.js +23 -18
- package/src/price/README.md +13 -0
- package/src/price/fluxAggregatorContract.d.ts +71 -0
- package/src/price/fluxAggregatorContract.d.ts.map +1 -0
- package/src/price/fluxAggregatorContract.js +64 -55
- package/src/price/fluxAggregatorKit.d.ts +103 -0
- package/src/price/fluxAggregatorKit.d.ts.map +1 -0
- package/src/price/fluxAggregatorKit.js +52 -40
- package/src/price/priceOracleKit.d.ts +38 -0
- package/src/price/priceOracleKit.d.ts.map +1 -0
- package/src/price/priceOracleKit.js +12 -14
- package/src/price/roundsManager.d.ts +204 -0
- package/src/price/roundsManager.d.ts.map +1 -0
- package/src/price/roundsManager.js +131 -85
- package/src/proposals/README.md +2 -3
- package/src/proposals/add-auction.d.ts +109 -0
- package/src/proposals/add-auction.d.ts.map +1 -0
- package/src/proposals/add-auction.js +256 -0
- package/src/proposals/addAssetToVault.d.ts +173 -0
- package/src/proposals/addAssetToVault.d.ts.map +1 -0
- package/src/proposals/addAssetToVault.js +192 -40
- package/src/proposals/committee-proposal.d.ts +113 -0
- package/src/proposals/committee-proposal.d.ts.map +1 -0
- package/src/proposals/committee-proposal.js +25 -31
- package/src/proposals/core-proposal.d.ts +149 -0
- package/src/proposals/core-proposal.d.ts.map +1 -0
- package/src/proposals/core-proposal.js +9 -11
- package/src/proposals/deploy-price-feeds.d.ts +76 -0
- package/src/proposals/deploy-price-feeds.d.ts.map +1 -0
- package/src/proposals/deploy-price-feeds.js +316 -0
- package/src/proposals/econ-behaviors.d.ts +541 -0
- package/src/proposals/econ-behaviors.d.ts.map +1 -0
- package/src/proposals/econ-behaviors.js +64 -45
- package/src/proposals/price-feed-proposal.d.ts +84 -0
- package/src/proposals/price-feed-proposal.d.ts.map +1 -0
- package/src/proposals/price-feed-proposal.js +109 -51
- package/src/proposals/replace-fee-distributor.d.ts +48 -0
- package/src/proposals/replace-fee-distributor.d.ts.map +1 -0
- package/src/proposals/replace-fee-distributor.js +195 -0
- package/src/proposals/replace-scaledPriceAuthorities.d.ts +30 -0
- package/src/proposals/replace-scaledPriceAuthorities.d.ts.map +1 -0
- package/src/proposals/replace-scaledPriceAuthorities.js +124 -0
- package/src/proposals/replaceElectorate.d.ts +55 -0
- package/src/proposals/replaceElectorate.d.ts.map +1 -0
- package/src/proposals/replaceElectorate.js +521 -0
- package/src/proposals/startEconCommittee.d.ts +34 -0
- package/src/proposals/startEconCommittee.d.ts.map +1 -0
- package/src/proposals/startEconCommittee.js +2 -2
- package/src/proposals/startPSM.d.ts +59 -0
- package/src/proposals/startPSM.d.ts.map +1 -0
- package/src/proposals/startPSM.js +44 -29
- package/src/proposals/upgrade-scaledPriceAuthorities.d.ts +24 -0
- package/src/proposals/upgrade-scaledPriceAuthorities.d.ts.map +1 -0
- package/src/proposals/upgrade-scaledPriceAuthorities.js +78 -0
- package/src/proposals/upgrade-vaults.d.ts +41 -0
- package/src/proposals/upgrade-vaults.d.ts.map +1 -0
- package/src/proposals/upgrade-vaults.js +202 -0
- package/src/proposals/utils.d.ts +19 -0
- package/src/proposals/utils.d.ts.map +1 -0
- package/src/proposals/utils.js +43 -9
- package/src/provisionPool.d.ts +163 -0
- package/src/provisionPool.d.ts.map +1 -0
- package/src/provisionPool.js +122 -0
- package/src/provisionPoolKit.d.ts +359 -0
- package/src/provisionPoolKit.d.ts.map +1 -0
- package/src/provisionPoolKit.js +522 -0
- package/src/psm/psm.d.ts +125 -0
- package/src/psm/psm.d.ts.map +1 -0
- package/src/psm/psm.js +80 -79
- package/src/psm/types-ambient.d.ts +2 -0
- package/src/psm/types-ambient.d.ts.map +1 -0
- package/src/psm/types-ambient.js +3 -0
- package/src/reserve/assetReserve.d.ts +47 -0
- package/src/reserve/assetReserve.d.ts.map +1 -0
- package/src/reserve/assetReserve.js +28 -19
- package/src/reserve/assetReserveKit.d.ts +74 -0
- package/src/reserve/assetReserveKit.d.ts.map +1 -0
- package/src/reserve/assetReserveKit.js +24 -30
- package/src/reserve/params.d.ts +10 -0
- package/src/reserve/params.d.ts.map +1 -0
- package/src/tokens.d.ts +3 -0
- package/src/tokens.d.ts.map +1 -0
- package/src/tokens.js +5 -0
- package/src/vaultFactory/burn.d.ts +2 -0
- package/src/vaultFactory/burn.d.ts.map +1 -0
- package/src/vaultFactory/burn.js +1 -1
- package/src/vaultFactory/liquidation.d.ts +23 -0
- package/src/vaultFactory/liquidation.d.ts.map +1 -0
- package/src/vaultFactory/liquidation.js +37 -24
- package/src/vaultFactory/math.d.ts +11 -0
- package/src/vaultFactory/math.d.ts.map +1 -0
- package/src/vaultFactory/math.js +10 -9
- package/src/vaultFactory/orderedVaultStore.d.ts +93 -0
- package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -0
- package/src/vaultFactory/orderedVaultStore.js +8 -11
- package/src/vaultFactory/params.d.ts +140 -0
- package/src/vaultFactory/params.d.ts.map +1 -0
- package/src/vaultFactory/params.js +52 -24
- package/src/vaultFactory/prioritizedVaults.d.ts +279 -0
- package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -0
- package/src/vaultFactory/prioritizedVaults.js +4 -4
- package/src/vaultFactory/proceeds.d.ts +35 -0
- package/src/vaultFactory/proceeds.d.ts.map +1 -0
- package/src/vaultFactory/proceeds.js +26 -18
- package/src/vaultFactory/storeUtils.d.ts +25 -0
- package/src/vaultFactory/storeUtils.d.ts.map +1 -0
- package/src/vaultFactory/storeUtils.js +10 -12
- package/src/vaultFactory/types-ambient.d.ts +137 -0
- package/src/vaultFactory/types-ambient.d.ts.map +1 -0
- package/src/vaultFactory/{types.js → types-ambient.js} +42 -42
- package/src/vaultFactory/vault.d.ts +343 -0
- package/src/vaultFactory/vault.d.ts.map +1 -0
- package/src/vaultFactory/vault.js +105 -99
- package/src/vaultFactory/vaultDirector.d.ts +341 -0
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -0
- package/src/vaultFactory/vaultDirector.js +86 -64
- package/src/vaultFactory/vaultFactory.d.ts +202 -0
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -0
- package/src/vaultFactory/vaultFactory.js +52 -33
- package/src/vaultFactory/vaultHolder.d.ts +126 -0
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -0
- package/src/vaultFactory/vaultHolder.js +11 -16
- package/src/vaultFactory/vaultKit.d.ts +32 -0
- package/src/vaultFactory/vaultKit.d.ts.map +1 -0
- package/src/vaultFactory/vaultKit.js +5 -4
- package/src/vaultFactory/vaultManager.d.ts +674 -0
- package/src/vaultFactory/vaultManager.d.ts.map +1 -0
- package/src/vaultFactory/vaultManager.js +257 -158
- package/CHANGELOG.md +0 -1041
- package/exported.js +0 -2
- package/scripts/add-collateral-core.js +0 -112
- package/scripts/deploy-contracts.js +0 -100
- package/scripts/init-core.js +0 -198
- package/scripts/invite-committee-core.js +0 -42
- package/scripts/manual-price-feed.js +0 -117
- package/scripts/price-feed-core.js +0 -104
- package/scripts/start-local-chain.sh +0 -84
- package/src/psm/types.js +0 -3
- package/src/typeGuards.js +0 -13
- package/src/vaultFactory/type-imports.js +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auctioneer.d.ts","sourceRoot":"","sources":["auctioneer.js"],"names":[],"mappings":"AAkLO,yEAXI,MAAM,CAAC,KAAK,CAAC,YACb,MAAM,CAAC,KAAK,CAAC,YACb;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;CAAE,EAAE,kBAC/D,OAAO,kBACP,OAAO,qBAEP,MAAM,eAEN,OAAO,SACP,KAAK,kBAgNf;AAiBM,2BAdI,GAAG,CACT,eAAe,CAAC,OAAO,oBAAoB,CAAC,GAAG;IAC7C,YAAY,EAAE,OAAO,cAAc,EAAE,YAAY,CAAC;IAClD,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,cAAc,EAAE,cAAc,CAAC;CAChC,CACF,eACO;IACN,sBAAsB,EAAE,UAAU,CAAC;IACnC,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;CACxB,WACO,OAAO;;;;;;;;;;QAqOZ,4CAA4C;2CAAhC,KAAK,CAAC,KAAK,CAAC;;;;;;;;;;;;;kBApCT,MAAM,CAAC,KAAK,CAAC;;;;QAkG5B;;;WAGG;yBAFQ,MAAM,CAAC,KAAK,CAAC,OACb,OAAO;QAwBlB,gEAAgE;uBAAlD,OAAO,CAAC,OAAO,gBAAgB,EAAE,YAAY,CAAC;;QA1B5D;;;WAGG;yBAFQ,MAAM,CAAC,KAAK,CAAC,OACb,OAAO;QAwBlB,gEAAgE;uBAAlD,OAAO,CAAC,OAAO,gBAAgB,EAAE,YAAY,CAAC;;GAQjE;AAED,6DAA6D;AAC7D,yEAAyE;AACzE,2EAA2E;AAE3E,8DAAkE;iCAJpD,UAAU,CAAC,OAAO,KAAK,CAAC;oCACxB,kBAAkB,CAAC,aAAa,CAAC;qCACjC,kBAAkB,CAAC,cAAc,CAAC;qCAxrBX,aAAa;oCAO2C,4BAA4B;6BAD/F,kBAAkB"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '@agoric/zoe/src/contracts/exported.js';
|
|
1
|
+
/// <reference types="@agoric/governance/exported" />
|
|
2
|
+
/// <reference types="@agoric/zoe/exported" />
|
|
4
3
|
|
|
4
|
+
import { Fail, q } from '@endo/errors';
|
|
5
|
+
import { E } from '@endo/eventual-send';
|
|
6
|
+
import { Far } from '@endo/marshal';
|
|
5
7
|
import { AmountMath, AmountShape, BrandShape } from '@agoric/ertp';
|
|
6
8
|
import { handleParamGovernance } from '@agoric/governance';
|
|
7
|
-
import {
|
|
9
|
+
import { makeTracer } from '@agoric/internal';
|
|
8
10
|
import { prepareDurablePublishKit } from '@agoric/notifier';
|
|
9
11
|
import { mustMatch } from '@agoric/store';
|
|
10
12
|
import { appendToStoredArray } from '@agoric/store/src/stores/store-utils.js';
|
|
11
13
|
import { M, provideDurableMapStore } from '@agoric/vat-data';
|
|
12
14
|
import {
|
|
13
|
-
atomicRearrange,
|
|
14
15
|
ceilDivideBy,
|
|
15
16
|
ceilMultiplyBy,
|
|
16
17
|
defineERecorderKit,
|
|
@@ -26,8 +27,6 @@ import {
|
|
|
26
27
|
offerTo,
|
|
27
28
|
} from '@agoric/zoe/src/contractSupport/index.js';
|
|
28
29
|
import { FullProposalShape } from '@agoric/zoe/src/typeGuards.js';
|
|
29
|
-
import { E } from '@endo/eventual-send';
|
|
30
|
-
import { Far } from '@endo/marshal';
|
|
31
30
|
|
|
32
31
|
import { makeNatAmountShape } from '../contractSupport.js';
|
|
33
32
|
import { makeOfferSpecShape, prepareAuctionBook } from './auctionBook.js';
|
|
@@ -35,19 +34,23 @@ import { auctioneerParamTypes } from './params.js';
|
|
|
35
34
|
import { makeScheduler } from './scheduler.js';
|
|
36
35
|
import { AuctionState } from './util.js';
|
|
37
36
|
|
|
38
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* @import {TypedPattern} from '@agoric/internal';
|
|
39
|
+
* @import {Baggage} from '@agoric/vat-data';
|
|
40
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
const BASIS_POINTS = 10_000n;
|
|
39
44
|
|
|
40
|
-
const { Fail, quote: q } = assert;
|
|
41
45
|
const { add, multiply } = natSafeMath;
|
|
42
46
|
|
|
43
47
|
const trace = makeTracer('Auction', true);
|
|
44
48
|
|
|
45
49
|
/**
|
|
46
|
-
* @file
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* all those cases.
|
|
50
|
+
* @file In this file, 'Bid' is the name of the ERTP issuer used to purchase
|
|
51
|
+
* collateral from various issuers. It's too confusing to also use Bid as a
|
|
52
|
+
* verb or a description of amounts offered, so we've tried to find
|
|
53
|
+
* alternatives in all those cases.
|
|
51
54
|
*/
|
|
52
55
|
|
|
53
56
|
const MINIMUM_BID_GIVE = 1n;
|
|
@@ -67,17 +70,19 @@ const makeBPRatio = (rate, bidBrand, collateralBrand = bidBrand) =>
|
|
|
67
70
|
* The auction sold some amount of collateral, and raised a certain amount of
|
|
68
71
|
* Bid. The excess collateral was returned as `unsoldCollateral`. The Bid amount
|
|
69
72
|
* collected from the auction participants is `proceeds`.
|
|
73
|
+
*
|
|
70
74
|
* Return a set of transfers for atomicRearrange() that distribute
|
|
71
75
|
* `unsoldCollateral` and `proceeds` proportionally to each seat's deposited
|
|
72
76
|
* amount. Any uneven split should be allocated to the reserve.
|
|
73
77
|
*
|
|
74
78
|
* @param {Amount} unsoldCollateral
|
|
75
79
|
* @param {Amount} proceeds
|
|
76
|
-
* @param {{seat: ZCFSeat
|
|
80
|
+
* @param {{ seat: ZCFSeat; amount: Amount<'nat'>; goal: Amount<'nat'> }[]} deposits
|
|
77
81
|
* @param {ZCFSeat} collateralSeat
|
|
78
|
-
* @param {ZCFSeat} bidHoldingSeat seat with the Bid allocation to be
|
|
82
|
+
* @param {ZCFSeat} bidHoldingSeat seat with the Bid allocation to be
|
|
83
|
+
* distributed
|
|
79
84
|
* @param {string} collateralKeyword The Reserve will hold multiple collaterals,
|
|
80
|
-
*
|
|
85
|
+
* so they need distinct keywords
|
|
81
86
|
* @param {ZCFSeat} reserveSeat
|
|
82
87
|
* @param {Brand} brand
|
|
83
88
|
*/
|
|
@@ -97,7 +102,7 @@ const distributeProportionalShares = (
|
|
|
97
102
|
|
|
98
103
|
const collShare = makeRatioFromAmounts(unsoldCollateral, totalCollDeposited);
|
|
99
104
|
const currShare = makeRatioFromAmounts(proceeds, totalCollDeposited);
|
|
100
|
-
/** @type {
|
|
105
|
+
/** @type {TransferPart[]} */
|
|
101
106
|
const transfers = [];
|
|
102
107
|
let proceedsLeft = proceeds;
|
|
103
108
|
let collateralLeft = unsoldCollateral;
|
|
@@ -132,6 +137,7 @@ const distributeProportionalShares = (
|
|
|
132
137
|
* The auction sold some amount of collateral, and raised a certain amount of
|
|
133
138
|
* Bid. The excess collateral was returned as `unsoldCollateral`. The Bid amount
|
|
134
139
|
* collected from the auction participants is `proceeds`.
|
|
140
|
+
*
|
|
135
141
|
* Return a set of transfers for atomicRearrange() that distribute
|
|
136
142
|
* `unsoldCollateral` and `proceeds` proportionally to each seat's deposited
|
|
137
143
|
* amount. Any uneven split should be allocated to the reserve.
|
|
@@ -140,32 +146,33 @@ const distributeProportionalShares = (
|
|
|
140
146
|
* outside the contract below.
|
|
141
147
|
*
|
|
142
148
|
* Some or all of the depositors may have specified a goal amount.
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* Think of it this way: those who specified a limit want as much
|
|
158
|
-
* back as possible, consistent with raising a certain amount of
|
|
159
|
-
* who didn't specify a limit are trying to sell collateral, and
|
|
160
|
-
* have as much as possible converted to Bid.
|
|
149
|
+
*
|
|
150
|
+
* - A if none did, return collateral and Bid prorated to deposits.
|
|
151
|
+
* - B if proceeds < proceedsGoal everyone gets prorated amounts of both.
|
|
152
|
+
* - C if proceeds matches proceedsGoal, everyone gets the Bid they asked for,
|
|
153
|
+
* plus enough collateral to reach the same proportional payout. If any
|
|
154
|
+
* depositor's goal amount exceeded their share of the total, we'll fall back
|
|
155
|
+
* to the first approach.
|
|
156
|
+
* - D if proceeds > proceedsGoal && all depositors specified a limit, all
|
|
157
|
+
* depositors get their goal first, then we distribute the remainder
|
|
158
|
+
* (collateral and Bid) to get the same proportional payout.
|
|
159
|
+
* - E if proceeds > proceedsGoal && some depositors didn't specify a limit,
|
|
160
|
+
* depositors who did will get their goal first, then we distribute the
|
|
161
|
+
* remainder (collateral and Bid) to get the same proportional payout. If any
|
|
162
|
+
* depositor's goal amount exceeded their share of the total, we'll fall back
|
|
163
|
+
* as above. Think of it this way: those who specified a limit want as much
|
|
164
|
+
* collateral back as possible, consistent with raising a certain amount of
|
|
165
|
+
* Bid. Those who didn't specify a limit are trying to sell collateral, and
|
|
166
|
+
* would prefer to have as much as possible converted to Bid.
|
|
161
167
|
*
|
|
162
168
|
* @param {Amount<'nat'>} unsoldCollateral
|
|
163
169
|
* @param {Amount<'nat'>} proceeds
|
|
164
|
-
* @param {{seat: ZCFSeat
|
|
170
|
+
* @param {{ seat: ZCFSeat; amount: Amount<'nat'>; goal: Amount<'nat'> }[]} deposits
|
|
165
171
|
* @param {ZCFSeat} collateralSeat
|
|
166
|
-
* @param {ZCFSeat} bidHoldingSeat seat with the Bid allocation to be
|
|
172
|
+
* @param {ZCFSeat} bidHoldingSeat seat with the Bid allocation to be
|
|
173
|
+
* distributed
|
|
167
174
|
* @param {string} collateralKeyword The Reserve will hold multiple collaterals,
|
|
168
|
-
*
|
|
175
|
+
* so they need distinct keywords
|
|
169
176
|
* @param {ZCFSeat} reserveSeat
|
|
170
177
|
* @param {Brand} brand
|
|
171
178
|
*/
|
|
@@ -255,7 +262,7 @@ export const distributeProportionalSharesWithLimits = (
|
|
|
255
262
|
// collateral to reach their share. Then see what's left, and allocate it
|
|
256
263
|
// among the remaining depositors. Escape to distributeProportionalShares if
|
|
257
264
|
// anything doesn't work.
|
|
258
|
-
/** @type {
|
|
265
|
+
/** @type {TransferPart[]} */
|
|
259
266
|
const transfers = [];
|
|
260
267
|
let proceedsLeft = proceeds;
|
|
261
268
|
let collateralLeft = unsoldCollateral;
|
|
@@ -378,15 +385,17 @@ export const distributeProportionalSharesWithLimits = (
|
|
|
378
385
|
};
|
|
379
386
|
|
|
380
387
|
/**
|
|
381
|
-
* @param {ZCF<
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
*
|
|
388
|
+
* @param {ZCF<
|
|
389
|
+
* GovernanceTerms<typeof auctioneerParamTypes> & {
|
|
390
|
+
* timerService: import('@agoric/time').TimerService;
|
|
391
|
+
* reservePublicFacet: AssetReservePublicFacet;
|
|
392
|
+
* priceAuthority: PriceAuthority;
|
|
393
|
+
* }
|
|
394
|
+
* >} zcf
|
|
386
395
|
* @param {{
|
|
387
|
-
* initialPoserInvitation: Invitation
|
|
388
|
-
* storageNode: StorageNode
|
|
389
|
-
* marshaller: Marshaller
|
|
396
|
+
* initialPoserInvitation: Invitation;
|
|
397
|
+
* storageNode: StorageNode;
|
|
398
|
+
* marshaller: Marshaller;
|
|
390
399
|
* }} privateArgs
|
|
391
400
|
* @param {Baggage} baggage
|
|
392
401
|
*/
|
|
@@ -399,7 +408,12 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
399
408
|
|
|
400
409
|
/** @type {MapStore<Brand, import('./auctionBook.js').AuctionBook>} */
|
|
401
410
|
const books = provideDurableMapStore(baggage, 'auctionBooks');
|
|
402
|
-
/**
|
|
411
|
+
/**
|
|
412
|
+
* @type {MapStore<
|
|
413
|
+
* Brand,
|
|
414
|
+
* { seat: ZCFSeat; amount: Amount<'nat'>; goal: Amount<'nat'> }[]
|
|
415
|
+
* >}
|
|
416
|
+
*/
|
|
403
417
|
const deposits = provideDurableMapStore(baggage, 'deposits');
|
|
404
418
|
/** @type {MapStore<Brand, Keyword>} */
|
|
405
419
|
const brandToKeyword = provideDurableMapStore(baggage, 'brandToKeyword');
|
|
@@ -427,9 +441,9 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
427
441
|
});
|
|
428
442
|
const scheduleKit = makeERecorderKit(
|
|
429
443
|
E(privateArgs.storageNode).makeChildNode('schedule'),
|
|
430
|
-
/**
|
|
431
|
-
|
|
432
|
-
|
|
444
|
+
/**
|
|
445
|
+
* @type {TypedPattern<import('./scheduler.js').ScheduleNotification>}
|
|
446
|
+
*/ (M.any()),
|
|
433
447
|
);
|
|
434
448
|
|
|
435
449
|
/**
|
|
@@ -477,8 +491,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
477
491
|
// send it all to the one
|
|
478
492
|
const liqSeat = depositsForBrand[0].seat;
|
|
479
493
|
|
|
480
|
-
atomicRearrange(
|
|
481
|
-
zcf,
|
|
494
|
+
zcf.atomicRearrange(
|
|
482
495
|
harden([
|
|
483
496
|
[collateralSeat, liqSeat, collateralSeat.getCurrentAllocation()],
|
|
484
497
|
[bidHoldingSeat, liqSeat, bidHoldingSeat.getCurrentAllocation()],
|
|
@@ -501,7 +514,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
501
514
|
reserveSeat,
|
|
502
515
|
brand,
|
|
503
516
|
);
|
|
504
|
-
atomicRearrange(
|
|
517
|
+
zcf.atomicRearrange(harden(transfers));
|
|
505
518
|
|
|
506
519
|
for (const { seat } of depositsForBrand) {
|
|
507
520
|
seat.exit();
|
|
@@ -573,12 +586,11 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
573
586
|
},
|
|
574
587
|
});
|
|
575
588
|
|
|
576
|
-
// eslint-disable-next-line no-use-before-define
|
|
577
589
|
const isActive = () => scheduler.getAuctionState() === AuctionState.ACTIVE;
|
|
578
590
|
|
|
579
591
|
/**
|
|
580
592
|
* @param {ZCFSeat} zcfSeat
|
|
581
|
-
* @param {{ goal: Amount<'nat'>}} offerArgs
|
|
593
|
+
* @param {{ goal: Amount<'nat'> }} offerArgs
|
|
582
594
|
*/
|
|
583
595
|
const depositOfferHandler = (zcfSeat, offerArgs) => {
|
|
584
596
|
const goalMatcher = M.or(undefined, { goal: bidAmountShape });
|
|
@@ -640,7 +652,6 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
640
652
|
);
|
|
641
653
|
},
|
|
642
654
|
getSchedules() {
|
|
643
|
-
// eslint-disable-next-line no-use-before-define
|
|
644
655
|
return scheduler.getSchedule();
|
|
645
656
|
},
|
|
646
657
|
getScheduleUpdates() {
|
|
@@ -678,7 +689,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
678
689
|
const creatorFacet = makeFarGovernorFacet(
|
|
679
690
|
Far('Auctioneer creatorFacet', {
|
|
680
691
|
/**
|
|
681
|
-
* @param {Issuer} issuer
|
|
692
|
+
* @param {Issuer<'nat'>} issuer
|
|
682
693
|
* @param {Keyword} kwd
|
|
683
694
|
*/
|
|
684
695
|
async addBrand(issuer, kwd) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function prepareScaledBidBook(baggage: Baggage): (bidScalingPattern: globalThis.Pattern, collateralBrand: globalThis.Brand) => import("@endo/exo").Guarded<{
|
|
2
|
+
/**
|
|
3
|
+
* @param {ZCFSeat} seat
|
|
4
|
+
* @param {Ratio} bidScaling
|
|
5
|
+
* @param {Amount<'nat'>} wanted
|
|
6
|
+
* @param {boolean} exitAfterBuy
|
|
7
|
+
*/
|
|
8
|
+
add(seat: ZCFSeat, bidScaling: Ratio, wanted: Amount<"nat">, exitAfterBuy: boolean): string;
|
|
9
|
+
/** @param {Ratio} bidScaling */
|
|
10
|
+
offersAbove(bidScaling: Ratio): [string, BidderRecord][];
|
|
11
|
+
hasOrders(): boolean;
|
|
12
|
+
delete(key: any): void;
|
|
13
|
+
updateReceived(key: any, sold: any): void;
|
|
14
|
+
exitAllSeats(): void;
|
|
15
|
+
}>;
|
|
16
|
+
export function preparePriceBook(baggage: Baggage): (priceRatioPattern: globalThis.Pattern, collateralBrand: globalThis.Brand) => import("@endo/exo").Guarded<{
|
|
17
|
+
/**
|
|
18
|
+
* @param {ZCFSeat} seat
|
|
19
|
+
* @param {Ratio} price
|
|
20
|
+
* @param {Amount<'nat'>} wanted
|
|
21
|
+
* @param {boolean} exitAfterBuy
|
|
22
|
+
*/
|
|
23
|
+
add(seat: ZCFSeat, price: Ratio, wanted: Amount<"nat">, exitAfterBuy: boolean): string;
|
|
24
|
+
offersAbove(price: any): [string, BidderRecord][];
|
|
25
|
+
hasOrders(): boolean;
|
|
26
|
+
delete(key: any): void;
|
|
27
|
+
updateReceived(key: any, sold: any): void;
|
|
28
|
+
exitAllSeats(): void;
|
|
29
|
+
}>;
|
|
30
|
+
export type BidderRecord = {
|
|
31
|
+
seat: ZCFSeat;
|
|
32
|
+
wanted: Amount<"nat">;
|
|
33
|
+
seqNum: NatValue;
|
|
34
|
+
received: Amount<"nat">;
|
|
35
|
+
} & {
|
|
36
|
+
exitAfterBuy: boolean;
|
|
37
|
+
} & ({
|
|
38
|
+
bidScaling: Pattern;
|
|
39
|
+
price: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
bidScaling: undefined;
|
|
42
|
+
price: Ratio;
|
|
43
|
+
});
|
|
44
|
+
import type { Baggage } from '@agoric/vat-data';
|
|
45
|
+
//# sourceMappingURL=offerBook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offerBook.d.ts","sourceRoot":"","sources":["offerBook.js"],"names":[],"mappings":"AAkDO,8CAFI,OAAO;IAkBZ;;;;;OAKG;cAJQ,OAAO,cACP,KAAK,UACL,MAAM,CAAC,KAAK,CAAC,gBACb,OAAO;IAsBlB,gCAAgC;4BAApB,KAAK;;;;;GAqCpB;AAcI,0CAFI,OAAO;IAkBZ;;;;;OAKG;cAJQ,OAAO,SACP,KAAK,UACL,MAAM,CAAC,KAAK,CAAC,gBACb,OAAO;;;;;;GA0DrB;2BAnMU;IACR,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;CACzB,GAAG;IAAE,YAAY,EAAE,OAAO,CAAA;CAAE,GAAG,CAC1B;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACzC;IAAE,UAAU,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAC1C;6BApBqB,kBAAkB"}
|
package/src/auction/offerBook.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
toScaledRateOfferKey,
|
|
13
13
|
} from './sortedOffers.js';
|
|
14
14
|
|
|
15
|
-
/** @
|
|
15
|
+
/** @import {Baggage} from '@agoric/vat-data' */
|
|
16
16
|
|
|
17
17
|
// multiple offers might be provided at the same time (since the time
|
|
18
18
|
// granularity is limited to blocks), so we increment a sequenceNumber with each
|
|
@@ -25,12 +25,14 @@ const nextSequenceNumber = () => {
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* @typedef {{
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* } &
|
|
33
|
-
* }
|
|
28
|
+
* seat: ZCFSeat;
|
|
29
|
+
* wanted: Amount<'nat'>;
|
|
30
|
+
* seqNum: NatValue;
|
|
31
|
+
* received: Amount<'nat'>;
|
|
32
|
+
* } & { exitAfterBuy: boolean } & (
|
|
33
|
+
* | { bidScaling: Pattern; price: undefined }
|
|
34
|
+
* | { bidScaling: undefined; price: Ratio }
|
|
35
|
+
* )} BidderRecord
|
|
34
36
|
*/
|
|
35
37
|
|
|
36
38
|
const ScaledBidBookStateShape = harden({
|
|
@@ -41,7 +43,8 @@ const ScaledBidBookStateShape = harden({
|
|
|
41
43
|
|
|
42
44
|
/**
|
|
43
45
|
* Prices in this book are expressed as percentage of the full oracle price
|
|
44
|
-
* snapshot taken when the auction started. .4 is 60% off. 1.1 is 10% above
|
|
46
|
+
* snapshot taken when the auction started. .4 is 60% off. 1.1 is 10% above
|
|
47
|
+
* par.
|
|
45
48
|
*
|
|
46
49
|
* @param {Baggage} baggage
|
|
47
50
|
*/
|
|
@@ -51,7 +54,6 @@ export const prepareScaledBidBook = baggage =>
|
|
|
51
54
|
'scaledBidBook',
|
|
52
55
|
undefined,
|
|
53
56
|
/**
|
|
54
|
-
*
|
|
55
57
|
* @param {Pattern} bidScalingPattern
|
|
56
58
|
* @param {Brand} collateralBrand
|
|
57
59
|
*/
|
|
@@ -134,8 +136,8 @@ const PriceBookStateShape = harden({
|
|
|
134
136
|
});
|
|
135
137
|
|
|
136
138
|
/**
|
|
137
|
-
* Prices in this book are actual prices expressed in terms of bid amount
|
|
138
|
-
*
|
|
139
|
+
* Prices in this book are actual prices expressed in terms of bid amount and
|
|
140
|
+
* collateral amount.
|
|
139
141
|
*
|
|
140
142
|
* @param {Baggage} baggage
|
|
141
143
|
*/
|
|
@@ -145,7 +147,6 @@ export const preparePriceBook = baggage =>
|
|
|
145
147
|
'priceBook',
|
|
146
148
|
undefined,
|
|
147
149
|
/**
|
|
148
|
-
*
|
|
149
150
|
* @param {Pattern} priceRatioPattern
|
|
150
151
|
* @param {Brand} collateralBrand
|
|
151
152
|
*/
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {AsyncSpecTuple} from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
3
|
+
* @import {SyncSpecTuple} from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
4
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
5
|
+
*/
|
|
6
|
+
export const InvitationShape: import("@endo/patterns").Matcher;
|
|
7
|
+
/**
|
|
8
|
+
* In seconds, how often to start an auction. The auction will start at
|
|
9
|
+
* AUCTION_START_DELAY seconds after a multiple of START_FREQUENCY, with the
|
|
10
|
+
* price at STARTING_RATE_BP. Every CLOCK_STEP, the price will be reduced by
|
|
11
|
+
* DISCOUNT_STEP_BP, as long as the rate is at or above LOWEST_RATE_BP, or until
|
|
12
|
+
* START_FREQUENCY has elapsed.
|
|
13
|
+
*/
|
|
14
|
+
export const START_FREQUENCY: "StartFrequency";
|
|
15
|
+
/** in seconds, how often to reduce the price */
|
|
16
|
+
export const CLOCK_STEP: "ClockStep";
|
|
17
|
+
/** discount or markup for starting price in basis points. 9999 = 1bp discount */
|
|
18
|
+
export const STARTING_RATE_BP: "StartingRate";
|
|
19
|
+
/** A limit below which the price will not be discounted. */
|
|
20
|
+
export const LOWEST_RATE_BP: "LowestRate";
|
|
21
|
+
/** amount to reduce prices each time step in bp, as % of the start price */
|
|
22
|
+
export const DISCOUNT_STEP_BP: "DiscountStep";
|
|
23
|
+
/**
|
|
24
|
+
* VaultManagers liquidate vaults at a frequency configured by START_FREQUENCY.
|
|
25
|
+
* Auctions start this long after the hour to give vaults time to finish.
|
|
26
|
+
*/
|
|
27
|
+
export const AUCTION_START_DELAY: "AuctionStartDelay";
|
|
28
|
+
export const PRICE_LOCK_PERIOD: "PriceLockPeriod";
|
|
29
|
+
export const auctioneerParamPattern: import("@endo/patterns").Matcher;
|
|
30
|
+
export namespace auctioneerParamTypes {
|
|
31
|
+
let Electorate: "invitation";
|
|
32
|
+
let StartFrequency: "relativeTime";
|
|
33
|
+
let ClockStep: "relativeTime";
|
|
34
|
+
let StartingRate: "nat";
|
|
35
|
+
let LowestRate: "nat";
|
|
36
|
+
let DiscountStep: "nat";
|
|
37
|
+
let AuctionStartDelay: "relativeTime";
|
|
38
|
+
let PriceLockPeriod: "relativeTime";
|
|
39
|
+
}
|
|
40
|
+
export function makeAuctioneerParams({ ElectorateInvitationAmount, StartFrequency, ClockStep, LowestRate, StartingRate, DiscountStep, AuctionStartDelay, PriceLockPeriod, TimerBrand, }: AuctionParams): {
|
|
41
|
+
Electorate: {
|
|
42
|
+
type: "invitation";
|
|
43
|
+
value: import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>;
|
|
44
|
+
};
|
|
45
|
+
StartFrequency: {
|
|
46
|
+
type: "relativeTime";
|
|
47
|
+
value: import("@agoric/time").RelativeTimeRecord;
|
|
48
|
+
};
|
|
49
|
+
ClockStep: {
|
|
50
|
+
type: "relativeTime";
|
|
51
|
+
value: import("@agoric/time").RelativeTimeRecord;
|
|
52
|
+
};
|
|
53
|
+
AuctionStartDelay: {
|
|
54
|
+
type: "relativeTime";
|
|
55
|
+
value: import("@agoric/time").RelativeTimeRecord;
|
|
56
|
+
};
|
|
57
|
+
PriceLockPeriod: {
|
|
58
|
+
type: "relativeTime";
|
|
59
|
+
value: import("@agoric/time").RelativeTimeRecord;
|
|
60
|
+
};
|
|
61
|
+
StartingRate: {
|
|
62
|
+
type: "nat";
|
|
63
|
+
value: bigint;
|
|
64
|
+
};
|
|
65
|
+
LowestRate: {
|
|
66
|
+
type: "nat";
|
|
67
|
+
value: bigint;
|
|
68
|
+
};
|
|
69
|
+
DiscountStep: {
|
|
70
|
+
type: "nat";
|
|
71
|
+
value: bigint;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export function makeAuctioneerParamManager(publisherKit: import("@agoric/notifier").StoredPublisherKit<GovernanceSubscriptionState>, zcf: ZCF, initial: AuctionParams): import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
75
|
+
Electorate: "invitation";
|
|
76
|
+
StartFrequency: "relativeTime";
|
|
77
|
+
ClockStep: "relativeTime";
|
|
78
|
+
StartingRate: "nat";
|
|
79
|
+
LowestRate: "nat";
|
|
80
|
+
DiscountStep: "nat";
|
|
81
|
+
AuctionStartDelay: "relativeTime";
|
|
82
|
+
PriceLockPeriod: "relativeTime";
|
|
83
|
+
}>;
|
|
84
|
+
export function makeGovernedTerms({ storageNode: _storageNode, marshaller: _marshaller }: {
|
|
85
|
+
storageNode: ERef<StorageNode>;
|
|
86
|
+
marshaller: ERef<Marshaller>;
|
|
87
|
+
}, timer: ERef<import("@agoric/time").TimerService>, priceAuthority: ERef<PriceAuthority>, reservePublicFacet: ERef<AssetReservePublicFacet>, params: AuctionParams): {
|
|
88
|
+
priceAuthority: globalThis.ERef<PriceAuthority>;
|
|
89
|
+
reservePublicFacet: globalThis.ERef<globalThis.GovernedPublicFacet<import("@endo/exo").Guarded<{
|
|
90
|
+
makeAddCollateralInvitation(): Promise<Invitation<string, never>>;
|
|
91
|
+
getPublicTopics(): {
|
|
92
|
+
metrics: import("@agoric/zoe/src/contractSupport").PublicTopic<import("../reserve/assetReserveKit").MetricsNotification>;
|
|
93
|
+
};
|
|
94
|
+
}>>>;
|
|
95
|
+
timerService: globalThis.ERef<import("@agoric/time").TimerService>;
|
|
96
|
+
governedParams: {
|
|
97
|
+
Electorate: {
|
|
98
|
+
type: "invitation";
|
|
99
|
+
value: import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>;
|
|
100
|
+
};
|
|
101
|
+
StartFrequency: {
|
|
102
|
+
type: "relativeTime";
|
|
103
|
+
value: import("@agoric/time").RelativeTimeRecord;
|
|
104
|
+
};
|
|
105
|
+
ClockStep: {
|
|
106
|
+
type: "relativeTime";
|
|
107
|
+
value: import("@agoric/time").RelativeTimeRecord;
|
|
108
|
+
};
|
|
109
|
+
AuctionStartDelay: {
|
|
110
|
+
type: "relativeTime";
|
|
111
|
+
value: import("@agoric/time").RelativeTimeRecord;
|
|
112
|
+
};
|
|
113
|
+
PriceLockPeriod: {
|
|
114
|
+
type: "relativeTime";
|
|
115
|
+
value: import("@agoric/time").RelativeTimeRecord;
|
|
116
|
+
};
|
|
117
|
+
StartingRate: {
|
|
118
|
+
type: "nat";
|
|
119
|
+
value: bigint;
|
|
120
|
+
};
|
|
121
|
+
LowestRate: {
|
|
122
|
+
type: "nat";
|
|
123
|
+
value: bigint;
|
|
124
|
+
};
|
|
125
|
+
DiscountStep: {
|
|
126
|
+
type: "nat";
|
|
127
|
+
value: bigint;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
export type AuctionParams = {
|
|
132
|
+
ElectorateInvitationAmount: Amount<"set">;
|
|
133
|
+
StartFrequency: RelativeTime;
|
|
134
|
+
ClockStep: RelativeTime;
|
|
135
|
+
StartingRate: bigint;
|
|
136
|
+
LowestRate: bigint;
|
|
137
|
+
DiscountStep: bigint;
|
|
138
|
+
AuctionStartDelay: RelativeTime;
|
|
139
|
+
PriceLockPeriod: RelativeTime;
|
|
140
|
+
TimerBrand: import("@agoric/time").TimerBrand;
|
|
141
|
+
};
|
|
142
|
+
export type AuctionParamManager = ReturnType<typeof makeAuctioneerParamManager>;
|
|
143
|
+
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
144
|
+
//# sourceMappingURL=params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["params.js"],"names":[],"mappings":"AAQA;;;;GAIG;AAGH,+DAAyD;AAEzD;;;;;;GAMG;AACH,+CAAgD;AAChD,gDAAgD;AAChD,qCAAsC;AACtC,iFAAiF;AACjF,8CAA+C;AAC/C,4DAA4D;AAC5D,0CAA2C;AAC3C,4EAA4E;AAC5E,8CAA+C;AAC/C;;;GAGG;AACH,sDAAuD;AAIvD,kDAAmD;AAEnD,sEASG;;;;;;;;;;;AA2BI,yLADK,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCxB;AAQM,yDAJI,OAAO,kBAAkB,EAAE,kBAAkB,CAAC,2BAA2B,CAAC,OAC1E,GAAG,WACH,aAAa;;;;;;;;;GA0BvB;AAUM,0FANI;IAAE,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;CAAE,SAChE,IAAI,CAAC,OAAO,cAAc,EAAE,YAAY,CAAC,kBACzC,IAAI,CAAC,cAAc,CAAC,sBACpB,IAAI,CAAC,uBAAuB,CAAC,UAC7B,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBvB;;gCAxGa,MAAM,CAAC,KAAK,CAAC;oBACb,YAAY;eACZ,YAAY;kBACZ,MAAM;gBACN,MAAM;kBACN,MAAM;uBACN,YAAY;qBACZ,YAAY;gBACZ,OAAO,cAAc,EAAE,UAAU;;kCAmGjC,UAAU,CAAC,OAAO,0BAA0B,CAAC;oCAnKkC,4BAA4B"}
|
package/src/auction/params.js
CHANGED
|
@@ -6,14 +6,17 @@ import {
|
|
|
6
6
|
import { TimeMath, RelativeTimeRecordShape } from '@agoric/time';
|
|
7
7
|
import { M } from '@agoric/store';
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @import {AsyncSpecTuple} from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
11
|
+
* @import {SyncSpecTuple} from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
12
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
13
|
+
*/
|
|
11
14
|
|
|
12
15
|
// TODO duplicated with zoe/src/TypeGuards.js
|
|
13
16
|
export const InvitationShape = M.remotable('Invitation');
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
|
-
* In seconds, how often to start an auction.
|
|
19
|
+
* In seconds, how often to start an auction. The auction will start at
|
|
17
20
|
* AUCTION_START_DELAY seconds after a multiple of START_FREQUENCY, with the
|
|
18
21
|
* price at STARTING_RATE_BP. Every CLOCK_STEP, the price will be reduced by
|
|
19
22
|
* DISCOUNT_STEP_BP, as long as the rate is at or above LOWEST_RATE_BP, or until
|
|
@@ -70,12 +73,10 @@ export const auctioneerParamTypes = harden({
|
|
|
70
73
|
* @property {bigint} DiscountStep
|
|
71
74
|
* @property {RelativeTime} AuctionStartDelay
|
|
72
75
|
* @property {RelativeTime} PriceLockPeriod
|
|
73
|
-
* @property {import('@agoric/time
|
|
76
|
+
* @property {import('@agoric/time').TimerBrand} TimerBrand
|
|
74
77
|
*/
|
|
75
78
|
|
|
76
|
-
/**
|
|
77
|
-
* @param {AuctionParams} initial
|
|
78
|
-
*/
|
|
79
|
+
/** @param {AuctionParams} initial */
|
|
79
80
|
export const makeAuctioneerParams = ({
|
|
80
81
|
ElectorateInvitationAmount,
|
|
81
82
|
StartFrequency,
|
|
@@ -148,8 +149,8 @@ export const makeAuctioneerParamManager = (publisherKit, zcf, initial) => {
|
|
|
148
149
|
harden(makeAuctioneerParamManager);
|
|
149
150
|
|
|
150
151
|
/**
|
|
151
|
-
* @param {{storageNode: ERef<StorageNode
|
|
152
|
-
* @param {ERef<
|
|
152
|
+
* @param {{ storageNode: ERef<StorageNode>; marshaller: ERef<Marshaller> }} caps
|
|
153
|
+
* @param {ERef<import('@agoric/time').TimerService>} timer
|
|
153
154
|
* @param {ERef<PriceAuthority>} priceAuthority
|
|
154
155
|
* @param {ERef<AssetReservePublicFacet>} reservePublicFacet
|
|
155
156
|
* @param {AuctionParams} params
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function computeRoundTiming(params: Awaited<import("./params.js").AuctionParamManager>, baseTime: TimestampRecord): import("./scheduler.js").Schedule;
|
|
2
|
+
export function nextDescendingStepTime(liveSchedule: import("./scheduler.js").Schedule | null, nextSchedule: import("./scheduler.js").Schedule | null, now: Timestamp): Timestamp | null;
|
|
3
|
+
export function timeVsSchedule(time: Timestamp, schedule: import("./scheduler.js").Schedule): "before" | "during" | "endExactly" | "after";
|
|
4
|
+
import type { TimestampRecord } from '@agoric/time';
|
|
5
|
+
//# sourceMappingURL=scheduleMath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduleMath.d.ts","sourceRoot":"","sources":["scheduleMath.js"],"names":[],"mappings":"AA0CO,2CAJI,OAAO,CAAC,OAAO,aAAa,EAAE,mBAAmB,CAAC,YAClD,eAAe,GACb,OAAO,gBAAgB,EAAE,QAAQ,CAqE7C;AAcM,qDALI,OAAO,gBAAgB,EAAE,QAAQ,GAAG,IAAI,gBACxC,OAAO,gBAAgB,EAAE,QAAQ,GAAG,IAAI,OACxC,SAAS,GACP,SAAS,GAAG,IAAI,CAuB5B;AAQM,qCAJI,SAAS,YACT,OAAO,gBAAgB,EAAE,QAAQ,GAC/B,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,CAiBxD;qCAhKkC,cAAc"}
|