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
|
node_modules
|
||||||
.vscode
|
.vscode
|
||||||
logs.*
|
logs.*
|
||||||
yarn.lock
|
|
||||||
*.ps1
|
*.ps1
|
||||||
*.env
|
*.env
|
||||||
*.log
|
*.log
|
|
@ -6,6 +6,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"clean": "rm -rf dist",
|
"clean": "rm -rf dist",
|
||||||
|
"prepare": "yarn clean && yarn build",
|
||||||
"start": "node dist/index.js",
|
"start": "node dist/index.js",
|
||||||
"update-pnl-cache": "node dist/updatePnlCache/index.js",
|
"update-pnl-cache": "node dist/updatePnlCache/index.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
|
|
@ -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 inTokenPrice = prices[symbols.indexOf(inTokenSymbol)];
|
||||||
let outTokenPrice = prices[symbols.indexOf(outTokenSymbol)];
|
let outTokenPrice = prices[symbols.indexOf(outTokenSymbol)];
|
||||||
|
|
||||||
|
@ -272,7 +273,7 @@ function parseMangoTransactions(transactions) {
|
||||||
|
|
||||||
processStates.push({signature: signature, process_state: 'processed'});
|
processStates.push({signature: signature, process_state: 'processed'});
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e: any) {
|
||||||
console.log(e.stack)
|
console.log(e.stack)
|
||||||
processStates.push({signature: signature, process_state: 'processing error'});
|
processStates.push({signature: signature, process_state: 'processing error'});
|
||||||
}
|
}
|
||||||
|
@ -594,7 +595,7 @@ async function main() {
|
||||||
try {
|
try {
|
||||||
await consumeTransactions()
|
await consumeTransactions()
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e: any) {
|
||||||
notify(e.toString())
|
notify(e.toString())
|
||||||
console.log(e, e.stack)
|
console.log(e, e.stack)
|
||||||
// Wait for 10 mins
|
// Wait for 10 mins
|
||||||
|
|
|
@ -143,7 +143,7 @@ async function runCron() {
|
||||||
|
|
||||||
hrend = process.hrtime(hrstart)
|
hrend = process.hrtime(hrstart)
|
||||||
console.log('Execution time (hr): %ds %dms', hrend[0], hrend[1] / 1000000)
|
console.log('Execution time (hr): %ds %dms', hrend[0], hrend[1] / 1000000)
|
||||||
} catch(e) {
|
} catch(e: any) {
|
||||||
notify(e.toString())
|
notify(e.toString())
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue