MCPcopy Create free account

hub / github.com/Py-Ec/solana-arbitrage-bot / functions

Functions241 in github.com/Py-Ec/solana-arbitrage-bot

↓ 55 callersMethodclone
(&self)
client/src/serialize/token.rs:43
↓ 17 callersFunctionderive_token_address
(owner: &Pubkey, mint: &Pubkey)
client/src/utils.rs:32
↓ 14 callersMethodclone
(&self)
client/src/pool_utils/base.rs:183
↓ 10 callersFunctionunpack_token_account
(data: &[u8])
client/src/serialize/token.rs:137
↓ 9 callersFunctionfee_tenth_of_bps
(tenth_of_bps: u64)
client/src/pool_utils/serum.rs:76
↓ 9 callersMethodfloor
(self)
client/src/pool_utils/serum.rs:60
↓ 9 callersMethodswap_without_fees
Constant price curve always returns 1:1
client/src/pool_utils/constant_price.rs:67
↓ 7 callersFunctioncompute_d
Compute stable swap invariant (D) Equation: A * sum(x_i) * n**n + D = A * D * n**n + D**(n+1) / (n**n * prod(x_i))
client/src/pool_utils/stable.rs:120
↓ 6 callersFunctionaccount_info
(pk: &'a Pubkey, account: &'a mut Account)
client/src/pools/serum.rs:62
↓ 6 callersMethodadd
(self, other: U64F64)
client/src/pool_utils/serum.rs:45
↓ 6 callersFunctionchecked_u8_mul
Returns self multiplied by b
client/src/pool_utils/stable.rs:87
↓ 6 callersMethodderef_mut
(&mut self)
client/src/serialize/token.rs:62
↓ 6 callersMethodswap
Subtract fees and calculate how much destination token will be provided given an amount of source token.
client/src/pool_utils/base.rs:71
↓ 6 callersMethodswap_without_fees
Constant product swap ensures token a * (token b + offset) = constant This is guaranteed to work for all values such that: - 1 <= source_amount <= u64
client/src/pool_utils/offset.rs:40
↓ 5 callersFunctioncompute_a
Calculates A for deriving D Per discussion with the designer and writer of stable curves, this A is not the same as the A from the whitepaper, it's a
client/src/pool_utils/stable.rs:73
↓ 5 callersMethodget_mints
(&self)
client/src/pools/orca.rs:193
↓ 5 callersFunctionread_dir_names
(dir_name: string)
mainnet-fork/new_scrape.ts:9
↓ 5 callersMethodswap_without_fees
Stable curve
client/src/pool_utils/stable.rs:191
↓ 5 callersFunctiontest_all_pool_quotes
( pool_dir: String, pool_tipe: PoolType, )
client/src/tests/quotes.rs:57
↓ 4 callersFunctioncalculate_fee
Helper function for calculating swap fee
client/src/pool_utils/fees.rs:45
↓ 4 callersMethodnormalized_value
( &self, swap_token_a_amount: u128, swap_token_b_amount: u128, )
client/src/pool_utils/stable.rs:333
↓ 4 callersFunctionread_json_dir
(dir: &String)
client/src/utils.rs:9
↓ 4 callersFunctionstr2pubkey
(s: &str)
client/src/utils.rs:28
↓ 4 callersMethodtaker_fee
(self, pc_qty: u64)
client/src/pool_utils/serum.rs:125
↓ 4 callersFunctionvalidate_fraction
(numerator: u64, denominator: u64)
client/src/pool_utils/fees.rs:64
↓ 3 callersFunctionaccount_info
(pk: &'a Pubkey, account: &'a mut Account)
client/src/tmp.rs:47
↓ 3 callersFunctioncheck_pool_token_rate
( token_a: u128, token_b: u128, deposit: u128, supply: u128, expected_
client/src/pool_utils/constant_product.rs:296
↓ 3 callersMethoddeposit_single_token_type
Get the amount of pool tokens for the deposited amount of token A or B
client/src/pool_utils/base.rs:109
↓ 3 callersFunctionend_swap
( swap_state: &mut Account<SwapState>, user_dst: &mut Account<TokenAccount> )
program/programs/tmp/src/lib.rs:145
↓ 3 callersFunctionmap_zero_to_none
Helper function for mapping to SwapError::CalculationFailure
client/src/pool_utils/calculator.rs:19
↓ 3 callersMethodmint_2_addr
(&self, mint: &Pubkey)
client/src/pools/orca.rs:181
↓ 3 callersFunctionpool_factory
(tipe: &PoolType, json_str: &String)
client/src/pool.rs:26
↓ 3 callersMethodpool_tokens_to_trading_tokens
The constant product implementation is a simple ratio calculation for how many trading tokens correspond to a certain number of pool tokens
client/src/pool_utils/constant_product.rs:187
↓ 3 callersMethodpool_tokens_to_trading_tokens
Re-implementation of `remove_liquidty`: <https://github.com/curvefi/curve-contract/blob/80bbe179083c9a7062e4c482b0be3bfb7501f2bd/contracts/pool-templ
client/src/pool_utils/stable.rs:224
↓ 3 callersFunctionprepare_swap
( swap_state: &Account<SwapState>, )
program/programs/tmp/src/lib.rs:163
↓ 3 callersMethodtrading_fee
Calculate the trading fee in trading tokens
client/src/pool_utils/fees.rs:85
↓ 2 callersFunctionadd_pool_to_graph
( graph: &mut PoolGraph, idx0: PoolIndex, idx1: PoolIndex, quote: &PoolQuote, )
client/src/main.rs:37
↓ 2 callersFunctionchecked_u8_power
Returns self to the power of b
client/src/pool_utils/stable.rs:78
↓ 2 callersFunctionchunk
(array, chunkSize)
mainnet-fork/new_scrape.ts:21
↓ 2 callersFunctioncompute_new_destination_amount
Compute swap amount `y` in proportion to `x` Solve for y: y**2 + y * (sum' - (A*n**n - 1) * D / (A * n**n)) = D ** (n + 1) / (n ** (2 * n) * prod' * A
client/src/pool_utils/stable.rs:157
↓ 2 callersFunctiondeposit_single_token_type
Get the amount of pool tokens for the deposited amount of token A or B. The constant product implementation uses the Balancer formulas found at <http
client/src/pool_utils/constant_product.rs:100
↓ 2 callersMethodget_mints
(&self)
client/src/pools/aldrin.rs:242
↓ 2 callersMethodget_mints
(&self)
client/src/pools/mercurial.rs:174
↓ 2 callersMethodget_mints
(&self)
client/src/pools/saber.rs:162
↓ 2 callersFunctionget_pool_quote_with_amounts
( amount_in: u128, curve_type: CurveType, amp: u64, fees: &Fees, input_token_pool_amount
client/src/pool_utils/orca.rs:11
↓ 2 callersMethodget_quote
( &self, pool_amounts: [u128; 2], // [0] = src_amount, [1] = dst_amount percision_
client/src/pool_utils/stable.rs:33
↓ 2 callersMethodget_quote_with_amounts_scaled
( &self, scaled_amount_in: u128, mint_in: &Pubkey, mint_out: &Pubkey, )
client/src/pools/orca.rs:92
↓ 2 callersMethodget_update_accounts
(&self)
client/src/pools/orca.rs:137
↓ 2 callersMethodmul_u64
(self, other: u64)
client/src/pool_utils/serum.rs:55
↓ 2 callersFunctionnormalized_value
Calculates the total normalized value of the curve given the liquidity parameters. The constant product implementation for this function gives the sq
client/src/pool_utils/constant_product.rs:162
↓ 2 callersMethodopposite
Given a trade direction, gives the opposite direction of the trade, so A to B becomes B to A, and vice versa
client/src/pool_utils/calculator.rs:53
↓ 2 callersMethodorder_cpi
Executes a new order on the serum dex via CPI. `limit_price` - the limit order price in lot units. `max_coin_qty`- the max number of the base currenc
program/programs/tmp/src/swaps/serum.rs:188
↓ 2 callersFunctionpool_tokens_to_trading_tokens
Get the amount of trading tokens for the given amount of pool tokens, provided the total trading tokens and supply of pool tokens. The constant produ
client/src/pool_utils/constant_product.rs:53
↓ 2 callersFunctionread_dir_names
(dir_name: string)
onchain-data/analyze.ts:234
↓ 2 callersMethodremove_taker_fee
(self, pc_qty_incl_fee: u64)
client/src/pool_utils/serum.rs:132
↓ 2 callersFunctionswap
The constant product swap calculation, factored out of its class for reuse. This is guaranteed to work for all values such that: - 1 <= swap_source_a
client/src/pool_utils/constant_product.rs:27
↓ 2 callersMethodswap_ix
(&self, program: &Program, owner: &Pubkey, mint_in: &Pubkey, mint_out: &Pubk
client/src/pools/orca.rs:48
↓ 2 callersMethodtaker_rate
(self)
client/src/pool_utils/serum.rs:110
↓ 2 callersFunctiontrading_tokens_to_pool_tokens
Get the amount of pool tokens for the given amount of token A or B. The constant product implementation uses the Balancer formulas found at <https://
client/src/pool_utils/constant_price.rs:23
↓ 2 callersFunctionunpack_coption_key
(src: &[u8; 36])
client/src/serialize/token.rs:119
↓ 2 callersFunctionwithdraw_single_token_type_exact_out
Get the amount of pool tokens for the withdrawn amount of token A or B. The constant product implementation uses the Balancer formulas found at <http
client/src/pool_utils/constant_product.rs:131
↓ 1 callersFunction_aldrin_swap_v1
( ctx: &Context<'_, '_, '_, 'info, AldrinSwapV1<'info>>, amount_in: u64, is_inverted: bool, )
program/programs/tmp/src/swaps/aldrin.rs:12
↓ 1 callersFunction_aldrin_swap_v2
( ctx: &Context<'_, '_, '_, 'info, AldrinSwapV2<'info>>, amount_in: u64, is_inverted: bool, )
program/programs/tmp/src/swaps/aldrin.rs:80
↓ 1 callersFunction_init_open_order
Convenience API to initialize an open orders account on the Serum DEX.
program/programs/tmp/src/swaps/serum.rs:16
↓ 1 callersFunction_serum_swap
( ctx: &Context<'_, '_, '_, 'info, SerumSwap<'info>>, amount_in: u64, side: Side, )
program/programs/tmp/src/swaps/serum.rs:22
↓ 1 callersFunctionask_iteration
ask: base -> quote
client/src/pools/serum.rs:134
↓ 1 callersFunctionbid_iteration
bid: quote -> base
client/src/tmp.rs:66
↓ 1 callersFunctionbid_iteration
bid: quote -> base
client/src/pools/serum.rs:81
↓ 1 callersMethodbrute_force_search
( &self, start_mint_idx: usize, init_balance: u128, curr_balance: u128,
client/src/arb.rs:39
↓ 1 callersMethodbuy
Executes the buy order portion of the swap, purchasing as much of the base currency as possible, for the given `quote_amount`. `quote_amount` is the
program/programs/tmp/src/swaps/serum.rs:163
↓ 1 callersFunctioncalculate_step
d = (leverage * sum_x + d_product * n_coins) * initial_d / ((leverage - 1) * initial_d + (n_coins + 1) * d_product)
client/src/pool_utils/stable.rs:103
↓ 1 callersMethodcan_trade
(&self, _mint_in: &Pubkey, _mint_out: &Pubkey )
client/src/pools/orca.rs:147
↓ 1 callersFunctionchunk
(array, chunkSize)
mainnet-fork/check_ata_balances.ts:46
↓ 1 callersFunctioncoin_lots
Returns the amount of lots for the base currency of a trade with `size`.
program/programs/tmp/src/swaps/serum.rs:260
↓ 1 callersMethoddiv
(self, other: U64F64)
client/src/pool_utils/serum.rs:50
↓ 1 callersMethodfrac_part
(self)
client/src/pool_utils/serum.rs:65
↓ 1 callersMethodfrom
(accs: &mut InitOpenOrder<'info>)
program/programs/tmp/src/swaps/serum.rs:55
↓ 1 callersMethodget_arbitrage_instructions
( &self, swap_start_amount: u128, mint_idxs: &Vec<usize>, pools: &Vec<PoolQuot
client/src/arb.rs:131
↓ 1 callersMethodget_name
(&self)
client/src/pools/orca.rs:176
↓ 1 callersFunctionmain
()
tmp/index.ts:9
↓ 1 callersFunctionmain
()
onchain-data/index.ts:60
↓ 1 callersFunctionmain
()
onchain-data/analyze.ts:245
↓ 1 callersFunctionmain
()
mainnet-fork/orca_swap.ts:12
↓ 1 callersFunctionmain
()
mainnet-fork/setup_owner.ts:5
↓ 1 callersFunctionmain
()
mainnet-fork/new_scrape.ts:47
↓ 1 callersFunctionmain
()
mainnet-fork/scrape_signature.ts:8
↓ 1 callersFunctionmain
()
mainnet-fork/check_ata_balances.ts:54
↓ 1 callersFunctionmain
()
mainnet-fork/get_wsol/index.ts:7
↓ 1 callersFunctionmintToToken
(arr, mint)
onchain-data/orca.ts:52
↓ 1 callersMethodmint_2_addr
(&self, mint: &Pubkey)
client/src/pools/aldrin.rs:230
↓ 1 callersMethodmint_2_addr
(&self, mint: &Pubkey)
client/src/pools/mercurial.rs:162
↓ 1 callersMethodmint_2_addr
(&self, mint: &Pubkey)
client/src/pools/saber.rs:150
↓ 1 callersMethodmint_2_scale
(&self, mint: &Pubkey)
client/src/pools/orca.rs:187
↓ 1 callersMethodnormalized_value
The total normalized value of the constant price curve adds the total value of the token B side to the token A side. Note that since most other curve
client/src/pool_utils/constant_price.rs:212
↓ 1 callersMethodowner_trading_fee
Calculate the owner trading fee in trading tokens
client/src/pool_utils/fees.rs:94
↓ 1 callersFunctionrebate_tenth_of_bps
(tenth_of_bps: u64)
client/src/pool_utils/serum.rs:81
↓ 1 callersFunctionsearch_signer
(signer)
onchain-data/analyze.ts:52
↓ 1 callersMethodsell
Executes the sell order portion of the swap, purchasing as much of the quote currency as possible for the given `base_amount`. `base_amount` is the "
program/programs/tmp/src/swaps/serum.rs:137
↓ 1 callersMethodsend_ixs
(&self, ixs: Vec<Instruction>)
client/src/arb.rs:188
↓ 1 callersMethodset_update_accounts
(&mut self, accounts: Vec<Option<Account>>, _cluster: Cluster)
client/src/pools/orca.rs:157
next →1–100 of 241, ranked by callers