Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release alpha #319

Open
wants to merge 46 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
51d31a2
feat: calculate buy/sell panel estimate
fubar May 23, 2024
f71e556
chore: remove unused pipmath export
fubar May 23, 2024
808e858
Merge pull request #318 from idexio/feat/buy-sell-panel-estimate
fubar May 23, 2024
3d4bf20
chore(release): 4.0.0-alpha.8 [skip ci]
idex-bot May 23, 2024
a43e373
Merge branch 'beta' into chore/update-alpha
fubar May 23, 2024
f747654
Merge pull request #321 from idexio/chore/update-alpha
fubar May 23, 2024
79e5916
chore(release): 4.0.0-alpha.9 [skip ci]
idex-bot May 23, 2024
3510957
feat: buy/sell panel estimate by desired trade qty (base or quote)
fubar May 23, 2024
6759dbf
Merge pull request #322 from idexio/feat/buy-sell-estimate-accept-des…
jurosh May 23, 2024
231945e
chore(release): 4.0.0-alpha.10 [skip ci]
idex-bot May 23, 2024
4e967cd
feat: improve type declarations of mutually exclusive arguments
fubar May 24, 2024
d61cee5
Merge pull request #323 from idexio/feat/improve-buy-sell-estimate-ty…
fubar May 24, 2024
60248ce
chore(release): 4.0.0-alpha.11 [skip ci]
idex-bot May 24, 2024
a3b3617
feat(buy/sell panel): support trades that increase available collateral
fubar May 24, 2024
f032024
Merge pull request #324 from idexio/feat/buy-sell-estimate-support-in…
fubar May 24, 2024
ebee6bc
chore(release): 4.0.0-alpha.12 [skip ci]
idex-bot May 24, 2024
b10abf4
feat(buy/sell panel): support taker limit price input
fubar May 28, 2024
d3c7234
feat: calculate max maker order size for available collateral
fubar May 28, 2024
ce899d1
Merge pull request #326 from idexio/feat/orderbook-realtime-perf
bradennapier May 28, 2024
667a3a8
chore(release): 4.0.0-alpha.13 [skip ci]
idex-bot May 28, 2024
8bb0cc5
Merge pull request #327 from idexio/feat/orderbook-realtime-perf
bradennapier May 28, 2024
3e6f7b5
chore(release): 4.0.0-alpha.14 [skip ci]
idex-bot May 28, 2024
ba78b5f
feat: merge beta to alpha
bradennapier May 28, 2024
114c9b3
Merge branch 'alpha' of github.com:idexio/idex-sdk-js into alpha
bradennapier May 28, 2024
a5976fe
chore(release): 4.0.0-alpha.15 [skip ci]
idex-bot May 28, 2024
d48470f
feat(buy/sell panel): calculate maker order size (quantities)
fubar May 28, 2024
fe63ae3
Merge branch 'alpha' into feat/buy-sell-panel-estimate-extensions
fubar May 28, 2024
0195bba
Merge pull request #325 from idexio/feat/buy-sell-panel-estimate-exte…
fubar May 28, 2024
4991206
chore(release): 4.0.0-alpha.16 [skip ci]
idex-bot May 28, 2024
02f35e5
fix(buy/sell panel): maker order IMR is based on limit (not index) price
fubar May 29, 2024
9eb671f
feat(buy/sell panel): calculate maker order size by desired trade qty
fubar May 29, 2024
3957057
feat(buy/sell panel): return all values unsigned
fubar May 29, 2024
3357f19
feat(buy/sell panel): add cost to returned values
fubar May 29, 2024
de10932
Merge pull request #329 from idexio/feat/buy-sell-panel-estimate-exte…
fubar May 29, 2024
c11d8e3
chore(release): 4.0.0-alpha.17 [skip ci]
idex-bot May 29, 2024
46a5f14
fix(buy/sell panel): maker qtys are wrong for sells
fubar Jun 3, 2024
bdff536
Merge pull request #330 from idexio/fix/buy-sell-estimate-wrong-maker…
fubar Jun 3, 2024
9b098fa
chore(release): 4.0.0-alpha.18 [skip ci]
idex-bot Jun 3, 2024
a789721
fix: obs realtime client applies indexPrice changes
yennieb Jun 4, 2024
850e420
Merge pull request #331 from idexio/fix/obs-realtime-client-index-pri…
yennieb Jun 4, 2024
6f7e5de
chore(release): 4.0.0-alpha.19 [skip ci]
idex-bot Jun 4, 2024
761a306
Merge branch 'alpha' into chore/update-alpha
fubar Jun 28, 2024
cf45c83
Merge pull request #338 from idexio/chore/update-alpha
fubar Jun 28, 2024
90b0406
chore(release): 4.0.0-alpha.20 [skip ci]
idex-bot Jun 28, 2024
25f9f7e
test(buy/sell panel): cover reduction of positions
fubar Jul 1, 2024
cd7ab72
Merge pull request #339 from idexio/test/buy-sell-panel-estimate-redu…
fubar Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@idexio/idex-sdk",
"version": "4.0.0-beta.12",
"version": "4.0.0-alpha.14",
"description": "IDEX SDK for Javascript in the browser and Node.js",
"repository": "git@github.com:idexio/idex-sdk-js.git",
"license": "MIT",
Expand Down Expand Up @@ -103,6 +103,8 @@
"lint": "eslint --cache 'src/**/*.ts'",
"lint:fix": "eslint --cache 'src/**/*.ts' --fix",
"lint:fix:staged": "lint-staged",
"lint:fix:staged-and-modified": "eslint --cache --fix $(git diff --name-only HEAD | grep -E '\\.(ts|tsx)$' | xargs) && yarn lint:prettier:staged-and-modified",
"lint:prettier:staged-and-modified": "prettier --write $(git diff --name-only HEAD | grep -E '\\.(ts|tsx)$' | xargs)",
"lint:types": "yarn exec tsc --noEmit",
"on:commit": "npm-run-all build test --parallel lint:fix:staged lint:types --",
"orderbook:demo": "yarn node dist/orderbook/demo.js",
Expand Down Expand Up @@ -162,7 +164,7 @@
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "npm:eslint-plugin-i@2.29.1",
"eslint-plugin-import": "npm:eslint-plugin-i@latest",
"eslint-plugin-promise": "^6.1.1",
"globals": "^15.2.0",
"lint-staged": "^15.2.2",
Expand Down
18 changes: 11 additions & 7 deletions src/client/orderBook/realTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class OrderBookRealTimeClient extends EventEmitter<{
this.unsubscribe();
this.webSocketClient.disconnect();
}
this.resetInternalState();
this.resetInternalState(true);
}

