Skip to content

Commit

Permalink
#40 update process initiated
Browse files Browse the repository at this point in the history
  • Loading branch information
anilhelvaci committed Oct 21, 2022
1 parent ae6efa6 commit 807b814
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 30 deletions.
2 changes: 1 addition & 1 deletion contract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@agoric/governance": "0.6.0",
"@agoric/nat": "4.1.0",
"@agoric/notifier": "0.4.0",
"@agoric/run-protocol": "0.11.0",
"@agoric/inter-protocol": "0.13.1",
"@agoric/store": "0.7.1",
"@agoric/swingset-vat": "0.27.0",
"@agoric/vats": "0.9.0",
Expand Down
2 changes: 1 addition & 1 deletion contract/src/interest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { AmountMath } from '@agoric/ertp';
import { assert, details as X } from '@agoric/assert';
import { makeInterestCalculator, calculateCompoundedInterest } from '@agoric/run-protocol/src/interest.js';
import { makeInterestCalculator, calculateCompoundedInterest } from '@agoric/inter-protocol/src/interest.js';

export const SECONDS_PER_YEAR = 60n * 60n * 24n * 365n;
export const BASIS_POINTS = 10000n;
Expand Down
2 changes: 1 addition & 1 deletion contract/src/lendingPool/assertionHelper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, details as X, q } from '@agoric/assert';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';
import { AmountMath } from '@agoric/ertp';

const trace = makeTracer('LendingPool');
Expand Down
2 changes: 1 addition & 1 deletion contract/src/lendingPool/debtsPerCollateral.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
makeRatioFromAmounts,
} from '@agoric/zoe/src/contractSupport/index.js';
import { liquidationDetailTerms, liquidate } from './liquidation.js';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';
import { ratioGTE } from '@agoric/zoe/src/contractSupport/ratio.js';
import { makeLiquidationObserver } from './liquidationObserver.js';
import { makeLoanStoreUtils } from './loanStoreUtils.js';
Expand Down
2 changes: 1 addition & 1 deletion contract/src/lendingPool/lendingPool.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '@agoric/zoe/src/contracts/exported.js';
import { E } from '@endo/far';
import '@agoric/governance/src/exported.js';
import { AmountMath, AssetKind } from '@agoric/ertp';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';
import { makeScalarMap } from '@agoric/store';
import { assertProposalShape } from '@agoric/zoe/src/contractSupport/index.js';
import { makeRatioFromAmounts } from '@agoric/zoe/src/contractSupport/ratio.js';
Expand Down
2 changes: 1 addition & 1 deletion contract/src/lendingPool/liquidateMinimum.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { AmountMath } from '@agoric/ertp';
import { Far, E } from '@endo/far';

import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';

const trace = makeTracer('LiqMin');

Expand Down
2 changes: 1 addition & 1 deletion contract/src/lendingPool/liquidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { E } from '@endo/far';
import { AmountMath } from '@agoric/ertp';
import { makeRatio, offerTo } from '@agoric/zoe/src/contractSupport/index.js';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';

const trace = makeTracer('LIQ');

Expand Down
2 changes: 1 addition & 1 deletion contract/src/lendingPool/liquidationObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getAmountOut } from '@agoric/zoe/src/contractSupport/index.js';
import { getAmountIn } from '@agoric/zoe/src/contractSupport/priceQuote.js';
import { Nat } from '@agoric/nat';
import { E } from '@endo/far';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';

const tracer = makeTracer('LiquidationObserver');

