Skip to content

Commit

Permalink
fix(bybit): some accounts fail on this call
Browse files Browse the repository at this point in the history
  • Loading branch information
iam4x committed Jul 20, 2023
1 parent cf5d79d commit 82435a7
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/exchanges/bybit/bybit.exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,20 +433,21 @@ export class BybitExchange extends BaseExchange {
fetchLeverage = async () => {
for (const market of this.store.markets) {
if (!this.isDisposed) {
const {
data: {
result: {
list: [row],
try {
const { data } = await this.xhr.get(ENDPOINTS.POSITIONS, {
params: {
symbol: market.symbol,
category: this.accountCategory,
},
},
} = await this.xhr.get(ENDPOINTS.POSITIONS, {
params: {
symbol: market.symbol,
category: this.accountCategory,
},
});
});

this.leverageHash[row.symbol] = parseFloat(row.leverage);
const row = data?.result?.list?.[0];
if (row) {
this.leverageHash[row.symbol] = parseFloat(row.leverage);
}
} catch {
// do nothing
}
}
}
};
Expand Down

0 comments on commit 82435a7

Please sign in to comment.