Skip to content

Commit

Permalink
feat(AMM)!: remove the AMM and cleanup bootstrap etc. dependencies (#…
Browse files Browse the repository at this point in the history
…7074)

* feat(AMM)!:  remove the AMM and cleanup bootstrap etc. dependencies

The most visible consequence is to vault liquidation. Some pieces are
left hanging, and will be repaired by #7047.

* chore: first follow-ups to initial comments

Remove a few more things, mostly doc comments.

* chore: clean-ups and todos to mark unfinished transition steps

* chore: use unknown rather than any in interim liquidation contracts

* chore: remove more stuff related to AMM

remove interchainPool and other bootstrap stuff connected to AMM
Simplify liquidation contracts so they don't refer to dead code.

other clean ups

* chore: lint cleanups and revert retainedCollateral

* test: update integration test to use faucet instead of amm & vault
  • Loading branch information
Chris-Hibbert authored Mar 1, 2023
1 parent 70ba9b0 commit ed5ee58
Show file tree
Hide file tree
Showing 89 changed files with 216 additions and 10,387 deletions.
20 changes: 0 additions & 20 deletions docs/threat_models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,6 @@

[![./pegasus/pegasus_sequence.svg](./pegasus/pegasus_sequence.svg)](./pegasus/pegasus_sequence.svg)

## ./smart_contracts/amm/amm_component.svg

[![./smart_contracts/amm/amm_component.svg](./smart_contracts/amm/amm_component.svg)](./smart_contracts/amm/amm_component.svg)

## ./smart_contracts/amm/amm_sequence.svg

[![./smart_contracts/amm/amm_sequence.svg](./smart_contracts/amm/amm_sequence.svg)](./smart_contracts/amm/amm_sequence.svg)

## ./smart_contracts/amm/amm_sequence_001.svg

[![./smart_contracts/amm/amm_sequence_001.svg](./smart_contracts/amm/amm_sequence_001.svg)](./smart_contracts/amm/amm_sequence_001.svg)

## ./smart_contracts/amm/amm_sequence_002.svg

[![./smart_contracts/amm/amm_sequence_002.svg](./smart_contracts/amm/amm_sequence_002.svg)](./smart_contracts/amm/amm_sequence_002.svg)

## ./smart_contracts/amm/amm_sequence_003.svg

[![./smart_contracts/amm/amm_sequence_003.svg](./smart_contracts/amm/amm_sequence_003.svg)](./smart_contracts/amm/amm_sequence_003.svg)

## ./vaultFactory/VaultFactory.svg

[![./vaultFactory/VaultFactory.svg](./vaultFactory/VaultFactory.svg)](./vaultFactory/VaultFactory.svg)
Expand Down
54 changes: 26 additions & 28 deletions docs/threat_models/vaultFactory/VaultFactory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/threat_models/vaultFactory/vaultFactory.puml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ node "CloseVaultInvitation"