Expand Down
4 changes: 2 additions & 2 deletions contract/src/lendingPool/loan.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import {
import { assert } from '@agoric/assert';
import { AmountMath } from '@agoric/ertp';
import { Far } from '@endo/marshal';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';
import {
calculateCurrentDebt,
reverseInterest,
} from '@agoric/run-protocol/src/interest-math.js';
} from '@agoric/inter-protocol/src/interest-math.js';
import { makeLoanKit } from './loanKit.js';
import {
assertDebtDeltaNotZero,
Expand Down
4 changes: 2 additions & 2 deletions contract/src/lendingPool/loanStoreUtils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { keyEQ, keyLT } from '@agoric/store';
import { AmountMath } from '@agoric/ertp';
import { toVaultKey } from '@agoric/run-protocol/src/vaultFactory/storeUtils.js';
import { makeOrderedVaultStore } from '@agoric/run-protocol/src/vaultFactory/orderedVaultStore.js';
import { toVaultKey } from '@agoric/inter-protocol/src/vaultFactory/storeUtils.js';
import { makeOrderedVaultStore } from '@agoric/inter-protocol/src/vaultFactory/orderedVaultStore.js';
import { LoanPhase } from './loan.js'

/**
Expand Down
2 changes: 1 addition & 1 deletion contract/src/lendingPool/poolManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { makeNotifierKit, observeNotifier } from '@agoric/notifier';
import { AmountMath } from '@agoric/ertp';
import { Far } from '@endo/marshal';
import { makeScalarMap } from '@agoric/store';
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';
import {
RECORDING_PERIOD_KEY,
LIQUIDATION_MARGIN_KEY,
Expand Down
2 changes: 1 addition & 1 deletion contract/src/lendingPool/priceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '@agoric/zoe/exported.js';
import { makeScalarMap } from '@agoric/store';
import { Far } from '@endo/marshal';
import { Nat } from '@agoric/nat';
import { E } from '@agoric/eventual-send';
import { E } from '@endo/far';
import { AmountMath } from '@agoric/ertp';

/**
Expand Down
2 changes: 1 addition & 1 deletion contract/src/lendingPool/priceManagerContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
import { Nat } from '@agoric/nat';
import '@agoric/zoe/exported.js';
import { makeScalarMap } from '@agoric/store';
import { E } from '@agoric/eventual-send';
import { E } from '@endo/far';

/**
* This the place where we wrap the PriceManager inside a vat.
Expand Down
4 changes: 2 additions & 2 deletions contract/test/lendingPool/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import { makeFakeVatAdmin } from '@agoric/zoe/tools/fakeVatAdmin.js';
import { makeZoeKit } from '@agoric/zoe';
import buildManualTimer from '@agoric/zoe/tools/manualTimer.js';
import { makeAgoricNamesAccess, makePromiseSpace } from '@agoric/vats/src/core/utils.js';
import * as Collect from '@agoric/run-protocol/src/collect.js';
import * as Collect from '@agoric/inter-protocol/src/collect.js';
import committeeBundle from '@agoric/governance/bundles/bundle-committee.js';
import contractGovernorBundle from '@agoric/governance/bundles/bundle-contractGovernor.js';
import binaryVoteCounterBundle from '@agoric/governance/bundles/bundle-binaryVoteCounter.js';
import * as utils from '@agoric/vats/src/core/utils.js';
import { makeAmmTerms } from '@agoric/run-protocol/src/vpool-xyk-amm/params.js';
import { makeAmmTerms } from '@agoric/inter-protocol/src/vpool-xyk-amm/params.js';
import { AmountMath } from '@agoric/ertp';
import { makeRatio } from '@agoric/zoe/src/contractSupport/index.js';
import { makeGovernedTerms } from '../../src/lendingPool/params.js';
Expand Down
22 changes: 9 additions & 13 deletions contract/test/lendingPool/test-lendingPool.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// @ts-check
import { makeTracer } from '@agoric/run-protocol/src/makeTracer.js';

const trace = makeTracer('TestST');

import { test as unknownTest } from '@agoric/zoe/tools/prepare-test-env-ava.js'; // swingset-vat to zoe
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';
import '@agoric/zoe/exported.js';
import '@agoric/zoe/tools/prepare-test-env.js';
import test from 'ava';
import { deeplyFulfilled } from '@endo/marshal';

import { E } from '@endo/far';
Expand All @@ -19,15 +17,13 @@ import { makePromiseKit } from '@endo/promise-kit';
import { makeScriptedPriceAuthority } from '@agoric/zoe/tools/scriptedPriceAuthority.js';
import { makePriceManager } from '../../src/lendingPool/priceManager.js';
import {
depositMoney,
addPool,
makeRates,
setupAssets,
borrow,
makeMarketStateChecker,
getPoolMetadata,
calculateUnderlyingFromProtocol,
calculateProtocolFromUnderlying, splitCollateral, adjust, closeLoan,
calculateProtocolFromUnderlying,
splitCollateral,
} from './helpers.js';

import {
Expand All @@ -37,21 +33,21 @@ import {
setupAmmAndElectorate,
} from './setup.js';
import { SECONDS_PER_YEAR } from '../../src/interest.js';
import * as Collect from '@agoric/run-protocol/src/collect.js';
import { unsafeMakeBundleCache } from '@agoric/run-protocol/test/bundleTool.js';
import * as Collect from '@agoric/inter-protocol/src/collect.js';
import { unsafeMakeBundleCache } from '@agoric/swingset-vat/tools/bundleTool.js';
import { makeManualPriceAuthority } from '@agoric/zoe/tools/manualPriceAuthority.js';
import { LoanPhase } from '../../src/lendingPool/loan.js';
import { oneMinus } from '@agoric/zoe/src/contractSupport/ratio.js';
import { makeLendingPoolAssertions } from './lendingPoolAssertions.js';
import { ADJUST_PROPOSAL_TYPE, makeLendingPoolScenarioHelpers, POOL_TYPES } from './lendingPoolScenrioHelpers.js';

const test = unknownTest;
const trace = makeTracer('TestST');

const contractRoots = {
faucet: './faucet.js',
liquidate: '../../src/lendingPool/liquidateMinimum.js',
LendingPool: '../../src/lendingPool/lendingPool.js',
amm: '@agoric/run-protocol/src/vpool-xyk-amm/multipoolMarketMaker.js',
amm: '@agoric/inter-protocol/src/vpool-xyk-amm/multipoolMarketMaker.js',
};

const BASIS_POINTS = 10000n;
Expand Down

0 comments on commit 807b814

Please sign in to comment.