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

subscribe to spot fills classes/methods are missing #96

Open
Triggsy22 opened this issue Jun 6, 2022 · 0 comments
Open

subscribe to spot fills classes/methods are missing #96

Triggsy22 opened this issue Jun 6, 2022 · 0 comments

Comments

@Triggsy22
Copy link

Hello,

in the example for 'subscribe-to-fills.ts', its described how to subscribe to fills for the perpMarket.
For the spotMarket, the classes SpotEventQueue and SpotEventQueueLayout are missing.

For my case i solved it this way:

    connection.onAccountChange(spotMarketConfig.eventsKey, (accountInfo, context) => {
        let events = decodeEventQueue(accountInfo.data, 100)
            .filter(
                (event) => event.eventFlags.fill && event.nativeQuantityPaid.gtn(0),
            );
        if(events.length > 0){
            console.log(events);
            ...
        }
    });

But i think a build in Mango Solution would be the best.

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

No branches or pull requests

1 participant