Enum dex_v3::instruction::DexInstruction [−][src]
pub enum DexInstruction { CreateMarket(Params), NewOrder(Params), CancelOrder(Params), ConsumeEvents(Params), Settle(Params), InitializeAccount(Params), SweepFees, CloseAccount, CloseMarket, }
Expand description
Describes all possible instructions and their required accounts
Variants
CreateMarket(Params)
Creates a new DEX market
index | writable | signer | description |
---|---|---|---|
0 | ❌ | ❌ | The sysvar clock account |
1 | ✅ | ❌ | The market account |
2 | ❌ | ❌ | The orderbook account |
4 | ❌ | ❌ | The base token vault account |
5 | ❌ | ❌ | The quote token vault account |
6 | ❌ | ❌ | The Asset Agnostic Orderbook program account |
6 | ❌ | ❌ | The market admin account |
NewOrder(Params)
Execute a new order instruction. Supported types include Limit, IOC, FOK, or Post only.
index | writable | signer | description |
---|---|---|---|
0 | ❌ | ❌ | The asset agnostic orderbook program |
1 | ❌ | ❌ | The SPL token program |
3 | ❌ | ❌ | The system program |
4 | ❌ | ❌ | The rent sysvar |
5 | ✅ | ❌ | The DEX market |
6 | ❌ | ❌ | The DEX market signer |
7 | ✅ | ❌ | The orderbook |
8 | ✅ | ❌ | The event queue |
9 | ✅ | ❌ | The bids shared memory |
10 | ✅ | ❌ | The asks shared memory |
11 | ✅ | ❌ | The base token vault |
12 | ✅ | ❌ | The quote token vault |
13 | ✅ | ❌ | The DEX user account |
14 | ✅ | ❌ | The user’s source token account |
15 | ✅ | ❌ | The user’s wallet |
16 | ✅ | ❌ | The optional SRM or MSRM discount token account (must be owned by the user wallet) |
CancelOrder(Params)
Cancel an existing order and remove it from the orderbook.
index | writable | signer | description |
---|---|---|---|
0 | ❌ | ❌ | The asset agnostic orderbook program |
1 | ❌ | ❌ | The DEX market |
2 | ❌ | ❌ | The DEX market signer |
3 | ✅ | ❌ | The orderbook |
4 | ✅ | ❌ | The event queue |
5 | ✅ | ❌ | The bids shared memory |
6 | ✅ | ❌ | The asks shared memory |
7 | ✅ | ❌ | The DEX user ac count |
8 | ❌ | ✅ | The user’s wallet |
ConsumeEvents(Params)
Crank the processing of DEX events.
index | writable | signer | description |
---|---|---|---|
0 | ❌ | ❌ | The asset agnostic orderbook program |
1 | ❌ | ❌ | The DEX market |
2 | ❌ | ❌ | The DEX market signer |
3 | ✅ | ❌ | The orderbook |
4 | ✅ | ❌ | The event queue |
5 | ✅ | ❌ | The reward target |
6 | ❌ | ❌ | The MSRM token account |
7 | ❌ | ✅ | The MSRM token account owner |
8.. | ✅ | ❌ | The relevant user account |
Settle(Params)
Extract available base and quote token assets from a user account
index | writable | signer | description |
---|---|---|---|
0 | ❌ | ❌ | The asset agnostic orderbook program |
1 | ❌ | ❌ | The spl token program |
2 | ❌ | ❌ | The DEX market |
3 | ✅ | ❌ | The base token vault |
4 | ✅ | ❌ | The quote token vault |
5 | ❌ | ❌ | The DEX market signer |
6 | ✅ | ❌ | The DEX user account |
7 | ❌ | ✅ | The DEX user account owner wallet |
8 | ✅ | ❌ | The destination base token account |
9 | ✅ | ❌ | The destination quote token account |
InitializeAccount(Params)
Initialize a new user account
index | writable | signer | description |
---|---|---|---|
0 | ❌ | ❌ | The system program |
1 | ❌ | ❌ | The rent sysvar |
2 | ✅ | ❌ | The user account to initialize |
3 | ❌ | ✅ | The owner of the user account |
4 | ✅ | ✅ | The fee payer |
Extract accumulated fees from the market. This is an admin instruction
index | writable | signer | description |
---|---|---|---|
0 | ✅ | ❌ | The DEX market |
1 | ❌ | ❌ | The market signer |
2 | ❌ | ✅ | The market admin |
3 | ✅ | ❌ | The market quote token vault |
4 | ✅ | ❌ | The destination token account |
5 | ❌ | ❌ | The SPL token program |
Close an inactive and empty user account
index | writable | signer | description |
---|---|---|---|
0 | ✅ | ❌ | The user account to close |
1 | ❌ | ✅ | The owner of the user account to close |
2 | ✅ | ❌ | The target lamports account |