Skip to content

Commit 991e074

Browse files
authored
fix: Revive auction notifications (#613)
1 parent b73c8e8 commit 991e074

File tree

8 files changed

+37
-229
lines changed

8 files changed

+37
-229
lines changed

bot/package-lock.json

+29-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bot/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"bignumber.js": "^9.0.1",
3434
"core-js": "^3.15.2",
3535
"nuxt": "^2.15.8",
36-
"twitter-api-v2": "^1.8.0"
36+
"twitter-api-v2": "^1.15.1"
3737
},
3838
"devDependencies": {
3939
"@nuxt/types": "^2.15.8",

bot/src/auctions/surplus.ts

-48
This file was deleted.

bot/src/index.ts

-8
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import { setupSupportedAuctionTypes, getSupportedAuctionTypes } from './supporte
55
import { setupWhitelistedCollaterals } from './whitelist';
66
import { setupTwitter } from './twitter';
77
import { setupCollateralKeeper } from './keepers/collateral';
8-
import { setupSurplusKeeper } from './keepers/surplus';
98
import { setupDebtKeeper } from './keepers/debt';
109
import { loopCollateral } from './auctions/collateral';
11-
import { loopSurplus } from './auctions/surplus';
1210
import { loopDebt } from './auctions/debt';
1311

1412
const start = async function (): Promise<void> {
@@ -24,12 +22,6 @@ const start = async function (): Promise<void> {
2422
setInterval(() => loopCollateral(network), REFETCH_INTERVAL_MS);
2523
}
2624

27-
if (getSupportedAuctionTypes().includes('SURPLUS')) {
28-
await setupSurplusKeeper(network);
29-
loopSurplus(network);
30-
setInterval(() => loopSurplus(network), REFETCH_INTERVAL_MS);
31-
}
32-
3325
if (getSupportedAuctionTypes().includes('DEBT')) {
3426
await setupDebtKeeper(network);
3527
loopDebt(network);

bot/src/keepers/surplus.ts

-146
This file was deleted.

bot/src/notify.ts

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AuctionInitialInfo, SurplusAuctionActive, DebtAuctionActive } from 'auctions-core/src/types';
1+
import type { AuctionInitialInfo, DebtAuctionActive } from 'auctions-core/src/types';
22
import { formatToAutomaticDecimalPointsString } from 'auctions-core/src/helpers/formatToAutomaticDecimalPoints';
33
import { sendNotification } from './twitter';
44

@@ -9,13 +9,6 @@ const generateNotificationTextCollateral = function (auction: AuctionInitialInfo
99
return `Collateral auction with ${formattedString} ${auction.collateralSymbol} just started. Follow the link to participate: ${url}`;
1010
};
1111

12-
const generateNotificationTextSurplus = function (auction: SurplusAuctionActive): string {
13-
const url = `${process.env.FRONTEND_ORIGIN}/surplus/?network=${auction.network}&auction=${auction.id}`;
14-
return `Surplus auction with ${formatToAutomaticDecimalPointsString(
15-
auction.receiveAmountDAI
16-
)} DAI just started. Follow the link to participate: ${url}`;
17-
};
18-
1912
const generateNotificationTextDebt = function (auction: DebtAuctionActive): string {
2013
const url = `${process.env.FRONTEND_ORIGIN}/debt/?network=${auction.network}&auction=${auction.id}`;
2114
return `Debt auction with fixed bid amount of ${formatToAutomaticDecimalPointsString(
@@ -31,12 +24,6 @@ export const notifyCollateral = async function (auction: AuctionInitialInfo) {
3124
await sendNotification(text);
3225
};
3326

34-
export const notifySurplus = async function (auction: SurplusAuctionActive) {
35-
const text = generateNotificationTextSurplus(auction);
36-
console.info(`Surplus auction notification: "${text}"`);
37-
await sendNotification(text);
38-
};
39-
4027
export const notifyDebt = async function (auction: DebtAuctionActive) {
4128
const text = generateNotificationTextDebt(auction);
4229
console.info(`Debt auction notification: "${text}"`);

bot/src/supported.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { SUPPORTED_AUCTION_TYPES } from './variables';
22

3-
const ALL_SUPPORTED_AUCTION_TYPES = ['COLLATERAL', 'SURPLUS', 'DEBT'] as const;
3+
const ALL_SUPPORTED_AUCTION_TYPES = ['COLLATERAL', 'DEBT'] as const;
44

55
export const getSupportedAuctionTypes = function () {
66
if (!SUPPORTED_AUCTION_TYPES) {

0 commit comments

Comments
 (0)