Skip to content

Commit

Permalink
remove defunct jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ewansheldon committed Dec 13, 2024
1 parent ef04def commit 778d2f5
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 594 deletions.
4 changes: 0 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
const http = require('http');
require('dotenv').config();
const { schedulePricingIndexing } = require('./src/pricing');
const { scheduleIndexYieldData } = require('./src/yield');
// const { scheduleVaultTransactionIndexing } = require('./src/transactions');
const { scheduleLiquidation } = require('./src/liquidation');

const port = process.env.PORT || 3000;

schedulePricingIndexing();
scheduleIndexYieldData();
// scheduleVaultTransactionIndexing();
scheduleLiquidation();

const server = http.createServer(async (req, res) => {
Expand Down
25 changes: 0 additions & 25 deletions src/liquidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,6 @@ const getVaultManager = async _ => {
const scheduleLiquidation = async _ => {
const network = getNetwork('arbitrum');

// checks for undercollateralised vaults and liquidates
schedule.scheduleJob('6,36 * * * *', async _ => {
console.log('running liquidations')
const start = Math.floor(new Date / 1000);
const index = await getContract(network.name, 'SmartVaultIndex');
const { manager, wallet } = await getVaultManager();
const supply = Number((await getVaultSupply(wallet, manager)).toString());
for (let tokenID = 1; tokenID <= supply; tokenID++) {
const vaultAddress = await index.connect(wallet).getVaultAddress(tokenID);
const vault = await getContract(network.name, 'SmartVault', vaultAddress);
try {
if (await vault.connect(wallet).undercollateralised()) {
console.log(`liquidating ${tokenID}`)
const RewardGateway = await getContract(network.name, 'RewardGateway');
await RewardGateway.connect(wallet).liquidateVault(tokenID);
}
} catch (e) {
console.log('vault liquidation error', tokenID);
}
}
const end = Math.floor(new Date / 1000);

console.log(`liquidations complete ${end - start}s`)
});

// posts liquidation info to discord
schedule.scheduleJob('55 7 * * *', async _ => {
console.log('logging liquidation info');
Expand Down
62 changes: 0 additions & 62 deletions src/stats.js

This file was deleted.

Loading

0 comments on commit 778d2f5

Please sign in to comment.