solana-labs / solana

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
https://solanalabs.com
Apache License 2.0
13.19k stars 4.3k forks source link

explorer: Parse Serum DEX and swap instructions #13171

Closed oJshua closed 4 years ago

oJshua commented 4 years ago

Problem

Currently, Serum DEX instructions appear as Unknown (see: https://explorer.solana.com/address/ErF6ptYb3tKzSZjLKBoTqYJPUkMQtPUeAGo16kGLdGVt/tokens). It would be useful for Explorer to decode the instructions to provide more detail.

Proposed Solution

Decode the DEX instructions to provide insight into the instructions used in Serum transactions.

spl-token-wallet implements transaction parsing for DEX instructions and others the UI commonly throws in (creating new accounts, initializing token accounts, etc.). https://github.com/project-serum/spl-token-wallet/blob/master/src/utils/transactions.js#L20

oJshua commented 4 years ago

Related: https://github.com/solana-labs/solana/issues/11935

oJshua commented 4 years ago

Swap instructions: https://github.com/solana-labs/oyster-swap/blob/master/src/models/tokenSwap.ts