fix division by 0 and correctly deploy from master branch
This commit is contained in:
parent
2740bb346d
commit
5ac0dc673d
|
@ -2,7 +2,6 @@ dist
|
|||
node_modules
|
||||
.vscode
|
||||
logs.*
|
||||
yarn.lock
|
||||
*.ps1
|
||||
*.env
|
||||
*.log
|
||||
*.log
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
"scripts": {
|
||||
"build": "tsc",
|
||||
"clean": "rm -rf dist",
|
||||
"prepare": "yarn clean && yarn build",
|
||||
"start": "node dist/index.js",
|
||||
"update-pnl-cache": "node dist/updatePnlCache/index.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
|
@ -33,4 +34,4 @@
|
|||
"engines": {
|
||||
"node": "14.x"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,8 @@ function ParseLiquidationData(instruction, instructionNum, confirmedTransaction)
|
|||
}
|
||||
}
|
||||
|
||||
let collRatio = startAssetsVal / startLiabsVal;
|
||||
// add epsilon to prevent exploding coll ratio
|
||||
let collRatio = startAssetsVal / (startLiabsVal+0.0001);
|
||||
let inTokenPrice = prices[symbols.indexOf(inTokenSymbol)];
|
||||
let outTokenPrice = prices[symbols.indexOf(outTokenSymbol)];
|
||||
|
||||
|
@ -272,7 +273,7 @@ function parseMangoTransactions(transactions) {
|
|||
|
||||
processStates.push({signature: signature, process_state: 'processed'});
|
||||
}
|
||||
} catch(e) {
|
||||
} catch(e: any) {
|
||||
console.log(e.stack)
|
||||
processStates.push({signature: signature, process_state: 'processing error'});
|
||||
}
|
||||
|
@ -594,7 +595,7 @@ async function main() {
|
|||
try {
|
||||
await consumeTransactions()
|
||||
}
|
||||
catch(e) {
|
||||
catch(e: any) {
|
||||
notify(e.toString())
|
||||
console.log(e, e.stack)
|
||||
// Wait for 10 mins
|
||||
|
|
|
@ -143,7 +143,7 @@ async function runCron() {
|
|||
|
||||
hrend = process.hrtime(hrstart)
|
||||
console.log('Execution time (hr): %ds %dms', hrend[0], hrend[1] / 1000000)
|
||||
} catch(e) {
|
||||
} catch(e: any) {
|
||||
notify(e.toString())
|
||||
throw e
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue