Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Bonfida/dex-v4
/ functions
Functions
259 in github.com/Bonfida/dex-v4
⨍
Functions
259
◇
Types & classes
89
↓ 31 callers
Function
sign_send_instructions
( ctx: &mut ProgramTestContext, instructions: Vec<Instruction>, signers: Vec<&Keypair>, )
program/tests/common/utils.rs:17
↓ 29 callers
Function
check_account_key
Safety verification functions
program/src/utils.rs:12
↓ 29 callers
Function
random
(min: number, max: number, int?: boolean)
js/tests/utils/random.ts:1
↓ 28 callers
Method
retrieve
(connection: Connection, market: PublicKey)
js/src/state.ts:115
↓ 22 callers
Function
check_account_owner
( account: &AccountInfo, owner: &Pubkey, error: DexError, )
program/src/utils.rs:23
↓ 19 callers
Function
placeOrder
( market: Market, side: Side, limitPrice: number, size: number, type: OrderType, selfTradeBehaviou
js/src/bindings.ts:174
↓ 14 callers
Method
from
(e: DexError)
program/src/error.rs:63
↓ 12 callers
Function
computeFp32Price
(market: Market, uiPrice: number)
js/src/utils.ts:47
↓ 12 callers
Function
create_associated_token
( prg_test_ctx: &mut ProgramTestContext, mint: &Pubkey, owner: &Pubkey, )
program/tests/common/utils.rs:32
↓ 12 callers
Method
load
* * @param connection The solana connection object to the RPC node * @param address Address of the Serum market to load * @param programId Pr
js/src/market.ts:160
↓ 11 callers
Function
process
( program_id: &Pubkey, accounts: &[AccountInfo], instruction_data: &[u8], )
program/src/processor/swap.rs:163
↓ 10 callers
Method
getInstruction
( programId: PublicKey, splTokenProgram: PublicKey, systemProgram: PublicKey, market: PublicKe
js/src/raw_instructions.ts:727
↓ 9 callers
Function
settle
( market: Market, owner: PublicKey, destinationBaseAccount: PublicKey, destinationQuoteAccount: Public
js/src/bindings.ts:315
↓ 7 callers
Function
check_signer
(account: &AccountInfo)
program/src/utils.rs:34
↓ 7 callers
Function
createContext
( connection: Connection, feePayer: Keypair, tickSize: BN, minBaseOrderSize: BN, baseDecimals: numbe
js/tests/utils/context.ts:21
↓ 6 callers
Function
computeTakerFee
(orderSize: BN)
js/tests/utils/fee.ts:4
↓ 6 callers
Function
consumeEvents
( market: Market, rewardTarget: PublicKey, userAccounts: PublicKey[], maxIterations: BN, noOpErr: BN
js/src/bindings.ts:356
↓ 6 callers
Function
create_serum_dex_account
( pgr_test_ctx: &ProgramTestContext, serum_program_id: Pubkey, unpadded_len: usize, )
program/tests/common/performance_test_utils.rs:381
↓ 6 callers
Function
simpleTrade
( connection: Connection, feePayer: Keypair, baseDecimals: number, quoteDecimals: number, minPrice:
js/tests/simple-trade.ts:26
↓ 5 callers
Method
_sendTransaction
* * @param connection The solana connection object to the RPC node * @param transaction The transaction to sign and send * @param signers The
js/src/market.ts:521
↓ 5 callers
Function
checkTokenBalances
( connection: Connection, tokenAccount: PublicKey, expected: BN )
js/tests/utils/token-balances.ts:6
↓ 5 callers
Function
initializeAccount
( market: PublicKey, owner: PublicKey, maxOrders = 20, feePayer?: PublicKey, programId = DEX_ID )
js/src/bindings.ts:281
↓ 5 callers
Function
initializeTraders
( connection: Connection, base: TokenMint, quote: TokenMint, Alice: Keypair, Bob: Keypair, feePaye
js/tests/utils/context.ts:125
↓ 5 callers
Method
loadAsks
* * @param connection The solana connection object to the RPC node * @returns The decoded asks of the market
js/src/market.ts:336
↓ 5 callers
Method
loadBids
* * @param connection The solana connection object to the RPC node * @returns The decoded bids of the market
js/src/market.ts:326
↓ 5 callers
Method
parseAsksSlab
(slab: Slab, depth: number)
js/src/market.ts:774
↓ 5 callers
Method
parseBidsSlab
(slab: Slab, depth: number)
js/src/market.ts:777
↓ 5 callers
Method
taker_fee
(self, quote_qty: u64)
program/src/state.rs:417
↓ 4 callers
Function
cancelOrder
( market: Market, owner: PublicKey, orderId: BN, orderIndex?: BN, clientOrderId?: BN )
js/src/bindings.ts:243
↓ 4 callers
Function
closeAccount
( market: PublicKey, owner: PublicKey, programId = DEX_ID )
js/src/bindings.ts:381
↓ 4 callers
Function
divideBnToNumber
(numerator: BN, denominator: BN)
js/src/utils.ts:39
↓ 4 callers
Function
fp32_mul
a is fp0, b is fp32 and result is a*b fp0
program/src/utils.rs:51
↓ 4 callers
Function
mint_bootstrap
( address: Option<&str>, decimals: u8, program_test: &mut ProgramTest, mint_authority: &Pubkey
program/tests/common/utils.rs:48
↓ 4 callers
Function
new_order
( program_id: Pubkey, accounts: new_order::Accounts<Pubkey>, params: new_order::Params, )
program/src/instruction_auto.rs:167
↓ 4 callers
Method
referral_fee
(self, quote_qty: u64)
program/src/state.rs:428
↓ 4 callers
Function
swapTest
( connection: Connection, feePayer: Keypair, baseDecimals: number, quoteDecimals: number, minPrice:
js/tests/swap.ts:18
↓ 3 callers
Function
check_metadata_account
(account: &AccountInfo, mint: &Pubkey)
program/src/utils.rs:66
↓ 3 callers
Function
consume_events
Crank the processing of DEX events.
program/src/instruction_auto.rs:191
↓ 3 callers
Function
getMetadataKeyFromMint
(mint: PublicKey)
js/src/metadata.ts:8
↓ 3 callers
Function
orderbookTest
( connection: Connection, feePayer: Keypair, baseDecimals: number, quoteDecimals: number, minPrice:
js/tests/orderbook.ts:22
↓ 3 callers
Method
taker_rate
(self)
program/src/state.rs:391
↓ 3 callers
Function
throwIfNull
( value: T | null, message = "account not found" )
js/src/utils.ts:5
↓ 3 callers
Method
unscale_order_summary
(&self, order_summary: &mut OrderSummary)
program/src/state.rs:129
↓ 2 callers
Method
_parseSlab
(slab: Slab, depth: number, increasing: boolean)
js/src/market.ts:761
↓ 2 callers
Function
check_vault_account_and_get_mint
( account: &AccountInfo, market_signer: &Pubkey, )
program/src/processor/create_market.rs:211
↓ 2 callers
Function
closeMarket
(market: Market, target: PublicKey)
js/src/bindings.ts:454
↓ 2 callers
Function
close_account
Close an inactive and fully settled account
program/src/instruction_auto.rs:223
↓ 2 callers
Function
computeUiPrice
(market: Market, fp32Price: BN)
js/src/utils.ts:65
↓ 2 callers
Function
create_aob_market_and_accounts
Creates the accounts needed for the AAOB market testing and returns the address of the market.
program/tests/common/utils.rs:88
↓ 2 callers
Function
create_market
Create a new DEX market The asset agnostic orderbook must be properly initialized beforehand.
program/src/instruction_auto.rs:159
↓ 2 callers
Method
filterForOpenOrdersFromSlab
* * @param slab Slab to extract open orders from * @param openOrders Open orders account * @returns
js/src/market.ts:720
↓ 2 callers
Function
getFeeTier
(msrmBalance: number, srmBalance: number)
js/src/fees.ts:55
↓ 2 callers
Function
getMintDecimals
( connection: Connection, mint: PublicKey )
js/src/utils.ts:15
↓ 2 callers
Function
initialize_account
Initialize a new user account
program/src/instruction_auto.rs:207
↓ 2 callers
Method
loadSlab
* * @param connection The solana connection object to the RPC node * @param slabAddress The address of the Slab * @returns A deserialized Sla
js/src/orderbook.ts:61
↓ 2 callers
Method
makeCancelOrderInstruction
* * @param orderIndex The index of the order in the open order account * @param owner The owner of the order * @returns
js/src/market.ts:545
↓ 2 callers
Method
parse
( program_id: &Pubkey, accounts: &'a [AccountInfo<'b>], has_discount_token_account: bo
program/src/processor/swap.rs:109
↓ 2 callers
Method
remove_order
(&mut self, order_index: usize)
program/src/state.rs:260
↓ 2 callers
Method
remove_taker_fee
(self, quote_qty: u64)
program/src/state.rs:412
↓ 2 callers
Method
scale_base_amount
(&self, raw_base_amount: u64)
program/src/state.rs:117
↓ 2 callers
Method
scale_quote_amount
(&self, raw_quote_amount: u64)
program/src/state.rs:113
↓ 2 callers
Function
sweepFees
( connection: Connection, market: Market, destination: PublicKey, feePayer: PublicKey )
js/src/bindings.ts:479
↓ 2 callers
Method
unscale_base_amount
(&self, scaled_base_amount: u64)
program/src/state.rs:125
↓ 2 callers
Function
verify_metadata
(creators: &[Creator])
program/src/utils.rs:97
↓ 1 callers
Function
abortTx
()
js/tests/self-trade.ts:150
↓ 1 callers
Method
add_order
(&mut self, order: Order)
program/src/state.rs:272
↓ 1 callers
Function
aob_dex_new_order
( pgr_test_ctx: &mut ProgramTestContext, dex_test_ctx: &AobDexTestContext, side: asset_agnostic_or
program/tests/common/performance_test_utils.rs:399
↓ 1 callers
Method
baseSplSizeToNumber
Returns the base token multiplier
js/src/market.ts:312
↓ 1 callers
Function
check_accounts
( program_id: &Pubkey, market_state: &DexState, accounts: &Accounts<AccountInfo>, )
program/src/processor/close_market.rs:206
↓ 1 callers
Function
check_accounts
(market_state: &DexState, accounts: &Accounts<AccountInfo>)
program/src/processor/new_order.rs:437
↓ 1 callers
Function
check_accounts
( program_id: &Pubkey, market_state: &DexState, accounts: &Accounts<AccountInfo>, )
program/src/processor/swap.rs:390
↓ 1 callers
Function
check_accounts
(market_state: &DexState, accounts: &Accounts<AccountInfo>)
program/src/processor/cancel_order.rs:204
↓ 1 callers
Function
check_accounts
( program_id: &Pubkey, market_state: &DexState, accounts: &Accounts<AccountInfo>, )
program/src/processor/settle.rs:172
↓ 1 callers
Function
check_accounts
( program_id: &Pubkey, market_state: &DexState, accounts: &Accounts<AccountInfo>, )
program/src/processor/sweep_fees.rs:186
↓ 1 callers
Function
check_accounts
(market_state: &DexState, accounts: &Accounts<AccountInfo>)
program/src/processor/consume_events.rs:147
↓ 1 callers
Function
check_rent
(accounts: &Accounts<'a, AccountInfo>)
program/src/processor/create_market.rs:227
↓ 1 callers
Function
computeRoyalties
(orderSize: BN, royalties: BN)
js/tests/utils/fee.ts:10
↓ 1 callers
Function
consume_event
( accounts: &[AccountInfo], event: EventRef<CallBackInfo>, market_state: &mut DexState, )
program/src/processor/consume_events.rs:156
↓ 1 callers
Method
consume_events_iteration
( &self, connection: &RpcClient, orderbook: &MarketState, market_state: &DexSt
cranker/src/lib.rs:62
↓ 1 callers
Method
crank
(self)
cranker/src/lib.rs:40
↓ 1 callers
Function
createMarket
( connection: Connection, baseMint: PublicKey, quoteMint: PublicKey, minBaseOrderSize: BN, feePayer:
js/src/bindings.ts:56
↓ 1 callers
Function
createMarketTest
( connection: Connection, feePayer: Keypair )
js/tests/create-market.ts:13
↓ 1 callers
Function
create_aob_dex
Creates an aob dex market along with all needed accounts Returns Dex market state pubkey, user account key, and test context
program/tests/common/performance_test_utils.rs:63
↓ 1 callers
Function
dev
()
js/src/test.ts:26
↓ 1 callers
Function
error
(connection: Connection, feePayer: Keypair)
js/tests/error.ts:18
↓ 1 callers
Function
failCloseAccount
()
js/tests/error.ts:122
↓ 1 callers
Function
failConsumeEvent
()
js/tests/error.ts:77
↓ 1 callers
Function
failOrder
()
js/tests/error.ts:50
↓ 1 callers
Function
failPostOnly
()
js/tests/error.ts:105
↓ 1 callers
Method
filterForOpenOrders
* * @param orderbook The orderbook of the market * @param openOrder The openOrder that owns the orders * @returns
js/src/market.ts:745
↓ 1 callers
Method
findOpenOrdersAccountForOwner
* Fetch the open order account of the owner * @param owner The public key of the owner * @returns The public key of the open order account
js/src/market.ts:393
↓ 1 callers
Method
find_order_id_and_index_by_client_id
( &self, client_order_id: u128, )
program/src/state.rs:295
↓ 1 callers
Method
find_order_index
(&self, order_id: u128)
program/src/state.rs:283
↓ 1 callers
Function
fp32_div
a is fp0, b is fp32 and result is a/b fp0
program/src/utils.rs:44
↓ 1 callers
Method
get
( account_info: &'a AccountInfo<'b>, )
program/src/state.rs:96
↓ 1 callers
Function
getFilter
(mint: string)
js/src/test.ts:9
↓ 1 callers
Function
getTokenBalance
( connection: Connection, address: PublicKey )
js/src/utils.ts:27
↓ 1 callers
Method
get_quote_from_base
( &self, raw_base_amount: u64, scaled_price_fp32: u64, )
program/src/state.rs:137
↓ 1 callers
Function
initializePayer
( connection: Connection )
js/tests/utils/validator.ts:25
↓ 1 callers
Function
initialize_serum_market_accounts
( pgr_test_ctx: &mut ProgramTestContext, aob_dex_test_ctx: &AobDexTestContext, serum_dex_program_i
program/tests/common/performance_test_utils.rs:268
next →
1–100 of 259, ranked by callers