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

Add phoenix subscriber #444

Merged

Conversation

jarry-xiao
Copy link
Contributor

Output from the example file:

image

sdk/package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "@drift-labs/sdk",
"version": "2.25.0",
"version": "2.26.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lmk if you prefer 2.25.1

this.subscribed = true;
}

public getBestBid(): number {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm having this return the price in human readable units. Lmk if you prefer something different

Copy link
Member

Choose a reason for hiding this comment

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

this and getBestAsk should be in PRICE_PRECISION to be consistent with SerumSubscriber

return new BN(bestAsk[0] * PRICE_PRECISION.toNumber());

this.subscribed = true;
}

public getBestBid(): number {
Copy link
Member

Choose a reason for hiding this comment

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

this and getBestAsk should be in PRICE_PRECISION to be consistent with SerumSubscriber

return new BN(bestAsk[0] * PRICE_PRECISION.toNumber());

this.marketCallbackId = await this.accountLoader.addAccount(
this.marketAddress,
(buffer, slot) => {
this.marketCallbackId = slot;
Copy link
Member

Choose a reason for hiding this comment

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

think you meant to update this.lastSlot here

this.clockCallbackId = await this.accountLoader.addAccount(
SYSVAR_CLOCK_PUBKEY,
(buffer, slot) => {
this.clockCallbackId = slot;
Copy link
Member

Choose a reason for hiding this comment

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

think you meant to update this.lastSlot here

@wphan wphan merged commit 882fdb2 into drift-labs:master Apr 25, 2023
crispheaney pushed a commit that referenced this pull request Apr 26, 2023
* Add phoenix subscriber

* Address PR comments
crispheaney added a commit that referenced this pull request Apr 27, 2023
* inital L2 and L3 methods

* vamm order prototype

* l2 orderbook uses vamm

* simplify the getL2 and getL3 function signatures

* getL2/getL3 methods on DLOBSubscriber

* tweak L2/L3 types

* work for serum

* tweak imports

* fix falsey check

* add http status code if DLOBApiClient fails

* v2.26.0-beta.0

* ts-sdk: add @ellipsis-labs/phoenix-sdk

* Add phoenix subscriber (#444)

* Add phoenix subscriber

* Address PR comments

* update CHANGELOG.md

* v2.26.0-beta.1

* program: check max_token_deposits at the end of fill_spot_order (#441)

* bigz/spot-fill-max-check

* address feedback bugs

* CHANGELOG

---------

Co-authored-by: Chris Heaney <[email protected]>

* program: fix overflow error in if staking math (#443)

* bigz/fix-large-insurance-math-error

* update CHANGELOG.md

* CHANGELOG

* fix warning

* jsdocs

* use getMakerLimitBids/Asks for now

---------

Co-authored-by: wphan <[email protected]>
Co-authored-by: Jarry Xiao <[email protected]>
Co-authored-by: bigzPubkey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants