diff --git a/README.md b/README.md index 2f1a6ff..abd091d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,28 @@ # Mango transaction scraper -### Run +Collects and stores transactions made by the Mango program and Oracle program (used by the Mango program). +Does so by +* fetching new signatures from the program (getConfirmedSignaturesForAddress2) +* using those signatures to fetch transactions (getParsedConfirmedTransaction) +* parsing details of the transactions (looking at the token accounts and also transaction logs) +* stores details into a postgres database + +## Run +As the app requires the postgres database as a backend - it is not self contained. +However, if the postgres db is setup: ``` yarn install yarn start ``` + +## Configuration +Configuration is handled via environmental variables. +``` +export TRANSACTIONS_CONNECTION_STRING= +export REQUEST_WAIT_TIME= +export ORACLE_PROGRAM_ID= +export MANGO_PROGRAM_ID= +export CLUSTER_URL= +export CLUSTER= +export TRANSACTIONS_SCRAPER_WEBHOOK_URL= +``` \ No newline at end of file diff --git a/src/updatePnlCache/index.ts b/src/updatePnlCache/index.ts index 78f8342..5801a15 100644 --- a/src/updatePnlCache/index.ts +++ b/src/updatePnlCache/index.ts @@ -133,7 +133,7 @@ async function runCron() { notify('Initialized mango-pnl') console.log('Initialized mango-pnl') - // cron.schedule("*/10 * * * *", async () => { + cron.schedule("*/10 * * * *", async () => { try { console.log('updating cache') console.log((new Date()).toISOString()) @@ -147,7 +147,7 @@ async function runCron() { notify(e.toString()) throw e } - // }) + }) } runCron()