Remove logger to cleanup branch
This commit is contained in:
parent
626223a3df
commit
30b430e0c8
|
@ -87,6 +87,7 @@ const runCron = async () => {
|
|||
const marginAccount = await client.getMarginAccount(connection, marginAccountPk, dexProgramId);
|
||||
const collateralRatio = marginAccount.getCollateralRatio(mangoGroups[alert.mangoGroupPk]['mangoGroup'], mangoGroups[alert.mangoGroupPk]['prices']);
|
||||
if ((100 * collateralRatio) <= alert.collateralRatioThresh) {
|
||||
console.log("Got an alert");
|
||||
let message = MESSAGE.replace('@ratio@', alert.collateralRatioThresh);
|
||||
message += marginAccount.toPrettyString(
|
||||
mangoGroups[alert.mangoGroupPk]['mangoGroup'],
|
||||
|
|
|
@ -53,6 +53,7 @@ export const validateEmail = (email: string) => {
|
|||
}
|
||||
|
||||
const sendSms = (phoneNumber: string, message: string) => {
|
||||
console.log(phoneNumber);
|
||||
const twilioClient = new Twilio(config.twilioSid, config.twilioToken);
|
||||
twilioClient.messages
|
||||
.create({
|
||||
|
@ -76,6 +77,7 @@ const sendEmail = (email: string, message: string) => {
|
|||
}
|
||||
|
||||
export const sendAlert = (alert: any, message: string) => {
|
||||
console.log(alert);
|
||||
if (alert.alertProvider == 'sms') {
|
||||
const phoneNumber = `+${alert.phoneNumber.code}${alert.phoneNumber.phone}`;
|
||||
sendSms(phoneNumber, message);
|
||||
|
|
Loading…
Reference in New Issue