@agoric/inter-protocol 0.16.2-dev-6ad0038.0.6ad0038 → 0.16.2-dev-b95c1c8.0.b95c1c8
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/package.json +16 -16
- package/src/index.js +1 -0
- package/src/proposals/addAssetToVault.js +3 -97
- package/src/proposals/committee-proposal.js +3 -9
- package/src/proposals/core-proposal.js +1 -32
- package/src/proposals/econ-behaviors.js +1 -140
- package/src/vaultFactory/params.d.ts.map +1 -1
- package/src/vaultFactory/params.js +1 -0
- package/src/vaultFactory/types-ambient.d.ts +0 -2
- package/src/vaultFactory/types-ambient.d.ts.map +1 -1
- package/src/vaultFactory/types-ambient.js +0 -3
- package/src/vaultFactory/vaultDirector.d.ts +5 -40
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
- package/src/vaultFactory/vaultDirector.js +3 -58
- package/src/vaultFactory/vaultFactory.d.ts +4 -22
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
- package/src/vaultFactory/vaultFactory.js +2 -9
- package/src/vaultFactory/vaultManager.d.ts +2 -180
- package/src/vaultFactory/vaultManager.d.ts.map +1 -1
- package/src/vaultFactory/vaultManager.js +3 -300
- package/src/auction/auctionBook.d.ts +0 -150
- package/src/auction/auctionBook.d.ts.map +0 -1
- package/src/auction/auctionBook.js +0 -796
- package/src/auction/auctionMath.d.ts +0 -18
- package/src/auction/auctionMath.d.ts.map +0 -1
- package/src/auction/auctionMath.js +0 -82
- package/src/auction/auctioneer.d.ts +0 -76
- package/src/auction/auctioneer.d.ts.map +0 -1
- package/src/auction/auctioneer.js +0 -745
- package/src/auction/offerBook.d.ts +0 -47
- package/src/auction/offerBook.d.ts.map +0 -1
- package/src/auction/offerBook.js +0 -227
- package/src/auction/params.d.ts +0 -156
- package/src/auction/params.d.ts.map +0 -1
- package/src/auction/params.js +0 -184
- package/src/auction/scheduleMath.d.ts +0 -8
- package/src/auction/scheduleMath.d.ts.map +0 -1
- package/src/auction/scheduleMath.js +0 -174
- package/src/auction/scheduler.d.ts +0 -57
- package/src/auction/scheduler.d.ts.map +0 -1
- package/src/auction/scheduler.js +0 -391
- package/src/auction/sortedOffers.d.ts +0 -9
- package/src/auction/sortedOffers.d.ts.map +0 -1
- package/src/auction/sortedOffers.js +0 -141
- package/src/proposals/add-auction.js +0 -290
- package/src/proposals/upgrade-vaults.js +0 -212
- package/src/vaultFactory/liquidation.d.ts +0 -29
- package/src/vaultFactory/liquidation.d.ts.map +0 -1
- package/src/vaultFactory/liquidation.js +0 -313
- package/src/vaultFactory/proceeds.d.ts +0 -36
- package/src/vaultFactory/proceeds.d.ts.map +0 -1
- package/src/vaultFactory/proceeds.js +0 -285
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export function amountsToSettle({ bidAlloc, collateralWanted, collateralAvailable, curAuctionPrice, remainingProceedsGoal, }: {
|
|
2
|
-
bidAlloc: Amount<"nat">;
|
|
3
|
-
collateralWanted: Amount<"nat">;
|
|
4
|
-
collateralAvailable: Amount<"nat">;
|
|
5
|
-
curAuctionPrice: Ratio;
|
|
6
|
-
remainingProceedsGoal: Amount<"nat"> | null;
|
|
7
|
-
}, log?: (...msgs: any[]) => void): {
|
|
8
|
-
proceedsExpected: null;
|
|
9
|
-
proceedsTarget?: undefined;
|
|
10
|
-
collateralTarget?: undefined;
|
|
11
|
-
} | {
|
|
12
|
-
proceedsExpected: import("@agoric/ertp").NatAmount;
|
|
13
|
-
proceedsTarget: import("@agoric/ertp").NatAmount;
|
|
14
|
-
collateralTarget: import("@agoric/ertp").NatAmount;
|
|
15
|
-
};
|
|
16
|
-
import type { Amount } from '@agoric/ertp/src/types.js';
|
|
17
|
-
import type { Ratio } from '@agoric/ertp/src/ratio.js';
|
|
18
|
-
//# sourceMappingURL=auctionMath.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auctionMath.d.ts","sourceRoot":"","sources":["auctionMath.js"],"names":[],"mappings":"AAqBO,8HARJ;IAAyB,QAAQ,EAAzB,OAAO,KAAK,CAAC;IACI,gBAAgB,EAAjC,OAAO,KAAK,CAAC;IACI,mBAAmB,EAApC,OAAO,KAAK,CAAC;IACJ,eAAe,EAAxB,KAAK;IACmB,qBAAqB,EAA7C,OAAO,KAAK,CAAC,GAAG,IAAI;CAE5B,QAAQ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI;;;;;;;;EA6DlC;4BAzEwB,2BAA2B;2BAC5B,2BAA2B"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { AmountMath } from '@agoric/ertp';
|
|
2
|
-
import {
|
|
3
|
-
ceilMultiplyBy,
|
|
4
|
-
floorDivideBy,
|
|
5
|
-
} from '@agoric/zoe/src/contractSupport/index.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @import {Amount} from '@agoric/ertp/src/types.js';
|
|
9
|
-
* @import {Ratio} from '@agoric/ertp/src/ratio.js';
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @param {object} p
|
|
14
|
-
* @param {Amount<'nat'>} p.bidAlloc current allocation of the bidding seat
|
|
15
|
-
* @param {Amount<'nat'>} p.collateralWanted want of the offer
|
|
16
|
-
* @param {Amount<'nat'>} p.collateralAvailable available to auction
|
|
17
|
-
* @param {Ratio} p.curAuctionPrice current auction price
|
|
18
|
-
* @param {Amount<'nat'> | null} p.remainingProceedsGoal amount still needing
|
|
19
|
-
* liquidating over multiple rounds; null indicates no limit
|
|
20
|
-
* @param {(...msgs: any[]) => void} [log]
|
|
21
|
-
*/
|
|
22
|
-
export const amountsToSettle = (
|
|
23
|
-
{
|
|
24
|
-
bidAlloc,
|
|
25
|
-
collateralWanted,
|
|
26
|
-
collateralAvailable,
|
|
27
|
-
curAuctionPrice,
|
|
28
|
-
remainingProceedsGoal,
|
|
29
|
-
},
|
|
30
|
-
log = () => {},
|
|
31
|
-
) => {
|
|
32
|
-
log('amountsToSettle', {
|
|
33
|
-
bidAlloc,
|
|
34
|
-
collateralWanted,
|
|
35
|
-
collateralAvailable,
|
|
36
|
-
curAuctionPrice,
|
|
37
|
-
remainingProceedsGoal,
|
|
38
|
-
});
|
|
39
|
-
const initialCollateralTarget = AmountMath.min(
|
|
40
|
-
collateralWanted,
|
|
41
|
-
collateralAvailable,
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const proceedsExpected = ceilMultiplyBy(
|
|
45
|
-
initialCollateralTarget,
|
|
46
|
-
curAuctionPrice,
|
|
47
|
-
);
|
|
48
|
-
if (AmountMath.isEmpty(proceedsExpected)) {
|
|
49
|
-
return { proceedsExpected: null };
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const targetByProceeds = proceedsLimit =>
|
|
53
|
-
AmountMath.min(
|
|
54
|
-
collateralAvailable,
|
|
55
|
-
floorDivideBy(proceedsLimit, curAuctionPrice),
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
const [proceedsTarget, collateralTarget] = (() => {
|
|
59
|
-
// proceeds cannot exceed what is needed or being offered
|
|
60
|
-
const proceedsBidded = AmountMath.min(proceedsExpected, bidAlloc);
|
|
61
|
-
if (remainingProceedsGoal) {
|
|
62
|
-
const goalProceeds = AmountMath.min(
|
|
63
|
-
remainingProceedsGoal,
|
|
64
|
-
proceedsBidded,
|
|
65
|
-
);
|
|
66
|
-
return [goalProceeds, targetByProceeds(goalProceeds)];
|
|
67
|
-
} else if (AmountMath.isGTE(proceedsBidded, proceedsExpected)) {
|
|
68
|
-
// initial collateral suffices
|
|
69
|
-
return [proceedsBidded, initialCollateralTarget];
|
|
70
|
-
} else {
|
|
71
|
-
return [proceedsBidded, targetByProceeds(proceedsBidded)];
|
|
72
|
-
}
|
|
73
|
-
})();
|
|
74
|
-
|
|
75
|
-
assert(
|
|
76
|
-
AmountMath.isGTE(collateralAvailable, collateralTarget),
|
|
77
|
-
'target cannot exceed available',
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
return { proceedsExpected, proceedsTarget, collateralTarget };
|
|
81
|
-
};
|
|
82
|
-
harden(amountsToSettle);
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
export function distributeProportionalSharesWithLimits(unsoldCollateral: Amount<"nat">, proceeds: Amount<"nat">, deposits: {
|
|
2
|
-
seat: ZCFSeat;
|
|
3
|
-
amount: Amount<"nat">;
|
|
4
|
-
goal: Amount<"nat">;
|
|
5
|
-
}[], collateralSeat: ZCFSeat, bidHoldingSeat: ZCFSeat, collateralKeyword: string, reserveSeat: ZCFSeat, brand: Brand): globalThis.TransferPart[];
|
|
6
|
-
export function start(zcf: ZCF<GovernanceTerms<typeof auctioneerParamTypes> & {
|
|
7
|
-
timerService: TimerService;
|
|
8
|
-
reservePublicFacet: AssetReservePublicFacet;
|
|
9
|
-
priceAuthority: PriceAuthority;
|
|
10
|
-
}>, privateArgs: {
|
|
11
|
-
initialPoserInvitation: Invitation;
|
|
12
|
-
storageNode: Remote<StorageNode>;
|
|
13
|
-
marshaller: Remote<Marshaller>;
|
|
14
|
-
}, baggage: Baggage): Promise<{
|
|
15
|
-
publicFacet: globalThis.GovernedPublicFacet<{
|
|
16
|
-
getElectorate: () => import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>;
|
|
17
|
-
getStartFrequency: () => import("@agoric/time").RelativeTime;
|
|
18
|
-
getClockStep: () => import("@agoric/time").RelativeTime;
|
|
19
|
-
getStartingRate: () => bigint;
|
|
20
|
-
getLowestRate: () => bigint;
|
|
21
|
-
getDiscountStep: () => bigint;
|
|
22
|
-
getAuctionStartDelay: () => import("@agoric/time").RelativeTime;
|
|
23
|
-
getPriceLockPeriod: () => import("@agoric/time").RelativeTime;
|
|
24
|
-
/** @param {Brand<'nat'>} collateralBrand */
|
|
25
|
-
makeBidInvitation(collateralBrand: Brand<"nat">): Promise<globalThis.Invitation<string, OfferSpec>>;
|
|
26
|
-
getSchedules(): {
|
|
27
|
-
liveAuctionSchedule: import("./scheduler.js").Schedule | null;
|
|
28
|
-
nextAuctionSchedule: import("./scheduler.js").Schedule | null;
|
|
29
|
-
};
|
|
30
|
-
getScheduleUpdates(): globalThis.Subscriber<ScheduleNotification>;
|
|
31
|
-
getBookDataUpdates(brand: any): globalThis.Subscriber<import("./auctionBook.js").BookDataNotification>;
|
|
32
|
-
getPublicTopics(brand: any): {
|
|
33
|
-
bookData: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("./auctionBook.js").BookDataNotification>;
|
|
34
|
-
} | {
|
|
35
|
-
schedule: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<ScheduleNotification>;
|
|
36
|
-
};
|
|
37
|
-
makeDepositInvitation: () => Promise<globalThis.Invitation<string, {
|
|
38
|
-
goal: Amount<"nat">;
|
|
39
|
-
}>>;
|
|
40
|
-
}>;
|
|
41
|
-
creatorFacet: globalThis.GovernedCreatorFacet<{
|
|
42
|
-
/**
|
|
43
|
-
* @param {Issuer<'nat'>} issuer
|
|
44
|
-
* @param {Keyword} kwd
|
|
45
|
-
*/
|
|
46
|
-
addBrand(issuer: Issuer<"nat">, kwd: Keyword): Promise<void>;
|
|
47
|
-
/** @returns {Promise<FullSchedule>} */
|
|
48
|
-
getSchedule(): Promise<FullSchedule>;
|
|
49
|
-
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
50
|
-
/**
|
|
51
|
-
* @param {Issuer<'nat'>} issuer
|
|
52
|
-
* @param {Keyword} kwd
|
|
53
|
-
*/
|
|
54
|
-
addBrand(issuer: Issuer<"nat">, kwd: Keyword): Promise<void>;
|
|
55
|
-
/** @returns {Promise<FullSchedule>} */
|
|
56
|
-
getSchedule(): Promise<FullSchedule>;
|
|
57
|
-
}>>;
|
|
58
|
-
}>;
|
|
59
|
-
/** @typedef {ContractOf<typeof start>} AuctioneerContract */
|
|
60
|
-
/** @typedef {AuctioneerContract['publicFacet']} AuctioneerPublicFacet */
|
|
61
|
-
/** @typedef {AuctioneerContract['creatorFacet']} AuctioneerCreatorFacet */
|
|
62
|
-
export const AuctionPFShape: import("@endo/patterns").Matcher;
|
|
63
|
-
export type AuctioneerContract = ContractOf<typeof start>;
|
|
64
|
-
export type AuctioneerPublicFacet = AuctioneerContract["publicFacet"];
|
|
65
|
-
export type AuctioneerCreatorFacet = AuctioneerContract["creatorFacet"];
|
|
66
|
-
import { auctioneerParamTypes } from './params.js';
|
|
67
|
-
import type { TimerService } from '@agoric/time';
|
|
68
|
-
import type { AssetReservePublicFacet } from '../reserve/assetReserve.js';
|
|
69
|
-
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
70
|
-
import type { Remote } from '@agoric/internal';
|
|
71
|
-
import type { Baggage } from '@agoric/vat-data';
|
|
72
|
-
import type { OfferSpec } from './auctionBook.js';
|
|
73
|
-
import type { ScheduleNotification } from './scheduler.js';
|
|
74
|
-
import type { FullSchedule } from './scheduler.js';
|
|
75
|
-
import type { ContractOf } from '@agoric/zoe/src/zoeService/utils.js';
|
|
76
|
-
//# sourceMappingURL=auctioneer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auctioneer.d.ts","sourceRoot":"","sources":["auctioneer.js"],"names":[],"mappings":"AA2LO,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,6BAgNf;AAiBM,2BAdI,GAAG,CACT,eAAe,CAAC,OAAO,oBAAoB,CAAC,GAAG;IAC7C,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,cAAc,EAAE,cAAc,CAAC;CAChC,CACF,eACO;IACN,sBAAsB,EAAE,UAAU,CAAC;IACnC,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;IACjC,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;CAChC,WACO,OAAO;;;;;;;;;;QAyOZ,4CAA4C;2CAAhC,KAAK,CAAC,KAAK,CAAC;;;;;;;;;;;;;kBApCT,MAAM,CAAC,KAAK,CAAC;;;;QAkG5B;;;WAGG;yBAFQ,MAAM,CAAC,KAAK,CAAC,OACb,OAAO;QAyBlB,uCAAuC;uBAAzB,OAAO,CAAC,YAAY,CAAC;;QA3BnC;;;WAGG;yBAFQ,MAAM,CAAC,KAAK,CAAC,OACb,OAAO;QAyBlB,uCAAuC;uBAAzB,OAAO,CAAC,YAAY,CAAC;;GAQxC;AAED,6DAA6D;AAC7D,yEAAyE;AACzE,2EAA2E;AAE3E,8DAAkE;iCAJpD,WAAW,OAAO,KAAK,CAAC;oCACxB,kBAAkB,CAAC,aAAa,CAAC;qCACjC,kBAAkB,CAAC,cAAc,CAAC;qCArsBX,aAAa;kCAUnB,cAAc;6CAKH,4BAA4B;oCANuB,4BAA4B;4BAJlF,kBAAkB;6BAE/B,kBAAkB;+BAMhB,kBAAkB;0CADP,gBAAgB;kCAExB,gBAAgB;gCANlB,qCAAqC"}
|