node "Vat" {
node VaultFactory {
node AMM
node "publicAPI" {
circle getCollaterals
circle makeVaultInvitation
Expand Down
9 changes: 0 additions & 9 deletions packages/SwingSet/misc-tools/measure-metering/measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// eslint-disable-next-line import/order
import '../../tools/prepare-test-env.js';

// eslint-disable-next-line import/order
import bundleSource from '@endo/bundle-source';
import { xsnap } from '@agoric/xsnap';
import * as proc from 'child_process';
import * as os from 'os';
Expand Down Expand Up @@ -50,11 +48,6 @@ async function run() {
const bootFn = new URL('measurement-bootstrap.js', import.meta.url).pathname;
const targetFn = new URL('measurement-target.js', import.meta.url).pathname;
const zoeFn = new URL('measurement-zoe.js', import.meta.url).pathname;
const autoswapFn = new URL(
'../../../inter-protocol/src/vpool-xyk-amm/multipoolMarketMaker.js',
import.meta.url,
).pathname;
const autoswapBundle = await bundleSource(autoswapFn);
const config = {
defaultManagerType: 'xs-worker',
bootstrap: 'bootstrap',
Expand Down Expand Up @@ -139,8 +132,6 @@ async function run() {
const zoeInstallVaultFactory = await doCounted('zoeInstallVaultFactory');
console.log(`zoe install (vaultFactory): ${zoeInstallVaultFactory}`);

const zoeInstallAMM = await doCounted('zoeInstallBundle', [autoswapBundle]);
console.log(`zoe install (AMM): ${zoeInstallAMM}`);
const zoeInstantiate = await doCounted('zoeInstantiate');
console.log(`zoe instantiate (AMM): ${zoeInstantiate}`);

Expand Down
1 change: 0 additions & 1 deletion packages/casting/test/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const getVaultManagerMetrics = async (homeP, { cache, lookup }) => {
export default async (homeP, { cache, lookup, makeDefaultLeader }) => {
// const storeKey = getStoreKeyFromCache(homeP, { cache, lookup });
const storeKey = getVaultManagerMetrics(homeP, { cache, lookup });
// const storeKey = ':published.amm.metrics';

console.log('storeKey', await storeKey);

Expand Down
3 changes: 1 addition & 2 deletions packages/deployment/scripts/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ then
SDK_BUILD=0 MUST_USE_PUBLISH_BUNDLE=1 SDK_SRC=/usr/src/agoric-sdk OUTPUT_DIR="$RESULTSDIR" ./start.sh \
--stage.save-storage --trace kvstore swingstore xsnap \
--stages=3 --stage.duration=10 --stage.loadgen.cycles=4 \
--stage.loadgen.vault.interval=12 --stage.loadgen.vault.limit=2 \
--stage.loadgen.amm.interval=12 --stage.loadgen.amm.wait=6 --stage.loadgen.amm.limit=2 \
--stage.loadgen.faucet.interval=6 --stage.loadgen.faucet.limit=4 \
--profile=testnet "--testnet-origin=file://$RESULTSDIR" \
--no-reset --custom-bootstrap
fi
12 changes: 0 additions & 12 deletions packages/inter-protocol/docs/governance-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ From Inter Protocol Whitepaper, v0.8:
Note that the "stability fee" described in the Whitepaper comprises both InterestRate and LoanFee.

### Automated Market Maker (AMM)

In `packages/inter-protocol/src/vpool-xyk-amm/multipoolMarketMaker.js`:

| Governance Key | Type | WP? |
| ------------------ | :---------------- | --- |
| PoolFee | ParamTypes.NAT | N/A |
| ProtocolFee | ParamTypes.NAT | N/A |

The Inter Protocol Whitepaper v0.8 does not describe the governance parameters
for this contract.

### Collateral Reserve

In `packages/inter-protocol/src/reserve/collateralReserve.js`:
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/docs/inter-protocol-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ We propose to launch a preview of the Inter Protocol on Devnet,
comprising the following contracts:

- stakeFactory - borrow Minted against staked BLD
- AMM - Automated Market Maker
- VaultFactory - collateralized debt positions
- liquidateMinimum
- PSM - Parity Stability Module
Expand Down
1 change: 0 additions & 1 deletion packages/inter-protocol/exported.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import './src/stakeFactory/types.js';
import './src/psm/types.js';
import './src/vaultFactory/types.js';
import './src/vpool-xyk-amm/types.js';
179 changes: 0 additions & 179 deletions packages/inter-protocol/scripts/add-initial-liquidity.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/inter-protocol/scripts/deploy-contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ const contractRefs = [
'../../governance/bundles/bundle-committee.js',
'../../governance/bundles/bundle-binaryVoteCounter.js',
'../bundles/bundle-stakeFactory.js',
'../bundles/bundle-amm.js',
'../bundles/bundle-vaultFactory.js',
'../bundles/bundle-liquidateMinimum.js',
'../bundles/bundle-reserve.js',
'../bundles/bundle-psm.js',
'../../vats/bundles/bundle-mintHolder.js',
Expand Down
16 changes: 0 additions & 16 deletions packages/inter-protocol/scripts/init-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ const installKeyGroups = {
],
},
main: {
amm: [
'../src/vpool-xyk-amm/multipoolMarketMaker.js',
'../bundles/bundle-amm.js',
],
interchainPool: [
'../src/interchainPool.js',
'../bundles/bundle-interchainPool.js',
],
vaultFactory: [
'../src/vaultFactory/vaultFactory.js',
'../bundles/bundle-vaultFactory.js',
Expand All @@ -52,14 +44,6 @@ const installKeyGroups = {
'../src/feeDistributor.js',
'../bundles/bundle-feeDistributor.js',
],
liquidateMinimum: [
'../src/vaultFactory/liquidateMinimum.js',
'../bundles/bundle-liquidateMinimum.js',
],
liquidate: [
'../src/vaultFactory/liquidateIncrementally.js',
'../bundles/bundle-liquidateIncrementally.js',
],
reserve: ['../src/reserve/assetReserve.js', '../bundles/bundle-reserve.js'],
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/inter-protocol/src/feeDistributor.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const customTermsShape = harden({
*/

/**
* wrapper to take the vaultFactory or AMM's creatorFacet, and make a call that
* wrapper to take the a creatorFacet (e.g. vaultFactory) and make a call that
* will request an invitation and return a promise for a payment.
*
* @param {ERef<ZoeService>} zoe
Expand Down
Loading

0 comments on commit ed5ee58

Please sign in to comment.