Skip to content

Commit d0c711c

Browse files
Patrick BanksPatrick Banks
authored andcommitted
Fixed bug balances not caching
1 parent 2bf1d8c commit d0c711c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/trader/apis/binance.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ export async function fetchBalance(type: WalletType): Promise<ccxt.Balances> {
8888
.then((value) => {
8989
logger.silly(`Fetched balance: ${JSON.stringify(value)}`)
9090
logger.debug(`Loaded ${Object.keys(value).length} ${type} balances.`)
91+
92+
// Cache for next time
93+
balances[type] = value
94+
balanceTimestamps[type] = Date.now()
95+
9196
return value
9297
})
9398
.catch((reason) => {

0 commit comments

Comments
 (0)