From 7f31487979fdd2404c6c6e8b39cbe4f257cc848f Mon Sep 17 00:00:00 2001 From: Ewan Sheldon Date: Fri, 8 Dec 2023 12:12:24 +0100 Subject: [PATCH] sort by snapshot date --- src/liquidationPools.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/liquidationPools.js b/src/liquidationPools.js index 4920d6d..fb32b13 100644 --- a/src/liquidationPools.js +++ b/src/liquidationPools.js @@ -20,7 +20,8 @@ const getDBData = async userAddress => { let result = []; const client = await pool.connect(); try { - result = (await client.query('SELECT snapshot_at, assets FROM user_pool_snapshots_sepolia where user_address = $1', [userAddress])).rows; + const query = 'SELECT snapshot_at, assets FROM user_pool_snapshots_sepolia where user_address = $1 ORDER BY snapshot_at ASC'; + result = (await client.query(query, [userAddress])).rows; } finally { client.release(); }