@agoric/inter-protocol 0.18.0-u23.0 → 0.18.0-u23.1
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 +13 -13
- package/src/auction/util.d.ts +33 -0
- package/src/auction/util.d.ts.map +1 -0
- package/src/clientSupport.d.ts +124 -0
- package/src/clientSupport.d.ts.map +1 -0
- package/src/collectFees.d.ts +6 -0
- package/src/collectFees.d.ts.map +1 -0
- package/src/contractSupport.d.ts +36 -0
- package/src/contractSupport.d.ts.map +1 -0
- package/src/econCommitteeCharter.d.ts +54 -0
- package/src/econCommitteeCharter.d.ts.map +1 -0
- package/src/feeDistributor.d.ts +228 -0
- package/src/feeDistributor.d.ts.map +1 -0
- package/src/index.d.ts +2 -0
- package/src/index.d.ts.map +1 -0
- package/src/interest-math.d.ts +5 -0
- package/src/interest-math.d.ts.map +1 -0
- package/src/interest.d.ts +42 -0
- package/src/interest.d.ts.map +1 -0
- package/src/price/fluxAggregatorContract.d.ts +95 -0
- package/src/price/fluxAggregatorContract.d.ts.map +1 -0
- package/src/price/fluxAggregatorKit.d.ts +114 -0
- package/src/price/fluxAggregatorKit.d.ts.map +1 -0
- package/src/price/priceOracleKit.d.ts +41 -0
- package/src/price/priceOracleKit.d.ts.map +1 -0
- package/src/price/roundsManager.d.ts +211 -0
- package/src/price/roundsManager.d.ts.map +1 -0
- package/src/proposals/utils.d.ts +27 -0
- package/src/proposals/utils.d.ts.map +1 -0
- package/src/provisionPool.d.ts +87 -0
- package/src/provisionPool.d.ts.map +1 -0
- package/src/provisionPoolKit.d.ts +81 -0
- package/src/provisionPoolKit.d.ts.map +1 -0
- package/src/psm/psm.d.ts +145 -0
- package/src/psm/psm.d.ts.map +1 -0
- package/src/reserve/assetReserve.d.ts +68 -0
- package/src/reserve/assetReserve.d.ts.map +1 -0
- package/src/reserve/assetReserveKit.d.ts +106 -0
- package/src/reserve/assetReserveKit.d.ts.map +1 -0
- package/src/reserve/params.d.ts +16 -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/vaultFactory/burn.d.ts +5 -0
- package/src/vaultFactory/burn.d.ts.map +1 -0
- package/src/vaultFactory/math.d.ts +13 -0
- package/src/vaultFactory/math.d.ts.map +1 -0
- package/src/vaultFactory/orderedVaultStore.d.ts +94 -0
- package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -0
- package/src/vaultFactory/params.d.ts +170 -0
- package/src/vaultFactory/params.d.ts.map +1 -0
- package/src/vaultFactory/prioritizedVaults.d.ts +283 -0
- package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -0
- package/src/vaultFactory/storeUtils.d.ts +30 -0
- package/src/vaultFactory/storeUtils.d.ts.map +1 -0
- package/src/vaultFactory/types.d.ts +137 -0
- package/src/vaultFactory/types.d.ts.map +1 -0
- package/src/vaultFactory/vault.d.ts +360 -0
- package/src/vaultFactory/vault.d.ts.map +1 -0
- package/src/vaultFactory/vaultDirector.d.ts +337 -0
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -0
- package/src/vaultFactory/vaultFactory.d.ts +202 -0
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -0
- package/src/vaultFactory/vaultHolder.d.ts +177 -0
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -0
- package/src/vaultFactory/vaultKit.d.ts +38 -0
- package/src/vaultFactory/vaultKit.d.ts.map +1 -0
- package/src/vaultFactory/vaultManager.d.ts +526 -0
- package/src/vaultFactory/vaultManager.d.ts.map +1 -0
- package/src/c.log +0 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {ERemote, Remote} from '@agoric/internal';
|
|
3
|
+
* @import {EMarshaller} from '@agoric/internal/src/marshal/wrap-marshaller.js';
|
|
4
|
+
* @import {MapStore} from '@agoric/store';
|
|
5
|
+
* @import {PriceAuthority} from '@agoric/zoe/tools/types.js';
|
|
6
|
+
* @import {ParamTypesMapFromRecord} from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
7
|
+
* @import {StoredPublisherKit} from '@agoric/notifier';
|
|
8
|
+
* @import {TimerService} from '@agoric/time';
|
|
9
|
+
* @import {Baggage} from '@agoric/vat-data';
|
|
10
|
+
* @import {Amount, Brand, Ratio} from '@agoric/ertp';
|
|
11
|
+
* @import {AssetReservePublicFacet} from '../reserve/assetReserve.js';
|
|
12
|
+
* @import {InterestTiming, VaultManagerParamValues} from './types.js';
|
|
13
|
+
* @import {GovernanceSubscriptionState} from '@agoric/governance/src/types.js';
|
|
14
|
+
* @import {StorageNode} from '@agoric/internal/src/lib-chainStorage.js';
|
|
15
|
+
* @import {ERef} from '@agoric/vow';
|
|
16
|
+
*/
|
|
17
|
+
export const CHARGING_PERIOD_KEY: "ChargingPeriod";
|
|
18
|
+
export const RECORDING_PERIOD_KEY: "RecordingPeriod";
|
|
19
|
+
export const DEBT_LIMIT_KEY: "DebtLimit";
|
|
20
|
+
export const LIQUIDATION_MARGIN_KEY: "LiquidationMargin";
|
|
21
|
+
export const LIQUIDATION_PADDING_KEY: "LiquidationPadding";
|
|
22
|
+
export const LIQUIDATION_PENALTY_KEY: "LiquidationPenalty";
|
|
23
|
+
export const INTEREST_RATE_KEY: "InterestRate";
|
|
24
|
+
export const MINT_FEE_KEY: "MintFee";
|
|
25
|
+
export const MIN_INITIAL_DEBT_KEY: "MinInitialDebt";
|
|
26
|
+
export const SHORTFALL_INVITATION_KEY: "ShortfallInvitation";
|
|
27
|
+
export const REFERENCED_UI_KEY: "ReferencedUI";
|
|
28
|
+
export namespace vaultDirectorParamTypes {
|
|
29
|
+
let MinInitialDebt: "amount";
|
|
30
|
+
let ChargingPeriod: "nat";
|
|
31
|
+
let RecordingPeriod: "nat";
|
|
32
|
+
let ReferencedUI: "string";
|
|
33
|
+
}
|
|
34
|
+
export function makeVaultParamManager(publisherKit: StoredPublisherKit<GovernanceSubscriptionState>, { debtLimit, interestRate, liquidationMargin, liquidationPadding, liquidationPenalty, mintFee, }: VaultManagerParamValues): import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
35
|
+
DebtLimit: "amount";
|
|
36
|
+
InterestRate: "ratio";
|
|
37
|
+
LiquidationPadding: "ratio";
|
|
38
|
+
LiquidationMargin: "ratio";
|
|
39
|
+
LiquidationPenalty: "ratio";
|
|
40
|
+
MintFee: "ratio";
|
|
41
|
+
}>;
|
|
42
|
+
/** @typedef {ReturnType<typeof makeVaultParamManager>} VaultParamManager */
|
|
43
|
+
export const vaultParamPattern: import("@endo/patterns").Matcher;
|
|
44
|
+
export function makeGovernedTerms({ bootstrapPaymentValue, electorateInvitationAmount, interestTiming, minInitialDebt, priceAuthority, reservePublicFacet, timer, shortfallInvitationAmount, referencedUi, }: {
|
|
45
|
+
electorateInvitationAmount: Amount<"set">;
|
|
46
|
+
minInitialDebt: Amount<"nat">;
|
|
47
|
+
bootstrapPaymentValue: bigint;
|
|
48
|
+
priceAuthority: ERef<PriceAuthority>;
|
|
49
|
+
timer: ERef<TimerService>;
|
|
50
|
+
reservePublicFacet: AssetReservePublicFacet;
|
|
51
|
+
interestTiming: InterestTiming;
|
|
52
|
+
shortfallInvitationAmount: Amount<"set">;
|
|
53
|
+
referencedUi?: string;
|
|
54
|
+
}): {
|
|
55
|
+
priceAuthority: ERef<PriceAuthority>;
|
|
56
|
+
reservePublicFacet: import("@agoric/governance").GovernedPublicFacet<import("@endo/exo").Guarded<{
|
|
57
|
+
makeAddCollateralInvitation(): Promise<import("@agoric/zoe").Invitation<string, never>>;
|
|
58
|
+
getPublicTopics(): {
|
|
59
|
+
metrics: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("../reserve/assetReserveKit.js").MetricsNotification>;
|
|
60
|
+
};
|
|
61
|
+
}>>;
|
|
62
|
+
timerService: ERef<TimerService>;
|
|
63
|
+
governedParams: {
|
|
64
|
+
Electorate: {
|
|
65
|
+
type: "invitation";
|
|
66
|
+
value: import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>;
|
|
67
|
+
};
|
|
68
|
+
MinInitialDebt: {
|
|
69
|
+
type: "amount";
|
|
70
|
+
value: import("@agoric/ertp").NatAmount;
|
|
71
|
+
};
|
|
72
|
+
ShortfallInvitation: {
|
|
73
|
+
type: "invitation";
|
|
74
|
+
value: import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>;
|
|
75
|
+
};
|
|
76
|
+
ReferencedUI: {
|
|
77
|
+
type: "string";
|
|
78
|
+
value: string;
|
|
79
|
+
};
|
|
80
|
+
ChargingPeriod: {
|
|
81
|
+
type: "nat";
|
|
82
|
+
value: bigint;
|
|
83
|
+
};
|
|
84
|
+
RecordingPeriod: {
|
|
85
|
+
type: "nat";
|
|
86
|
+
value: bigint;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
bootstrapPaymentValue: bigint;
|
|
90
|
+
};
|
|
91
|
+
export function provideVaultParamManagers(baggage: Baggage, marshaller: ERemote<EMarshaller>, managerParamOverrides: Record<string, VaultManagerParamOverrides>): {
|
|
92
|
+
/**
|
|
93
|
+
* @param {Brand} brand
|
|
94
|
+
* @param {Remote<StorageNode>} storageNode
|
|
95
|
+
* @param {VaultManagerParamValues} initialParamValues
|
|
96
|
+
*/
|
|
97
|
+
addParamManager(brand: Brand, storageNode: Remote<StorageNode>, initialParamValues: VaultManagerParamValues): import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
98
|
+
DebtLimit: "amount";
|
|
99
|
+
InterestRate: "ratio";
|
|
100
|
+
LiquidationPadding: "ratio";
|
|
101
|
+
LiquidationMargin: "ratio";
|
|
102
|
+
LiquidationPenalty: "ratio";
|
|
103
|
+
MintFee: "ratio";
|
|
104
|
+
}>;
|
|
105
|
+
/** @param {Brand} brand */
|
|
106
|
+
get(brand: Brand): import("@agoric/governance/src/contractGovernance/typedParamManager.js").TypedParamManager<{
|
|
107
|
+
DebtLimit: "amount";
|
|
108
|
+
InterestRate: "ratio";
|
|
109
|
+
LiquidationPadding: "ratio";
|
|
110
|
+
LiquidationMargin: "ratio";
|
|
111
|
+
LiquidationPenalty: "ratio";
|
|
112
|
+
MintFee: "ratio";
|
|
113
|
+
}>;
|
|
114
|
+
};
|
|
115
|
+
export type VaultDirectorParams = ParamTypesMapFromRecord<ReturnType<typeof makeVaultDirectorParams>>;
|
|
116
|
+
export type VaultParamManager = ReturnType<typeof makeVaultParamManager>;
|
|
117
|
+
export type VaultManagerParamOverrides = VaultManagerParamValues & {
|
|
118
|
+
brand: Brand;
|
|
119
|
+
};
|
|
120
|
+
import type { GovernanceSubscriptionState } from '@agoric/governance/src/types.js';
|
|
121
|
+
import type { StoredPublisherKit } from '@agoric/notifier';
|
|
122
|
+
import type { VaultManagerParamValues } from './types.js';
|
|
123
|
+
import type { Amount } from '@agoric/ertp';
|
|
124
|
+
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
125
|
+
import type { ERef } from '@agoric/vow';
|
|
126
|
+
import type { TimerService } from '@agoric/time';
|
|
127
|
+
import type { AssetReservePublicFacet } from '../reserve/assetReserve.js';
|
|
128
|
+
import type { InterestTiming } from './types.js';
|
|
129
|
+
import type { Baggage } from '@agoric/vat-data';
|
|
130
|
+
import type { EMarshaller } from '@agoric/internal/src/marshal/wrap-marshaller.js';
|
|
131
|
+
import type { ERemote } from '@agoric/internal';
|
|
132
|
+
import type { Brand } from '@agoric/ertp';
|
|
133
|
+
import type { StorageNode } from '@agoric/internal/src/lib-chainStorage.js';
|
|
134
|
+
import type { Remote } from '@agoric/internal';
|
|
135
|
+
/**
|
|
136
|
+
* @param {Amount<'set'>} electorateInvitationAmount
|
|
137
|
+
* @param {Amount<'nat'>} minInitialDebt
|
|
138
|
+
* @param {Amount<'set'>} shortfallInvitationAmount
|
|
139
|
+
* @param {string} referencedUi
|
|
140
|
+
* @param {InterestTiming} interestTiming
|
|
141
|
+
*/
|
|
142
|
+
declare function makeVaultDirectorParams(electorateInvitationAmount: Amount<"set">, minInitialDebt: Amount<"nat">, shortfallInvitationAmount: Amount<"set">, referencedUi: string, interestTiming: InterestTiming): {
|
|
143
|
+
Electorate: {
|
|
144
|
+
type: "invitation";
|
|
145
|
+
value: import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>;
|
|
146
|
+
};
|
|
147
|
+
MinInitialDebt: {
|
|
148
|
+
type: "amount";
|
|
149
|
+
value: import("@agoric/ertp").NatAmount;
|
|
150
|
+
};
|
|
151
|
+
ShortfallInvitation: {
|
|
152
|
+
type: "invitation";
|
|
153
|
+
value: import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>;
|
|
154
|
+
};
|
|
155
|
+
ReferencedUI: {
|
|
156
|
+
type: "string";
|
|
157
|
+
value: string;
|
|
158
|
+
};
|
|
159
|
+
ChargingPeriod: {
|
|
160
|
+
type: "nat";
|
|
161
|
+
value: bigint;
|
|
162
|
+
};
|
|
163
|
+
RecordingPeriod: {
|
|
164
|
+
type: "nat";
|
|
165
|
+
value: bigint;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
import type { ParamTypesMapFromRecord } from '@agoric/governance/src/contractGovernance/typedParamManager.js';
|
|
169
|
+
export {};
|
|
170
|
+
//# sourceMappingURL=params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["params.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;GAeG;AAEH,kCAAmC,gBAAgB,CAAC;AACpD,mCAAoC,iBAAiB,CAAC;AAEtD,6BAA8B,WAAW,CAAC;AAC1C,qCAAsC,mBAAmB,CAAC;AAC1D,sCAAuC,oBAAoB,CAAC;AAC5D,sCAAuC,oBAAoB,CAAC;AAC5D,gCAAiC,cAAc,CAAC;AAChD,2BAA4B,SAAS,CAAC;AACtC,mCAAoC,gBAAgB,CAAC;AACrD,uCAAwC,qBAAqB,CAAC;AAC9D,gCAAiC,cAAc,CAAC;;;;;;;AAoEzC,oDAHI,mBAAmB,2BAA2B,CAAC,oGAC/C,uBAAuB;;;;;;;GAoB9B;AACJ,4EAA4E;AAE5E,iEAYE;AAeK,8MAZI;IACN,0BAA0B,EAAE,OAAO,KAAK,CAAC,CAAC;IAC1C,cAAc,EAAE,OAAO,KAAK,CAAC,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,EAAE,KAAK,cAAc,CAAC,CAAC;IACrC,KAAK,EAAE,KAAK,YAAY,CAAC,CAAC;IAC1B,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,cAAc,EAAE,cAAc,CAAC;IAC/B,yBAAyB,EAAE,OAAO,KAAK,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BH;AAeM,mDAJI,OAAO,cACP,QAAQ,WAAW,CAAC,yBACpB,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAwDjD;;;;OAIG;2BAHQ,KAAK,eACL,OAAO,WAAW,CAAC,sBACnB,uBAAuB;;;;;;;;IAOlC,2BAA2B;eAAf,KAAK;;;;;;;;EAKpB;kCA3KY,wBACR,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAC3C;gCAgCU,UAAU,CAAC,OAAO,qBAAqB,CAAC;yCAwDxC,uBAAuB,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE;iDA/JV,iCAAiC;wCAN1C,kBAAkB;6CAKG,YAAY;4BAF/B,cAAc;oCALpB,4BAA4B;0BAUtC,aAAa;kCAPL,cAAc;6CAGH,4BAA4B;oCACZ,YAAY;6BAH5C,kBAAkB;iCANd,iDAAiD;6BAD7C,kBAAkB;2BAQb,cAAc;iCAIvB,0CAA0C;4BAZtC,kBAAkB;AAuCpD;;;;;;GAMG;AACH,qEANW,OAAO,KAAK,CAAC,kBACb,OAAO,KAAK,CAAC,6BACb,OAAO,KAAK,CAAC,gBACb,MAAM,kBACN,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;EAgCxB;6CAxEyC,gEAAgE"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
export function currentDebtToCollateral(vault: Vault): Ratio;
|
|
2
|
+
export function makePrioritizedVaults(store: MapStore<string, Vault>): {
|
|
3
|
+
addVault: (vaultId: VaultId, vault: Vault) => string;
|
|
4
|
+
entries: (keyPatt?: import("@endo/patterns").Pattern, valuePatt?: import("@endo/patterns").Pattern) => Iterable<[string, import("@endo/exo").Guarded<{
|
|
5
|
+
getVaultSeat(): import("@agoric/zoe").ZCFSeat;
|
|
6
|
+
initVaultKit(seat: import("@agoric/zoe").ZCFSeat, storageNode: import("@agoric/internal").Remote<import("@agoric/internal/src/lib-chainStorage.js").StorageNode>): Promise<{
|
|
7
|
+
publicSubscribers: {
|
|
8
|
+
vault: {
|
|
9
|
+
description: string;
|
|
10
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
11
|
+
storagePath: Promise<string>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
15
|
+
AdjustBalances(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
16
|
+
CloseVault(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
17
|
+
TransferVault(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
18
|
+
}>;
|
|
19
|
+
vault: import("@endo/exo").Guarded<{
|
|
20
|
+
getPublicTopics(): {
|
|
21
|
+
vault: {
|
|
22
|
+
description: string;
|
|
23
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
24
|
+
storagePath: Promise<string>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
28
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
29
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
30
|
+
getCollateralAmount(): import("@agoric/ertp").NatAmount;
|
|
31
|
+
getCurrentDebt(): import("@agoric/ertp").NatAmount;
|
|
32
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
33
|
+
}>;
|
|
34
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<import("./vault.js").VaultNotification>;
|
|
35
|
+
}>;
|
|
36
|
+
liquidating(): void;
|
|
37
|
+
liquidated(): void;
|
|
38
|
+
abortLiquidation(): string;
|
|
39
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
40
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
41
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation<import("./vaultKit.js").VaultKit>>;
|
|
42
|
+
getCollateralAmount(): Amount<"nat">;
|
|
43
|
+
getCurrentDebt(): Amount<"nat">;
|
|
44
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
45
|
+
}>]>;
|
|
46
|
+
getCount: (keyPatt?: import("@endo/patterns").Pattern, valuePatt?: import("@endo/patterns").Pattern) => number;
|
|
47
|
+
hasVaultByAttributes: (oldDebt: NormalizedDebt, oldCollateral: Amount<"nat">, vaultId: string) => boolean;
|
|
48
|
+
highestRatio: () => Ratio | undefined;
|
|
49
|
+
removeVault: (key: string) => Vault;
|
|
50
|
+
removeVaultByAttributes: (oldDebt: NormalizedDebt, oldCollateral: Amount<"nat">, vaultId: string) => import("@endo/exo").Guarded<{
|
|
51
|
+
getVaultSeat(): import("@agoric/zoe").ZCFSeat;
|
|
52
|
+
initVaultKit(seat: import("@agoric/zoe").ZCFSeat, storageNode: import("@agoric/internal").Remote<import("@agoric/internal/src/lib-chainStorage.js").StorageNode>): Promise<{
|
|
53
|
+
publicSubscribers: {
|
|
54
|
+
vault: {
|
|
55
|
+
description: string;
|
|
56
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
57
|
+
storagePath: Promise<string>;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
61
|
+
AdjustBalances(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
62
|
+
CloseVault(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
63
|
+
TransferVault(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
64
|
+
}>;
|
|
65
|
+
vault: import("@endo/exo").Guarded<{
|
|
66
|
+
getPublicTopics(): {
|
|
67
|
+
vault: {
|
|
68
|
+
description: string;
|
|
69
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
70
|
+
storagePath: Promise<string>;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
74
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
75
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
76
|
+
getCollateralAmount(): import("@agoric/ertp").NatAmount;
|
|
77
|
+
getCurrentDebt(): import("@agoric/ertp").NatAmount;
|
|
78
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
79
|
+
}>;
|
|
80
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<import("./vault.js").VaultNotification>;
|
|
81
|
+
}>;
|
|
82
|
+
liquidating(): void;
|
|
83
|
+
liquidated(): void;
|
|
84
|
+
abortLiquidation(): string;
|
|
85
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
86
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
87
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation<import("./vaultKit.js").VaultKit>>;
|
|
88
|
+
getCollateralAmount(): Amount<"nat">;
|
|
89
|
+
getCurrentDebt(): Amount<"nat">;
|
|
90
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
91
|
+
}>;
|
|
92
|
+
removeVaultsBelow: ({ margin, quote, interest }: {
|
|
93
|
+
margin: any;
|
|
94
|
+
quote: any;
|
|
95
|
+
interest: any;
|
|
96
|
+
}) => MapStore<string, import("@endo/exo").Guarded<{
|
|
97
|
+
getVaultSeat(): import("@agoric/zoe").ZCFSeat;
|
|
98
|
+
initVaultKit(seat: import("@agoric/zoe").ZCFSeat, storageNode: import("@agoric/internal").Remote<import("@agoric/internal/src/lib-chainStorage.js").StorageNode>): Promise<{
|
|
99
|
+
publicSubscribers: {
|
|
100
|
+
vault: {
|
|
101
|
+
description: string;
|
|
102
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
103
|
+
storagePath: Promise<string>;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
107
|
+
AdjustBalances(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
108
|
+
CloseVault(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
109
|
+
TransferVault(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
110
|
+
}>;
|
|
111
|
+
vault: import("@endo/exo").Guarded<{
|
|
112
|
+
getPublicTopics(): {
|
|
113
|
+
vault: {
|
|
114
|
+
description: string;
|
|
115
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
116
|
+
storagePath: Promise<string>;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
120
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
121
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
122
|
+
getCollateralAmount(): import("@agoric/ertp").NatAmount;
|
|
123
|
+
getCurrentDebt(): import("@agoric/ertp").NatAmount;
|
|
124
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
125
|
+
}>;
|
|
126
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<import("./vault.js").VaultNotification>;
|
|
127
|
+
}>;
|
|
128
|
+
liquidating(): void;
|
|
129
|
+
liquidated(): void;
|
|
130
|
+
abortLiquidation(): string;
|
|
131
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
132
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
133
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation<import("./vaultKit.js").VaultKit>>;
|
|
134
|
+
getCollateralAmount(): Amount<"nat">;
|
|
135
|
+
getCurrentDebt(): Amount<"nat">;
|
|
136
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
137
|
+
}>>;
|
|
138
|
+
countVaultsBelow: (crKey: any) => number;
|
|
139
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
140
|
+
addVault: (vaultId: VaultId, vault: Vault) => string;
|
|
141
|
+
entries: (keyPatt?: import("@endo/patterns").Pattern, valuePatt?: import("@endo/patterns").Pattern) => Iterable<[string, import("@endo/exo").Guarded<{
|
|
142
|
+
getVaultSeat(): import("@agoric/zoe").ZCFSeat;
|
|
143
|
+
initVaultKit(seat: import("@agoric/zoe").ZCFSeat, storageNode: import("@agoric/internal").Remote<import("@agoric/internal/src/lib-chainStorage.js").StorageNode>): Promise<{
|
|
144
|
+
publicSubscribers: {
|
|
145
|
+
vault: {
|
|
146
|
+
description: string;
|
|
147
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
148
|
+
storagePath: Promise<string>;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
152
|
+
AdjustBalances(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
153
|
+
CloseVault(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
154
|
+
TransferVault(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
155
|
+
}>;
|
|
156
|
+
vault: import("@endo/exo").Guarded<{
|
|
157
|
+
getPublicTopics(): {
|
|
158
|
+
vault: {
|
|
159
|
+
description: string;
|
|
160
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
161
|
+
storagePath: Promise<string>;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
165
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
166
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
167
|
+
getCollateralAmount(): import("@agoric/ertp").NatAmount;
|
|
168
|
+
getCurrentDebt(): import("@agoric/ertp").NatAmount;
|
|
169
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
170
|
+
}>;
|
|
171
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<import("./vault.js").VaultNotification>;
|
|
172
|
+
}>;
|
|
173
|
+
liquidating(): void;
|
|
174
|
+
liquidated(): void;
|
|
175
|
+
abortLiquidation(): string;
|
|
176
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
177
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
178
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation<import("./vaultKit.js").VaultKit>>;
|
|
179
|
+
getCollateralAmount(): Amount<"nat">;
|
|
180
|
+
getCurrentDebt(): Amount<"nat">;
|
|
181
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
182
|
+
}>]>;
|
|
183
|
+
getCount: (keyPatt?: import("@endo/patterns").Pattern, valuePatt?: import("@endo/patterns").Pattern) => number;
|
|
184
|
+
hasVaultByAttributes: (oldDebt: NormalizedDebt, oldCollateral: Amount<"nat">, vaultId: string) => boolean;
|
|
185
|
+
highestRatio: () => Ratio | undefined;
|
|
186
|
+
removeVault: (key: string) => Vault;
|
|
187
|
+
removeVaultByAttributes: (oldDebt: NormalizedDebt, oldCollateral: Amount<"nat">, vaultId: string) => import("@endo/exo").Guarded<{
|
|
188
|
+
getVaultSeat(): import("@agoric/zoe").ZCFSeat;
|
|
189
|
+
initVaultKit(seat: import("@agoric/zoe").ZCFSeat, storageNode: import("@agoric/internal").Remote<import("@agoric/internal/src/lib-chainStorage.js").StorageNode>): Promise<{
|
|
190
|
+
publicSubscribers: {
|
|
191
|
+
vault: {
|
|
192
|
+
description: string;
|
|
193
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
194
|
+
storagePath: Promise<string>;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
198
|
+
AdjustBalances(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
199
|
+
CloseVault(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
200
|
+
TransferVault(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
201
|
+
}>;
|
|
202
|
+
vault: import("@endo/exo").Guarded<{
|
|
203
|
+
getPublicTopics(): {
|
|
204
|
+
vault: {
|
|
205
|
+
description: string;
|
|
206
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
207
|
+
storagePath: Promise<string>;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
211
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
212
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
213
|
+
getCollateralAmount(): import("@agoric/ertp").NatAmount;
|
|
214
|
+
getCurrentDebt(): import("@agoric/ertp").NatAmount;
|
|
215
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
216
|
+
}>;
|
|
217
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<import("./vault.js").VaultNotification>;
|
|
218
|
+
}>;
|
|
219
|
+
liquidating(): void;
|
|
220
|
+
liquidated(): void;
|
|
221
|
+
abortLiquidation(): string;
|
|
222
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
223
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
224
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation<import("./vaultKit.js").VaultKit>>;
|
|
225
|
+
getCollateralAmount(): Amount<"nat">;
|
|
226
|
+
getCurrentDebt(): Amount<"nat">;
|
|
227
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
228
|
+
}>;
|
|
229
|
+
removeVaultsBelow: ({ margin, quote, interest }: {
|
|
230
|
+
margin: any;
|
|
231
|
+
quote: any;
|
|
232
|
+
interest: any;
|
|
233
|
+
}) => MapStore<string, import("@endo/exo").Guarded<{
|
|
234
|
+
getVaultSeat(): import("@agoric/zoe").ZCFSeat;
|
|
235
|
+
initVaultKit(seat: import("@agoric/zoe").ZCFSeat, storageNode: import("@agoric/internal").Remote<import("@agoric/internal/src/lib-chainStorage.js").StorageNode>): Promise<{
|
|
236
|
+
publicSubscribers: {
|
|
237
|
+
vault: {
|
|
238
|
+
description: string;
|
|
239
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
240
|
+
storagePath: Promise<string>;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
invitationMakers: import("@endo/exo").Guarded<{
|
|
244
|
+
AdjustBalances(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
245
|
+
CloseVault(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
246
|
+
TransferVault(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
247
|
+
}>;
|
|
248
|
+
vault: import("@endo/exo").Guarded<{
|
|
249
|
+
getPublicTopics(): {
|
|
250
|
+
vault: {
|
|
251
|
+
description: string;
|
|
252
|
+
subscriber: import("@agoric/notifier").Subscriber<import("./vault.js").VaultNotification>;
|
|
253
|
+
storagePath: Promise<string>;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
257
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
258
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation</*elided*/ any>>;
|
|
259
|
+
getCollateralAmount(): import("@agoric/ertp").NatAmount;
|
|
260
|
+
getCurrentDebt(): import("@agoric/ertp").NatAmount;
|
|
261
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
262
|
+
}>;
|
|
263
|
+
vaultUpdater: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<import("./vault.js").VaultNotification>;
|
|
264
|
+
}>;
|
|
265
|
+
liquidating(): void;
|
|
266
|
+
liquidated(): void;
|
|
267
|
+
abortLiquidation(): string;
|
|
268
|
+
makeAdjustBalancesInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
269
|
+
makeCloseInvitation(): Promise<import("@agoric/zoe").Invitation<string, undefined>>;
|
|
270
|
+
makeTransferInvitation(): Promise<import("@agoric/zoe").Invitation<import("./vaultKit.js").VaultKit>>;
|
|
271
|
+
getCollateralAmount(): Amount<"nat">;
|
|
272
|
+
getCurrentDebt(): Amount<"nat">;
|
|
273
|
+
getNormalizedDebt(): NormalizedDebt;
|
|
274
|
+
}>>;
|
|
275
|
+
countVaultsBelow: (crKey: any) => number;
|
|
276
|
+
}>;
|
|
277
|
+
import type { Vault } from './vault.js';
|
|
278
|
+
import type { Ratio } from '@agoric/ertp';
|
|
279
|
+
import type { MapStore } from '@agoric/store';
|
|
280
|
+
import type { VaultId } from './types.js';
|
|
281
|
+
import type { NormalizedDebt } from './storeUtils.js';
|
|
282
|
+
import type { Amount } from '@agoric/ertp';
|
|
283
|
+
//# sourceMappingURL=prioritizedVaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prioritizedVaults.d.ts","sourceRoot":"","sources":["prioritizedVaults.js"],"names":[],"mappings":"AA2CO,+CAHI,KAAK,GACH,KAAK,CAMf;AASI,6CAHI,SAAS,MAAM,EAAE,KAAK,CAAC;wBAsDrB,OAAO,SACP,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA9BL,cAAc,iBACd,OAAO,KAAK,CAAC,WACb,MAAM;wBAlBJ,KAAK,GAAG,SAAS;uBA0BnB,MAAM,KACJ,KAAK;uCAQP,cAAc,iBACd,OAAO,KAAK,CAAC,WACb,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAQN,OAAO,SACP,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA9BL,cAAc,iBACd,OAAO,KAAK,CAAC,WACb,MAAM;wBAlBJ,KAAK,GAAG,SAAS;uBA0BnB,MAAM,KACJ,KAAK;uCAQP,cAAc,iBACd,OAAO,KAAK,CAAC,WACb,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDlB;2BA3IuB,YAAY;2BAEZ,cAAc;8BAHX,eAAe;6BAIhB,YAAY;oCAFL,iBAAiB;4BAGzB,cAAc"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** @import {PureData} from '@endo/marshal' */
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {[normalizedCollateralization: number, vaultId: VaultId]} CompositeKey
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @param {PureData} key
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
9
|
+
export const encodeData: (p: import("@endo/marshal").Passable) => string;
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} encoded
|
|
12
|
+
* @returns {PureData}
|
|
13
|
+
*/
|
|
14
|
+
export const decodeData: (encoded: string, skip?: number) => import("@endo/marshal").Passable;
|
|
15
|
+
export function toVaultKey(normalizedDebt: NormalizedDebt, collateral: Amount<"nat">, vaultId: VaultId): string;
|
|
16
|
+
export function fromVaultKey(key: string): [normalizedCollateralization: number, vaultId: VaultId];
|
|
17
|
+
export function normalizedCollRatio(quote: PriceQuote, compoundedInterest: Ratio, margin: Ratio): number;
|
|
18
|
+
export function normalizedCollRatioKey(quote: PriceQuote, compoundedInterest: Ratio, margin: Ratio): string;
|
|
19
|
+
export type CompositeKey = [normalizedCollateralization: number, vaultId: VaultId];
|
|
20
|
+
export type NormalizedDebt = Amount<"nat"> & {
|
|
21
|
+
normalized: true;
|
|
22
|
+
};
|
|
23
|
+
export type ActualDebt = Amount<"nat"> & {
|
|
24
|
+
normalized: false;
|
|
25
|
+
};
|
|
26
|
+
import type { Amount } from '@agoric/ertp';
|
|
27
|
+
import type { VaultId } from './types.js';
|
|
28
|
+
import type { PriceQuote } from '@agoric/zoe/tools/types.js';
|
|
29
|
+
import type { Ratio } from '@agoric/ertp';
|
|
30
|
+
//# sourceMappingURL=storeUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storeUtils.d.ts","sourceRoot":"","sources":["storeUtils.js"],"names":[],"mappings":"AAyBA,8CAA8C;AAE9C;;GAEG;AAOH;;;GAGG;AACH,yEAA+C;AAO/C;;;GAGG;AACH,8FAA+C;AAkDxC,2CANI,cAAc,cACd,OAAO,KAAK,CAAC,WACb,OAAO,GACL,MAAM,CAelB;AAOM,kCAHI,MAAM,GACJ,CAAC,2BAA2B,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAKnE;AAgBM,2CALI,UAAU,sBACV,KAAK,UACL,KAAK,GACH,MAAM,CAiBlB;AAcM,8CANI,UAAU,sBACV,KAAK,UACL,KAAK,GACH,MAAM,CAMlB;2BA/IY,CAAC,2BAA2B,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;6BA6CtD,OAAO,KAAK,CAAC,GAAG;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE;yBACpC,OAAO,KAAK,CAAC,GAAG;IAAE,UAAU,EAAE,KAAK,CAAA;CAAE;4BAnEnB,cAAc;6BACpB,YAAY;gCAFuD,4BAA4B;2BACzF,cAAc"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export type VaultFactoryPublicFacet = import("./vaultFactory.js").VaultFactoryContract["publicFacet"];
|
|
2
|
+
export type AutoswapLocal = {
|
|
3
|
+
getInputPrice: (amount: Amount, brand: Brand) => Amount;
|
|
4
|
+
makeSwapInvitation: () => Invitation;
|
|
5
|
+
};
|
|
6
|
+
export type VaultManagerParamValues = {
|
|
7
|
+
/**
|
|
8
|
+
* - margin below
|
|
9
|
+
* which collateral will be liquidated to satisfy the debt.
|
|
10
|
+
*/
|
|
11
|
+
liquidationMargin: Ratio;
|
|
12
|
+
/**
|
|
13
|
+
* - penalty charged
|
|
14
|
+
* upon liquidation as proportion of debt
|
|
15
|
+
*/
|
|
16
|
+
liquidationPenalty: Ratio;
|
|
17
|
+
/**
|
|
18
|
+
* - annual interest rate
|
|
19
|
+
* charged on debt positions
|
|
20
|
+
*/
|
|
21
|
+
interestRate: Ratio;
|
|
22
|
+
/**
|
|
23
|
+
* - The fee (in BasisPoints)
|
|
24
|
+
* charged when creating or increasing a debt position.
|
|
25
|
+
*/
|
|
26
|
+
mintFee: Ratio;
|
|
27
|
+
debtLimit: Amount<"nat">;
|
|
28
|
+
/**
|
|
29
|
+
* - vault must
|
|
30
|
+
* maintain this in order to remove collateral or add debt
|
|
31
|
+
*/
|
|
32
|
+
liquidationPadding?: Ratio | undefined;
|
|
33
|
+
};
|
|
34
|
+
export type AddVaultType = (collateralIssuer: Issuer, collateralKeyword: Keyword, params: VaultManagerParamValues) => Promise<VaultManager>;
|
|
35
|
+
export type VaultFactoryCreatorFacet = {
|
|
36
|
+
addVaultType: AddVaultType;
|
|
37
|
+
getRewardAllocation: () => import("@agoric/zoe").Allocation;
|
|
38
|
+
makeCollectFeesInvitation: () => Promise<Invitation<string, never>>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Mint new debt `toMint` and transfer the `fee`
|
|
42
|
+
* portion to the vaultFactory's reward pool. Then reallocate over all the
|
|
43
|
+
* seat arguments and the rewardPoolSeat. Update the `totalDebt` if the
|
|
44
|
+
* reallocate succeeds.
|
|
45
|
+
*/
|
|
46
|
+
export type MintAndTransfer = (mintReceiver: ZCFSeat, toMint: Amount<"nat">, fee: Amount<"nat">, transfers: TransferPart[]) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Burn debt tokens off a seat and update the `totalDebt` if
|
|
49
|
+
* the reallocate succeeds.
|
|
50
|
+
*/
|
|
51
|
+
export type BurnDebt = (toBurn: Amount, fromSeat: ZCFSeat) => void;
|
|
52
|
+
export type GetVaultParams = {
|
|
53
|
+
getLiquidationMargin: () => Ratio;
|
|
54
|
+
getMintFee: () => Ratio;
|
|
55
|
+
getCollateralQuote: () => Promise<import("@agoric/zoe/tools/types.js").PriceQuote>;
|
|
56
|
+
/**
|
|
57
|
+
* - The annual
|
|
58
|
+
* interest rate on a debt position
|
|
59
|
+
*/
|
|
60
|
+
getInterestRate: () => Ratio;
|
|
61
|
+
/**
|
|
62
|
+
* - The period (in seconds) at
|
|
63
|
+
* which interest is charged to the debt position.
|
|
64
|
+
*/
|
|
65
|
+
getChargingPeriod: () => RelativeTime;
|
|
66
|
+
/**
|
|
67
|
+
* - The period (in seconds)
|
|
68
|
+
* at which interest is recorded to the debt position.
|
|
69
|
+
*/
|
|
70
|
+
getRecordingPeriod: () => RelativeTime;
|
|
71
|
+
};
|
|
72
|
+
export type VaultId = string;
|
|
73
|
+
export type InterestTiming = {
|
|
74
|
+
/**
|
|
75
|
+
* in seconds
|
|
76
|
+
*/
|
|
77
|
+
chargingPeriod: RelativeTime;
|
|
78
|
+
/**
|
|
79
|
+
* in seconds
|
|
80
|
+
*/
|
|
81
|
+
recordingPeriod: RelativeTime;
|
|
82
|
+
};
|
|
83
|
+
export type LiquidationStrategy = {
|
|
84
|
+
keywordMapping: () => import("@agoric/zoe/src/contractSupport/types.js").KeywordKeywordRecord;
|
|
85
|
+
makeProposal: (collateral: Amount, run: Amount) => import("@agoric/zoe").Proposal;
|
|
86
|
+
makeInvitation: (debt: Amount) => Promise<Invitation>;
|
|
87
|
+
};
|
|
88
|
+
export type Liquidator = {
|
|
89
|
+
makeLiquidateInvitation: () => Promise<Invitation<void, {
|
|
90
|
+
debt: Amount<"nat">;
|
|
91
|
+
penaltyRate: Ratio;
|
|
92
|
+
}>>;
|
|
93
|
+
};
|
|
94
|
+
export type DebtStatus = {
|
|
95
|
+
latestInterestUpdate: Timestamp;
|
|
96
|
+
/**
|
|
97
|
+
* interest accrued since latestInterestUpdate
|
|
98
|
+
*/
|
|
99
|
+
interest: NatValue;
|
|
100
|
+
/**
|
|
101
|
+
* total including principal and interest
|
|
102
|
+
*/
|
|
103
|
+
newDebt: NatValue;
|
|
104
|
+
};
|
|
105
|
+
export type Calculate = (debtStatus: DebtStatus, currentTime: Timestamp) => DebtStatus;
|
|
106
|
+
export type CalculatorKit = {
|
|
107
|
+
/**
|
|
108
|
+
* calculate new debt for charging periods up to
|
|
109
|
+
* the present.
|
|
110
|
+
*/
|
|
111
|
+
calculate: Calculate;
|
|
112
|
+
/**
|
|
113
|
+
* calculate new debt for
|
|
114
|
+
* reporting periods up to the present. If some charging periods have elapsed
|
|
115
|
+
* that don't constitute whole reporting periods, the time is not updated past
|
|
116
|
+
* them and interest is not accumulated for them.
|
|
117
|
+
*/
|
|
118
|
+
calculateReportingPeriod: Calculate;
|
|
119
|
+
};
|
|
120
|
+
export type VaultFactoryParamPath = {
|
|
121
|
+
key: "governedParams" | {
|
|
122
|
+
collateralBrand: Brand;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
import type { Amount } from '@agoric/ertp';
|
|
126
|
+
import type { Brand } from '@agoric/ertp';
|
|
127
|
+
import type { Invitation } from '@agoric/zoe';
|
|
128
|
+
import type { Ratio } from '@agoric/ertp';
|
|
129
|
+
import type { Issuer } from '@agoric/ertp';
|
|
130
|
+
import type { Keyword } from '@agoric/zoe';
|
|
131
|
+
import type { VaultManager } from './vaultManager.js';
|
|
132
|
+
import type { ZCFSeat } from '@agoric/zoe';
|
|
133
|
+
import type { TransferPart } from '@agoric/zoe';
|
|
134
|
+
import type { RelativeTime } from '@agoric/time';
|
|
135
|
+
import type { Timestamp } from '@agoric/time';
|
|
136
|
+
import type { NatValue } from '@agoric/ertp';
|
|
137
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"sCAMa,OAAO,mBAAmB,EAAE,oBAAoB,CAAC,aAAa,CAAC;;mBAY9D,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,MAAM;wBACxC,MAAM,UAAU;;;;;;;uBAKhB,KAAK;;;;;wBAEL,KAAK;;;;;kBAEL,KAAK;;;;;aAEL,KAAK;eAEL,OAAO,KAAK,CAAC;;;;;;;8CAOhB,MAAM,qBACN,OAAO,UACP,uBAAuB,KACrB,OAAO,CAAC,YAAY,CAAC;;kBAKpB,YAAY;yBACZ,MAAM,OAAO,aAAa,EAAE,UAAU;+BACtC,MAAM,OAAO,CAAC,WAAW,MAAM,EAAE,KAAK,CAAC,CAAC;;;;;;;;6CAQ3C,OAAO,UACP,OAAO,KAAK,CAAC,OACb,OAAO,KAAK,CAAC,aACb,YAAY,EAAE,KACZ,IAAI;;;;;gCAMN,MAAM,YACN,OAAO,KACL,IAAI;;0BAKH,MAAM,KAAK;gBACX,MAAM,KAAK;wBACX,MAAM,OAAO,CAAC,OAAO,4BAA4B,EAAE,UAAU,CAAC;;;;;qBAC9D,MAAM,KAAK;;;;;uBAEX,MAAM,YAAY;;;;;wBAElB,MAAM,YAAY;;sBAIlB,MAAM;;;;;oBAIN,YAAY;;;;qBACZ,YAAY;;;oBAKZ,MAAM,OAAO,0CAA0C,EAAE,oBAAoB;kBAC7E,CACT,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,KACR,OAAO,aAAa,EAAE,QAAQ;oBACxB,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC;;;6BAKrC,MAAM,OAAO,CAC1B,WACA,IAAU,EACV;QAAQ,IAAI,EAAE,OAAO,KAAK,CAAC,CAAC;QAAC,WAAW,EAAE,KAAK,CAAA;KAAE,CAC5C,CACF;;;0BAKU,SAAS;;;;cACT,QAAQ;;;;aACR,QAAQ;;qCAKX,UAAU,eACV,SAAS,KACP,UAAU;;;;;;eAKT,SAAS;;;;;;;8BAET,SAAS;;oCAMT;IAAE,GAAG,EAAE,gBAAgB,GAAG;QAAE,eAAe,EAAE,KAAK,CAAA;KAAE,CAAA;CAAE;4BA7HX,cAAc;2BAAd,cAAc;gCACV,aAAa;2BADjB,cAAc;4BAAd,cAAc;6BACV,aAAa;kCAJ3C,mBAAmB;6BAIW,aAAa;kCAAb,aAAa;kCAF3C,cAAc;+BADjB,cAAc;8BAEe,cAAc"}
|