public async getMaximumTickSizeUnderSpread(market: string) {
Expand Down Expand Up @@ -287,9 +287,10 @@ export class OrderBookRealTimeClient extends EventEmitter<{
}

const beforeL1 = L2toL1OrderBook(book);

for (const update of updates) {
// outdated sequence, ignore
if (book.sequence > update.sequence) {
if (book.sequence >= update.sequence) {
// eslint-disable-next-line no-continue
continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary continue statement to simplify the loop logic.

-        continue;

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
continue;

}
Expand All @@ -305,9 +306,9 @@ export class OrderBookRealTimeClient extends EventEmitter<{
`Missing l2 update sequence, current book is ${book.sequence} message was ${update.sequence}`,
),
);
this.unsubscribe();
// this.unsubscribe();
this.resetInternalState();
this.subscribe();
// this.subscribe();

// eslint-disable-next-line no-await-in-loop
await this.synchronizeFromRestApi();
Expand Down Expand Up @@ -409,10 +410,13 @@ export class OrderBookRealTimeClient extends EventEmitter<{
}
}

private resetInternalState() {
private resetInternalState(includeUpdates = false) {
this.l1OrderBooks.clear();
this.l2OrderBooks.clear();
this.l2OrderBookUpdates.clear();
if (includeUpdates) {
this.l2OrderBookUpdates.clear();
}
//
}

/* Connection management */
Expand Down Expand Up @@ -456,7 +460,7 @@ export class OrderBookRealTimeClient extends EventEmitter<{

private webSocketHandleDisconnect() {
// Assume messages will be lost during disconnection and clear state. State will be re-synchronized again on reconnect
this.resetInternalState();
this.resetInternalState(true);

this.emit(OrderBookRealTimeClientEvent.disconnected);
}
Expand Down
Loading
Loading