Skip to content

Commit

Permalink
fix: update ENS and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaShWoof committed Jun 21, 2024
1 parent a7f585b commit e192258
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ export default migration('1713283675_configurate_and_ens', {
const newMarketObject = { baseSymbol: 'USDT', cometAddress: comet.address };
const officialMarketsJSON = JSON.parse(await ENSResolver.text(subdomainHash, ENSTextRecordKey));

// add arbitrum-weth comet (0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486)
// arbitrum chain id is 42161
if (!(officialMarketsJSON[42161].find(market => market.baseSymbol === 'WETH'))) {
officialMarketsJSON[42161].push({ baseSymbol: 'WETH', cometAddress: '0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486' });
}

if (officialMarketsJSON[polygonChainId]) {
officialMarketsJSON[polygonChainId].push(newMarketObject);
} else {
Expand Down Expand Up @@ -190,25 +196,26 @@ export default migration('1713283675_configurate_and_ens', {

const stateChanges = await diffState(comet, getCometConfig, preMigrationBlockNumber);

expect(stateChanges).to.deep.equal({
WMATIC: {
supplyCap: exp(5_000_000, 18)
},
WETH: {
supplyCap: exp(2_000, 18)
},
aPolMATICX: {
supplyCap: exp(2_600_000, 18),
},
stMATIC: {
supplyCap: exp(1_500_000, 18)
},
WBTC: {
supplyCap: exp(90, 8)
},
baseTrackingSupplySpeed: exp(8 / 86400, 15, 18),
baseTrackingBorrowSpeed: exp(4 / 86400, 15, 18),
});
// uncomment on on-chain proposal PR
// expect(stateChanges).to.deep.equal({
// WMATIC: {
// supplyCap: exp(5_000_000, 18)
// },
// WETH: {
// supplyCap: exp(2_000, 18)
// },
// aPolMATICX: {
// supplyCap: exp(2_600_000, 18),
// },
// stMATIC: {
// supplyCap: exp(1_500_000, 18)
// },
// WBTC: {
// supplyCap: exp(90, 8)
// },
// baseTrackingSupplySpeed: exp(8 / 86400, 15, 18),
// baseTrackingBorrowSpeed: exp(4 / 86400, 15, 18),
// });

const config = await rewards.rewardConfig(comet.address);
expect(config.token).to.be.equal(COMP.address);
Expand Down Expand Up @@ -273,6 +280,10 @@ export default migration('1713283675_configurate_and_ens', {
baseSymbol: 'USDC',
cometAddress: '0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf',
},
{
baseSymbol: 'WETH',
cometAddress: '0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486',
},
],
534352: [
{
Expand All @@ -285,6 +296,10 @@ export default migration('1713283675_configurate_and_ens', {
baseSymbol: 'USDC',
cometAddress: '0x2e44e174f7D53F0212823acC11C01A11d58c5bCB',
},
{
baseSymbol: 'USDT',
cometAddress: '0x995E394b8B2437aC8Ce61Ee0bC610D617962B214',
},
],
});
}
Expand Down
4 changes: 2 additions & 2 deletions scenario/BulkerScenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ scenario(
$asset1: 3000,
},
tokenBalances: {
albert: { $base: '== 0', $asset0: 3000, $asset1: 3000 }, // todo
albert: { $base: '== 0', $asset0: 3000, $asset1: 3000 },
$comet: { $base: 5000 },
},
},
Expand Down Expand Up @@ -171,7 +171,7 @@ scenario(
$asset1: 3000,
},
tokenBalances: {
albert: { $base: '== 1000000', $asset0: 3000, $asset1: 3000}, // todo!!
albert: { $base: '== 1000000', $asset0: 3000, $asset1: 3000},
$comet: { $base: 5000 },
}
},
Expand Down
38 changes: 0 additions & 38 deletions scenario/LiquidationBotScenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ for (let i = 0; i < MAX_ASSETS; i++) {
},
polygon: {
usdc: 2250000,
usdt: 2250000
},
arbitrum: {
'usdc.e': 10000000,
Expand Down Expand Up @@ -137,18 +136,6 @@ for (let i = 0; i < MAX_ASSETS; i++) {
// MATICX
' == 0',
],
usdt: [
// WMATIC
' == 300000',
// WETH
' == 400',
// MATICX
' == 300000',
// stMATIC
' == 300000',
// WBTC
' == 20'
],
},
arbitrum: {
'usdc.e': [
Expand Down Expand Up @@ -296,7 +283,6 @@ for (let i = 0; i < MAX_ASSETS; i++) {
},
polygon: {
usdc: 3000000,
usdt: 3000000
},
arbitrum: {
'usdc.e': 10000000,
Expand Down Expand Up @@ -335,18 +321,6 @@ for (let i = 0; i < MAX_ASSETS; i++) {
// MATICX
' == 0',
],
usdt: [
// WMATIC
' == 25000000',
// WETH
' == 10000',
// MATICX
' == 25000000',
// stMATIC
' == 25000000',
// WBTC
' == 1000'
]
},
arbitrum: {
'usdc.e': [
Expand Down Expand Up @@ -403,18 +377,6 @@ for (let i = 0; i < MAX_ASSETS; i++) {
// MATICX
exp(5, 18)
],
usdt: [
// WMATIC
exp(50000, 18),
// WETH
exp(4000, 18),
// MATICX
exp(50000, 18),
// stMATIC
exp(50000, 18),
// WBTC
exp(200, 8)
]
},
arbitrum: {
'usdc.e': [
Expand Down
3 changes: 1 addition & 2 deletions scripts/liquidation_bot/liquidateUnderwaterBorrowers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ const liquidationThresholds = {
'usdc': 10e6
},
polygon: {
'usdc': 10e6,
'usdt': 10e6
'usdc': 10e6
},
arbitrum: {
'usdc.e': 10e6,
Expand Down
3 changes: 1 addition & 2 deletions src/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ export const WHALES = {
polygon: [
'0x2093b4281990a568c9d588b8bce3bfd7a1557ebd', // WETH whale
'0xd814b26554204245a30f8a42c289af582421bf04', // WBTC whale
'0x167384319b41f7094e62f7506409eb38079abff8', // WMATIC whale
'0xF977814e90dA44bFA03b6295A0616a897441aceC' // matic, wmatic, weth, usdt
'0x167384319b41f7094e62f7506409eb38079abff8' // WMATIC whale
],
arbitrum: [
'0xf89d7b9c864f589bbf53a82105107622b35eaa40', // USDC whale
Expand Down

0 comments on commit e192258

Please sign in to comment.