Bonfida / dex-v4

Orderbook-based on-chain SPL token swap market
101 stars 32 forks source link

No orders returning in loadOrdersForOwner #90

Closed petrucioinica99 closed 2 years ago

petrucioinica99 commented 2 years ago

When trying to get a wallet's orders for a market, the function always returns an empty array, even though the wallet has open orders.

The issue seems to be that in the filterForOpenOrdersFromSlab function, where openOrders?.address.equals(new PublicKey(o.callbackInfo.slice(32))) //market.ts, line 711

is called. The public key created from o.callbackInfo.slice(32) always results in ''11111111111111111111111111111111" - this being the toString value of the created public key.

dr497 commented 2 years ago

Can you provide the wallet address and the market ID?

petrucioinica99 commented 2 years ago

Market ID: wUYvayJxdPwXRFuf7E8y9LVSHuVkXhbZWNEbcE2DgTJ Wallet address: DrkEjikTWi6VzeLykTaduG9hdXerjiZBMSrhEgb7mX4c or 6e5HM4FSHx8rUvcwdPZGEMMob5bReWn95zzUMJvAn4DU

One should have open bids, the other open asks

dr497 commented 2 years ago

Thanks. My original fix (https://github.com/Bonfida/dex-v4/issues/88) was wrong. This commit should fix it for good https://github.com/Bonfida/dex-v4/commit/2bc9a93c715341c19c55888d2b1a9a6a32978c87.

Thanks for your help!

petrucioinica99 commented 2 years ago

Thanks, too! Now it works.