repo_id stringclasses 563
values | file_path stringlengths 40 166 | content stringlengths 1 2.94M | __index_level_0__ int64 0 0 |
|---|---|---|---|
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/initialize_pool.rs | use crate::state::*;
use anchor_lang::prelude::*;
use anchor_spl::token::{self, Mint, Token, TokenAccount};
#[derive(Accounts)]
// now we don't use bumps, but we must list args in the same order to use tick_spacing arg.
#[instruction(bumps: WhirlpoolBumps, tick_spacing: u16)]
pub struct InitializePool<'info> {
pub... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/swap.rs | use anchor_lang::prelude::*;
use anchor_spl::token::{self, Token, TokenAccount};
use crate::{
errors::ErrorCode,
manager::swap_manager::*,
state::Whirlpool,
util::{to_timestamp_u64, update_and_swap_whirlpool, SparseSwapTickSequenceBuilder},
};
#[derive(Accounts)]
pub struct Swap<'info> {
#[account... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/close_bundled_position.rs | use anchor_lang::prelude::*;
use anchor_spl::token::TokenAccount;
use crate::errors::ErrorCode;
use crate::{state::*, util::verify_position_bundle_authority};
#[derive(Accounts)]
#[instruction(bundle_index: u16)]
pub struct CloseBundledPosition<'info> {
#[account(mut,
close = receiver,
seeds = [
... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/open_position_with_metadata.rs | use anchor_lang::prelude::*;
use anchor_spl::associated_token::AssociatedToken;
use anchor_spl::metadata::Metadata;
use anchor_spl::token::{self, Mint, Token, TokenAccount};
use crate::state;
use crate::{state::*, util::mint_position_token_with_metadata_and_remove_authority};
use crate::constants::nft::whirlpool_nft_... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/decrease_liquidity.rs | use anchor_lang::prelude::*;
use crate::errors::ErrorCode;
use crate::manager::liquidity_manager::{
calculate_liquidity_token_deltas, calculate_modify_liquidity, sync_modify_liquidity_values,
};
use crate::math::convert_to_liquidity_delta;
use crate::util::{
to_timestamp_u64, transfer_from_vault_to_owner, veri... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/collect_fees.rs | use anchor_lang::prelude::*;
use anchor_spl::token::{self, Token, TokenAccount};
use anchor_spl::token_interface::TokenAccount as TokenAccountInterface;
use crate::{
state::*,
util::{transfer_from_vault_to_owner, verify_position_authority_interface},
};
#[derive(Accounts)]
pub struct CollectFees<'info> {
... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/open_position_with_token_extensions.rs | use crate::state::*;
use crate::util::build_position_token_metadata;
use anchor_lang::prelude::*;
use anchor_spl::associated_token::AssociatedToken;
use anchor_spl::token_2022::spl_token_2022;
use anchor_spl::token_2022::Token2022;
use crate::constants::nft::whirlpool_nft_update_auth::ID as WP_NFT_UPDATE_AUTH;
use cra... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/increase_liquidity.rs | use anchor_lang::prelude::*;
use anchor_spl::token::{self, Token, TokenAccount};
use anchor_spl::token_interface::TokenAccount as TokenAccountInterface;
use crate::errors::ErrorCode;
use crate::manager::liquidity_manager::{
calculate_liquidity_token_deltas, calculate_modify_liquidity, sync_modify_liquidity_values,... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/set_protocol_fee_rate.rs | use anchor_lang::prelude::*;
use crate::state::{Whirlpool, WhirlpoolsConfig};
#[derive(Accounts)]
pub struct SetProtocolFeeRate<'info> {
pub whirlpools_config: Account<'info, WhirlpoolsConfig>,
#[account(mut, has_one = whirlpools_config)]
pub whirlpool: Account<'info, Whirlpool>,
#[account(address =... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/set_fee_rate.rs | use anchor_lang::prelude::*;
use crate::state::{Whirlpool, WhirlpoolsConfig};
#[derive(Accounts)]
pub struct SetFeeRate<'info> {
pub whirlpools_config: Account<'info, WhirlpoolsConfig>,
#[account(mut, has_one = whirlpools_config)]
pub whirlpool: Account<'info, Whirlpool>,
#[account(address = whirlpo... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/initialize_position_bundle.rs | use anchor_lang::prelude::*;
use anchor_spl::associated_token::AssociatedToken;
use anchor_spl::token::{self, Mint, Token, TokenAccount};
use crate::{state::*, util::mint_position_bundle_token_and_remove_authority};
#[derive(Accounts)]
pub struct InitializePositionBundle<'info> {
#[account(init,
payer = f... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/two_hop_swap.rs | use anchor_lang::prelude::*;
use anchor_spl::token::{self, Token, TokenAccount};
use crate::{
errors::ErrorCode,
manager::swap_manager::*,
state::Whirlpool,
util::{to_timestamp_u64, update_and_swap_whirlpool, SparseSwapTickSequenceBuilder},
};
#[derive(Accounts)]
pub struct TwoHopSwap<'info> {
#[a... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/set_reward_authority_by_super_authority.rs | use anchor_lang::prelude::*;
use crate::state::{Whirlpool, WhirlpoolsConfig};
#[derive(Accounts)]
#[instruction(reward_index: u8)]
pub struct SetRewardAuthorityBySuperAuthority<'info> {
pub whirlpools_config: Account<'info, WhirlpoolsConfig>,
#[account(mut, has_one = whirlpools_config)]
pub whirlpool: Ac... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/set_fee_authority.rs | use anchor_lang::prelude::*;
use crate::state::WhirlpoolsConfig;
#[derive(Accounts)]
pub struct SetFeeAuthority<'info> {
#[account(mut)]
pub whirlpools_config: Account<'info, WhirlpoolsConfig>,
#[account(address = whirlpools_config.fee_authority)]
pub fee_authority: Signer<'info>,
/// CHECK: saf... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/collect_reward.rs | use anchor_lang::prelude::*;
use anchor_spl::token::{self, Token, TokenAccount};
use anchor_spl::token_interface::TokenAccount as TokenAccountInterface;
use crate::{
state::*,
util::{transfer_from_vault_to_owner, verify_position_authority_interface},
};
#[derive(Accounts)]
#[instruction(reward_index: u8)]
pub... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/close_position.rs | use anchor_lang::prelude::*;
use anchor_spl::token::{self, Mint, Token, TokenAccount};
use crate::errors::ErrorCode;
use crate::state::*;
use crate::util::{burn_and_close_user_position_token, verify_position_authority};
#[derive(Accounts)]
pub struct ClosePosition<'info> {
pub position_authority: Signer<'info>,
... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/collect_protocol_fees.rs | use crate::{state::*, util::transfer_from_vault_to_owner};
use anchor_lang::prelude::*;
use anchor_spl::token::{self, Token, TokenAccount};
#[derive(Accounts)]
pub struct CollectProtocolFees<'info> {
pub whirlpools_config: Box<Account<'info, WhirlpoolsConfig>>,
#[account(mut, has_one = whirlpools_config)]
... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/mod.rs | #![allow(ambiguous_glob_reexports)]
pub mod close_bundled_position;
pub mod close_position;
pub mod close_position_with_token_extensions;
pub mod collect_fees;
pub mod collect_protocol_fees;
pub mod collect_reward;
pub mod decrease_liquidity;
pub mod delete_position_bundle;
pub mod increase_liquidity;
pub mod initiali... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/initialize_position_bundle_with_metadata.rs | use anchor_lang::prelude::*;
use anchor_spl::associated_token::AssociatedToken;
use anchor_spl::metadata::Metadata;
use anchor_spl::token::{self, Mint, Token, TokenAccount};
use crate::constants::nft::whirlpool_nft_update_auth::ID as WPB_NFT_UPDATE_AUTH;
use crate::{state::*, util::mint_position_bundle_token_with_meta... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/delete_position_bundle.rs | use anchor_lang::prelude::*;
use anchor_spl::token::{self, Mint, Token, TokenAccount};
use crate::errors::ErrorCode;
use crate::state::*;
use crate::util::burn_and_close_position_bundle_token;
#[derive(Accounts)]
pub struct DeletePositionBundle<'info> {
#[account(mut, close = receiver)]
pub position_bundle: A... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/set_default_fee_rate.rs | use anchor_lang::prelude::*;
use crate::state::{FeeTier, WhirlpoolsConfig};
#[derive(Accounts)]
pub struct SetDefaultFeeRate<'info> {
pub whirlpools_config: Account<'info, WhirlpoolsConfig>,
#[account(mut, has_one = whirlpools_config)]
pub fee_tier: Account<'info, FeeTier>,
#[account(address = whirl... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/set_default_protocol_fee_rate.rs | use anchor_lang::prelude::*;
use crate::state::WhirlpoolsConfig;
#[derive(Accounts)]
pub struct SetDefaultProtocolFeeRate<'info> {
#[account(mut)]
pub whirlpools_config: Account<'info, WhirlpoolsConfig>,
#[account(address = whirlpools_config.fee_authority)]
pub fee_authority: Signer<'info>,
}
pub fn... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/set_collect_protocol_fees_authority.rs | use anchor_lang::prelude::*;
use crate::state::WhirlpoolsConfig;
#[derive(Accounts)]
pub struct SetCollectProtocolFeesAuthority<'info> {
#[account(mut)]
pub whirlpools_config: Account<'info, WhirlpoolsConfig>,
#[account(address = whirlpools_config.collect_protocol_fees_authority)]
pub collect_protoco... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/set_reward_emissions_super_authority.rs | use anchor_lang::prelude::*;
use crate::state::WhirlpoolsConfig;
#[derive(Accounts)]
pub struct SetRewardEmissionsSuperAuthority<'info> {
#[account(mut)]
pub whirlpools_config: Account<'info, WhirlpoolsConfig>,
#[account(address = whirlpools_config.reward_emissions_super_authority)]
pub reward_emissi... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/set_reward_authority.rs | use anchor_lang::prelude::*;
use crate::state::Whirlpool;
#[derive(Accounts)]
#[instruction(reward_index: u8)]
pub struct SetRewardAuthority<'info> {
#[account(mut)]
pub whirlpool: Account<'info, Whirlpool>,
#[account(address = whirlpool.reward_infos[reward_index as usize].authority)]
pub reward_auth... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/set_reward_emissions.rs | use anchor_lang::prelude::*;
use anchor_spl::token::TokenAccount;
use crate::errors::ErrorCode;
use crate::manager::whirlpool_manager::next_whirlpool_reward_infos;
use crate::math::checked_mul_shift_right;
use crate::state::Whirlpool;
use crate::util::to_timestamp_u64;
const DAY_IN_SECONDS: u128 = 60 * 60 * 24;
#[de... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/initialize_fee_tier.rs | use crate::state::*;
use anchor_lang::prelude::*;
#[derive(Accounts)]
#[instruction(tick_spacing: u16)]
pub struct InitializeFeeTier<'info> {
pub config: Box<Account<'info, WhirlpoolsConfig>>,
#[account(init,
payer = funder,
seeds = [b"fee_tier", config.key().as_ref(),
tick_spacing.... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/initialize_tick_array.rs | use anchor_lang::prelude::*;
use crate::state::*;
#[derive(Accounts)]
#[instruction(start_tick_index: i32)]
pub struct InitializeTickArray<'info> {
pub whirlpool: Account<'info, Whirlpool>,
#[account(mut)]
pub funder: Signer<'info>,
#[account(
init,
payer = funder,
seeds = [b"tick_... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/open_position.rs | use anchor_lang::prelude::*;
use anchor_spl::associated_token::AssociatedToken;
use anchor_spl::token::{self, Mint, Token, TokenAccount};
use crate::state;
use crate::{state::*, util::mint_position_token_and_remove_authority};
#[derive(Accounts)]
pub struct OpenPosition<'info> {
#[account(mut)]
pub funder: Si... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/initialize_config.rs | use anchor_lang::prelude::*;
use crate::state::*;
#[derive(Accounts)]
pub struct InitializeConfig<'info> {
#[account(init, payer = funder, space = WhirlpoolsConfig::LEN)]
pub config: Account<'info, WhirlpoolsConfig>,
#[account(mut)]
pub funder: Signer<'info>,
pub system_program: Program<'info, S... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/close_position_with_token_extensions.rs | use anchor_lang::prelude::*;
use anchor_spl::token_2022::{self, Token2022};
use anchor_spl::token_interface::{Mint, TokenAccount};
use crate::errors::ErrorCode;
use crate::state::*;
use crate::util::{burn_and_close_user_position_token_2022, verify_position_authority_interface};
#[derive(Accounts)]
pub struct ClosePos... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/set_config_extension_authority.rs | use anchor_lang::prelude::*;
use crate::state::{WhirlpoolsConfig, WhirlpoolsConfigExtension};
#[derive(Accounts)]
pub struct SetConfigExtensionAuthority<'info> {
pub whirlpools_config: Box<Account<'info, WhirlpoolsConfig>>,
#[account(mut, has_one = whirlpools_config)]
pub whirlpools_config_extension: Acc... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/initialize_reward.rs | use anchor_lang::prelude::*;
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};
use crate::{
errors::ErrorCode,
state::Whirlpool,
util::{is_token_badge_initialized, v2::is_supported_token_mint},
};
#[derive(Accounts)]
#[instruction(reward_index: u8)]
pub struct InitializeRewardV2<'info... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/set_token_badge_authority.rs | use anchor_lang::prelude::*;
use crate::state::{WhirlpoolsConfig, WhirlpoolsConfigExtension};
#[derive(Accounts)]
pub struct SetTokenBadgeAuthority<'info> {
pub whirlpools_config: Box<Account<'info, WhirlpoolsConfig>>,
#[account(mut, has_one = whirlpools_config)]
pub whirlpools_config_extension: Account<... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/initialize_pool.rs | use anchor_lang::prelude::*;
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};
use crate::{
errors::ErrorCode,
state::*,
util::{is_token_badge_initialized, v2::is_supported_token_mint},
};
#[derive(Accounts)]
#[instruction(tick_spacing: u16)]
pub struct InitializePoolV2<'info> {
p... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/swap.rs | use anchor_lang::prelude::*;
use anchor_spl::memo::Memo;
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};
use crate::util::{
calculate_transfer_fee_excluded_amount, calculate_transfer_fee_included_amount,
parse_remaining_accounts, AccountsType, RemainingAccountsInfo,
};
use crate::{
c... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/decrease_liquidity.rs | use anchor_lang::prelude::*;
use crate::constants::transfer_memo;
use crate::errors::ErrorCode;
use crate::manager::liquidity_manager::{
calculate_liquidity_token_deltas, calculate_modify_liquidity, sync_modify_liquidity_values,
};
use crate::math::convert_to_liquidity_delta;
use crate::util::{
calculate_trans... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/collect_fees.rs | use anchor_lang::prelude::*;
use anchor_spl::memo::Memo;
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};
use crate::util::{parse_remaining_accounts, AccountsType, RemainingAccountsInfo};
use crate::{
constants::transfer_memo,
state::*,
util::{v2::transfer_from_vault_to_owner_v2, veri... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/increase_liquidity.rs | use anchor_lang::prelude::*;
use anchor_spl::memo::Memo;
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};
use crate::errors::ErrorCode;
use crate::manager::liquidity_manager::{
calculate_liquidity_token_deltas, calculate_modify_liquidity, sync_modify_liquidity_values,
};
use crate::math::conv... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/two_hop_swap.rs | use anchor_lang::prelude::*;
use anchor_spl::memo::Memo;
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};
use crate::swap_with_transfer_fee_extension;
use crate::util::{
calculate_transfer_fee_excluded_amount, parse_remaining_accounts,
update_and_two_hop_swap_whirlpool_v2, AccountsType, R... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/collect_reward.rs | use anchor_lang::prelude::*;
use anchor_spl::memo::Memo;
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};
use crate::util::{parse_remaining_accounts, AccountsType, RemainingAccountsInfo};
use crate::{
constants::transfer_memo,
state::*,
util::{v2::transfer_from_vault_to_owner_v2, veri... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/collect_protocol_fees.rs | use crate::util::{parse_remaining_accounts, AccountsType, RemainingAccountsInfo};
use crate::{constants::transfer_memo, state::*, util::v2::transfer_from_vault_to_owner_v2};
use anchor_lang::prelude::*;
use anchor_spl::memo::Memo;
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};
#[derive(Accounts... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/mod.rs | #![allow(ambiguous_glob_reexports)]
pub mod collect_fees;
pub mod collect_protocol_fees;
pub mod collect_reward;
pub mod decrease_liquidity;
pub mod increase_liquidity;
pub mod initialize_pool;
pub mod initialize_reward;
pub mod set_reward_emissions;
pub mod swap;
pub mod two_hop_swap;
pub mod delete_token_badge;
pub... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/initialize_token_badge.rs | use crate::state::*;
use anchor_lang::prelude::*;
use anchor_spl::token_interface::Mint;
#[derive(Accounts)]
pub struct InitializeTokenBadge<'info> {
pub whirlpools_config: Box<Account<'info, WhirlpoolsConfig>>,
#[account(has_one = whirlpools_config)]
pub whirlpools_config_extension: Box<Account<'info, Wh... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/initialize_config_extension.rs | use crate::state::*;
use anchor_lang::prelude::*;
#[derive(Accounts)]
pub struct InitializeConfigExtension<'info> {
pub config: Box<Account<'info, WhirlpoolsConfig>>,
#[account(init,
payer = funder,
seeds = [
b"config_extension",
config.key().as_ref(),
],
bump,
sp... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/set_reward_emissions.rs | use anchor_lang::prelude::*;
use anchor_spl::token_interface::TokenAccount;
use crate::errors::ErrorCode;
use crate::manager::whirlpool_manager::next_whirlpool_reward_infos;
use crate::math::checked_mul_shift_right;
use crate::state::Whirlpool;
use crate::util::to_timestamp_u64;
const DAY_IN_SECONDS: u128 = 60 * 60 *... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/instructions/v2/delete_token_badge.rs | use crate::state::*;
use anchor_lang::prelude::*;
use anchor_spl::token_interface::Mint;
#[derive(Accounts)]
pub struct DeleteTokenBadge<'info> {
pub whirlpools_config: Box<Account<'info, WhirlpoolsConfig>>,
#[account(has_one = whirlpools_config)]
pub whirlpools_config_extension: Box<Account<'info, Whirlp... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/token.rs | use crate::state::{PositionBundle, Whirlpool};
use anchor_lang::prelude::*;
use anchor_spl::metadata::{self, mpl_token_metadata::types::DataV2, CreateMetadataAccountsV3};
use anchor_spl::token::{self, Mint, Token, TokenAccount, Transfer};
use solana_program::program::invoke_signed;
use spl_token::instruction::{burn_che... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/swap_utils.rs | use anchor_lang::prelude::*;
use anchor_spl::token::{Token, TokenAccount};
use crate::{manager::swap_manager::PostSwapUpdate, state::Whirlpool};
use super::{transfer_from_owner_to_vault, transfer_from_vault_to_owner};
#[allow(clippy::too_many_arguments)]
pub fn update_and_swap_whirlpool<'info>(
whirlpool: &mut A... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/mod.rs | pub mod shared;
pub mod sparse_swap;
pub mod swap_tick_sequence;
pub mod swap_utils;
pub mod token;
pub mod token_2022;
pub mod v2;
pub use shared::*;
pub use sparse_swap::*;
pub use swap_tick_sequence::*;
pub use swap_utils::*;
pub use token::*;
pub use token_2022::*;
pub use v2::*;
#[cfg(test)]
pub mod test_utils;
... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/sparse_swap.rs | use anchor_lang::prelude::*;
use std::{
cell::{Ref, RefMut},
collections::VecDeque,
};
use crate::{
errors::ErrorCode,
state::{
Tick, TickArray, TickArrayType, TickUpdate, Whirlpool, ZeroedTickArray, TICK_ARRAY_SIZE,
},
util::SwapTickSequence,
};
// In the case of an uninitialized Tick... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/token_2022.rs | use anchor_lang::prelude::*;
use anchor_spl::associated_token::{self, AssociatedToken};
use anchor_spl::token_2022::spl_token_2022::extension::{
BaseStateWithExtensions, StateWithExtensions,
};
use anchor_spl::token_2022::spl_token_2022::{
self, extension::ExtensionType, instruction::AuthorityType,
};
use ancho... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/swap_tick_sequence.rs | use crate::errors::ErrorCode;
use crate::state::*;
use crate::util::ProxiedTickArray;
use anchor_lang::prelude::*;
use std::cell::RefMut;
pub struct SwapTickSequence<'info> {
arrays: Vec<ProxiedTickArray<'info>>,
}
impl<'info> SwapTickSequence<'info> {
pub fn new(
ta0: RefMut<'info, TickArray>,
... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/shared.rs | use anchor_lang::{
prelude::{AccountInfo, Pubkey, Signer, *},
ToAccountInfo,
};
use anchor_spl::token::TokenAccount;
use anchor_spl::token_interface::TokenAccount as TokenAccountInterface;
use solana_program::program_option::COption;
use std::convert::TryFrom;
use crate::errors::ErrorCode;
pub fn verify_posit... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/test_utils/liquidity_test_fixture.rs | use crate::manager::liquidity_manager::ModifyLiquidityUpdate;
use crate::manager::tick_manager::next_tick_cross_update;
use crate::manager::whirlpool_manager::*;
use crate::math::{add_liquidity_delta, Q64_RESOLUTION};
use crate::state::position_builder::PositionBuilder;
use crate::state::{
tick::*, tick_builder::Ti... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/test_utils/mod.rs | pub mod liquidity_test_fixture;
pub mod swap_test_fixture;
pub use liquidity_test_fixture::*;
pub use swap_test_fixture::*;
| 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/test_utils/swap_test_fixture.rs | use crate::manager::swap_manager::*;
use crate::math::tick_math::*;
use crate::state::{
tick::*, tick_builder::TickBuilder, whirlpool_builder::WhirlpoolBuilder, TickArray, Whirlpool,
};
use crate::state::{WhirlpoolRewardInfo, NUM_REWARDS};
use crate::util::SwapTickSequence;
use anchor_lang::prelude::*;
use std::cel... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/v2/token.rs | use crate::errors::ErrorCode;
use crate::state::{TokenBadge, Whirlpool};
use anchor_lang::prelude::*;
use anchor_spl::token_2022::spl_token_2022::extension::transfer_fee::{
TransferFee, MAX_FEE_BASIS_POINTS,
};
use anchor_spl::token_interface::spl_token_2022::extension::BaseStateWithExtensions;
use anchor_spl::mem... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/v2/swap_utils.rs | use anchor_lang::prelude::*;
use anchor_spl::memo::Memo;
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};
use crate::{manager::swap_manager::PostSwapUpdate, state::Whirlpool};
use super::{transfer_from_owner_to_vault_v2, transfer_from_vault_to_owner_v2};
#[allow(clippy::too_many_arguments)]
pub... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/v2/mod.rs | pub mod remaining_accounts_utils;
pub mod swap_utils;
pub mod token;
pub use remaining_accounts_utils::*;
pub use swap_utils::*;
pub use token::*;
| 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/util/v2/remaining_accounts_utils.rs | use crate::errors::ErrorCode;
use anchor_lang::prelude::*;
pub const MAX_SUPPLEMENTAL_TICK_ARRAYS_LEN: usize = 3;
#[derive(AnchorSerialize, AnchorDeserialize, Clone, PartialEq, Eq)]
pub enum AccountsType {
TransferHookA,
TransferHookB,
TransferHookReward,
TransferHookInput,
TransferHookIntermediat... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/constants/nft.rs | use anchor_lang::prelude::*;
pub mod whirlpool_nft_update_auth {
use super::*;
declare_id!("3axbTs2z5GBy6usVbNVoqEgZMng3vZvMnAoX29BFfwhr");
}
// Based on Metaplex TokenMetadata
//
// METADATA_NAME : max 32 bytes
// METADATA_SYMBOL : max 10 bytes
// METADATA_URI : max 200 bytes
pub const WP_METADATA_NAM... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/constants/transfer_memo.rs | pub const TRANSFER_MEMO_COLLECT_PROTOCOL_FEES: &str = "Orca CollectProtocolFees";
pub const TRANSFER_MEMO_COLLECT_FEES: &str = "Orca CollectFees";
pub const TRANSFER_MEMO_COLLECT_REWARD: &str = "Orca CollectReward";
pub const TRANSFER_MEMO_DECREASE_LIQUIDITY: &str = "Orca Withdraw";
pub const TRANSFER_MEMO_SWAP: &str =... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/constants/test_constants.rs | #[cfg(test)]
use anchor_lang::prelude::Pubkey;
#[cfg(test)]
pub fn test_program_id() -> Pubkey {
"whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
.parse()
.unwrap()
}
| 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/constants/mod.rs | pub mod nft;
pub mod test_constants;
pub mod transfer_memo;
pub use nft::*;
| 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/tests/swap_integration_tests.rs | use crate::errors::ErrorCode;
use crate::manager::swap_manager::*;
use crate::math::*;
use crate::state::{MAX_TICK_INDEX, MIN_TICK_INDEX, TICK_ARRAY_SIZE};
use crate::util::test_utils::swap_test_fixture::*;
use crate::util::{create_whirlpool_reward_infos, SwapTickSequence};
use serde::Deserialize;
use serde_json;
use s... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/tests/swap_test_cases.json | [
{
"testId": 1,
"description": "In a ts_1 pool with 2^110 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee",
"tickSpacing": 1,
"feeRate": 10000,
"protocolFeeRate": 2500,
"liquidity": "1298074214633706907132624082305024",
"currTickInde... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/tests/swap_test_cases_splash_pool.json | [
{
"testId": 1000001,
"description": "In a ts_32769 pool with 2^64 liquidity, swap exactly 1.8446744073709551615e+19 tokenA to tokenB at near max tick with 1.00%/2500 fee",
"tickSpacing": 32769,
"feeRate": 10000,
"protocolFeeRate": 2500,
"liquidity": "18446744073709551616",
"currTickIndex... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/tests/generate_swap_testcase_json.ts | import { writeFileSync } from "fs";
import path from "path";
import Decimal from "decimal.js";
import {
MAX_SQRT_PRICE,
MAX_TICK_INDEX,
MIN_SQRT_PRICE,
MIN_TICK_INDEX,
TICK_ARRAY_SIZE,
PriceMath,
} from "@orca-so/whirlpools-sdk";
import BN from "bn.js";
Decimal.set({ toExpPos: 8, toExpNeg: -8, precision: 12... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/tests/mod.rs | #[cfg(test)]
mod swap_integration_tests;
| 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/state/config.rs | use anchor_lang::prelude::*;
use crate::{errors::ErrorCode, math::MAX_PROTOCOL_FEE_RATE};
#[account]
pub struct WhirlpoolsConfig {
pub fee_authority: Pubkey,
pub collect_protocol_fees_authority: Pubkey,
pub reward_emissions_super_authority: Pubkey,
pub default_protocol_fee_rate: u16,
}
impl Whirlpoo... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/state/token_badge.rs | use anchor_lang::prelude::*;
#[account]
#[derive(Default)]
pub struct TokenBadge {
pub whirlpools_config: Pubkey, // 32
pub token_mint: Pubkey, // 32
// 128 RESERVE
}
impl TokenBadge {
pub const LEN: usize = 8 + 32 + 32 + 128;
pub fn initialize(&mut self, whi... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/state/whirlpool.rs | use crate::{
errors::ErrorCode,
math::{
tick_index_from_sqrt_price, MAX_FEE_RATE, MAX_PROTOCOL_FEE_RATE, MAX_SQRT_PRICE_X64,
MIN_SQRT_PRICE_X64,
},
};
use anchor_lang::prelude::*;
use super::WhirlpoolsConfig;
#[account]
#[derive(Default)]
pub struct Whirlpool {
pub whirlpools_config: P... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/state/mod.rs | pub mod config;
pub mod config_extension;
pub mod fee_tier;
pub mod position;
pub mod position_bundle;
pub mod tick;
pub mod token_badge;
pub mod whirlpool;
pub use self::whirlpool::*;
pub use config::*;
pub use config_extension::*;
pub use fee_tier::*;
pub use position::*;
pub use position_bundle::*;
pub use tick::*;... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/state/config_extension.rs | use anchor_lang::prelude::*;
#[account]
pub struct WhirlpoolsConfigExtension {
pub whirlpools_config: Pubkey, // 32
pub config_extension_authority: Pubkey, // 32
pub token_badge_authority: Pubkey, // 32
// 512 RESERVE
}
impl WhirlpoolsConfigExtensi... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/state/fee_tier.rs | use crate::state::WhirlpoolsConfig;
use crate::{errors::ErrorCode, math::MAX_FEE_RATE};
use anchor_lang::prelude::*;
#[account]
pub struct FeeTier {
pub whirlpools_config: Pubkey,
pub tick_spacing: u16,
pub default_fee_rate: u16,
}
impl FeeTier {
pub const LEN: usize = 8 + 32 + 4;
pub fn initiali... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/state/position_bundle.rs | use crate::errors::ErrorCode;
use anchor_lang::prelude::*;
pub const POSITION_BITMAP_USIZE: usize = 32;
pub const POSITION_BUNDLE_SIZE: u16 = 8 * POSITION_BITMAP_USIZE as u16;
#[account]
#[derive(Default)]
pub struct PositionBundle {
pub position_bundle_mint: Pubkey, // 32
pub position_bitmap: [u8; POSITION_B... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/state/position.rs | use anchor_lang::prelude::*;
use crate::{errors::ErrorCode, math::FULL_RANGE_ONLY_TICK_SPACING_THRESHOLD, state::NUM_REWARDS};
use super::{Tick, Whirlpool};
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default, Copy)]
pub struct OpenPositionBumps {
pub position_bump: u8,
}
#[derive(AnchorSerialize, Ancho... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/state/tick.rs | use crate::errors::ErrorCode;
use crate::state::NUM_REWARDS;
use anchor_lang::prelude::*;
use super::Whirlpool;
// Max & min tick index based on sqrt(1.0001) & max.min price of 2^64
pub const MAX_TICK_INDEX: i32 = 443636;
pub const MIN_TICK_INDEX: i32 = -443636;
// We have two consts because most of our code uses it... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/math/swap_math.rs | use std::convert::TryInto;
use crate::errors::ErrorCode;
use crate::math::*;
pub const NO_EXPLICIT_SQRT_PRICE_LIMIT: u128 = 0u128;
#[derive(PartialEq, Debug)]
pub struct SwapStepComputation {
pub amount_in: u64,
pub amount_out: u64,
pub next_price: u128,
pub fee_amount: u64,
}
pub fn compute_swap(
... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/math/tick_math.rs | use crate::math::u256_math::*;
use std::convert::TryInto;
// Max/Min sqrt_price derived from max/min tick-index
pub const MAX_SQRT_PRICE_X64: u128 = 79226673515401279992447579055;
pub const MIN_SQRT_PRICE_X64: u128 = 4295048016;
const LOG_B_2_X32: i128 = 59543866431248i128;
const BIT_PRECISION: u32 = 14;
const LOG_B_... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/math/token_math.rs | use crate::errors::ErrorCode;
use crate::math::{Q64_MASK, Q64_RESOLUTION};
use super::{
div_round_up_if, div_round_up_if_u256, mul_u256, U256Muldiv, MAX_SQRT_PRICE_X64,
MIN_SQRT_PRICE_X64,
};
// Fee rate is represented as hundredths of a basis point.
// Fee amount = total_amount * fee_rate / 1_000_000.
// Max... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/math/mod.rs | pub mod bit_math;
pub mod bn;
pub mod liquidity_math;
pub mod swap_math;
pub mod tick_math;
pub mod token_math;
pub mod u256_math;
pub use bit_math::*;
pub use bn::*;
pub use liquidity_math::*;
pub use swap_math::*;
pub use tick_math::*;
pub use token_math::*;
pub use u256_math::*;
| 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/math/bit_math.rs | use crate::errors::ErrorCode;
use super::U256Muldiv;
pub const Q64_RESOLUTION: u8 = 64;
pub const Q64_MASK: u128 = 0xFFFF_FFFF_FFFF_FFFF;
pub const TO_Q64: u128 = 1u128 << Q64_RESOLUTION;
pub fn checked_mul_div(n0: u128, n1: u128, d: u128) -> Result<u128, ErrorCode> {
checked_mul_div_round_up_if(n0, n1, d, false... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/math/bn.rs | #![allow(clippy::assign_op_pattern)]
#![allow(clippy::ptr_offset_with_cast)]
#![allow(clippy::manual_range_contains)]
/// The following code is referenced from drift-labs:
/// https://github.com/drift-labs/protocol-v1/blob/3da78f1f03b66a273fc50818323ac62874abd1d8/programs/clearing_house/src/math/bn.rs
///
/// Based on... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/math/u256_math.rs | use std::{
cmp::Ordering,
fmt::{Display, Formatter, Result as FmtResult},
str::from_utf8_unchecked,
};
use crate::errors::ErrorCode;
const NUM_WORDS: usize = 4;
#[derive(Copy, Clone, Debug)]
pub struct U256Muldiv {
pub items: [u64; NUM_WORDS],
}
impl U256Muldiv {
pub fn new(h: u128, l: u128) -> ... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/math/liquidity_math.rs | use crate::errors::ErrorCode;
// Adds a signed liquidity delta to a given integer liquidity amount.
// Errors on overflow or underflow.
pub fn add_liquidity_delta(liquidity: u128, delta: i128) -> Result<u128, ErrorCode> {
if delta == 0 {
return Ok(liquidity);
}
if delta > 0 {
liquidity
... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/manager/tick_manager.rs | use crate::{
errors::ErrorCode,
math::add_liquidity_delta,
state::{Tick, TickUpdate, WhirlpoolRewardInfo, NUM_REWARDS},
};
pub fn next_tick_cross_update(
tick: &Tick,
fee_growth_global_a: u128,
fee_growth_global_b: u128,
reward_infos: &[WhirlpoolRewardInfo; NUM_REWARDS],
) -> Result<TickUpd... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/manager/liquidity_manager.rs | use super::{
position_manager::next_position_modify_liquidity_update,
tick_manager::{
next_fee_growths_inside, next_reward_growths_inside, next_tick_modify_liquidity_update,
},
whirlpool_manager::{next_whirlpool_liquidity, next_whirlpool_reward_infos},
};
use crate::{
errors::ErrorCode,
... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/manager/mod.rs | pub mod liquidity_manager;
pub mod position_manager;
pub mod swap_manager;
pub mod tick_manager;
pub mod whirlpool_manager;
| 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/manager/whirlpool_manager.rs | use crate::errors::ErrorCode;
use crate::math::{add_liquidity_delta, checked_mul_div};
use crate::state::*;
// Calculates the next global reward growth variables based on the given timestamp.
// The provided timestamp must be greater than or equal to the last updated timestamp.
pub fn next_whirlpool_reward_infos(
... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/manager/position_manager.rs | use crate::{
errors::ErrorCode,
math::{add_liquidity_delta, checked_mul_shift_right},
state::{Position, PositionUpdate, NUM_REWARDS},
};
pub fn next_position_modify_liquidity_update(
position: &Position,
liquidity_delta: i128,
fee_growth_inside_a: u128,
fee_growth_inside_b: u128,
reward... | 0 |
solana_public_repos/orca-so/whirlpools/programs/whirlpool/src | solana_public_repos/orca-so/whirlpools/programs/whirlpool/src/manager/swap_manager.rs | use solana_program::msg;
use crate::{
errors::ErrorCode,
manager::{
tick_manager::next_tick_cross_update, whirlpool_manager::next_whirlpool_reward_infos,
},
math::*,
state::*,
util::SwapTickSequence,
};
use anchor_lang::prelude::*;
use std::convert::TryInto;
#[derive(Debug)]
pub struct... | 0 |
solana_public_repos/orca-so/whirlpools/examples/ts-sdk | solana_public_repos/orca-so/whirlpools/examples/ts-sdk/next/next.config.js | import NextBundleAnalyzer from "@next/bundle-analyzer";
import CopyWebpackPlugin from "copy-webpack-plugin";
const nextConfig = {
serverExternalPackages: ["@orca-so/whirlpools-core"],
webpack(config, { isServer }) {
config.experiments.asyncWebAssembly = true;
// Copy `orca_whirlpools_core_js_bindings_bg.w... | 0 |
solana_public_repos/orca-so/whirlpools/examples/ts-sdk | solana_public_repos/orca-so/whirlpools/examples/ts-sdk/next/next-env.d.ts | /// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
| 0 |
solana_public_repos/orca-so/whirlpools/examples/ts-sdk | solana_public_repos/orca-so/whirlpools/examples/ts-sdk/next/package.json | {
"name": "@orca-so/whirlpools-example-ts-next",
"version": "0.1.0",
"type": "module",
"scripts": {
"start": "next dev",
"build": "next build",
"clean": "rimraf .next"
},
"dependencies": {
"@orca-so/whirlpools": "*",
"@solana/web3.js": "^2.0.0",
"next": "^15.1.0",
"react": "^18.3... | 0 |
solana_public_repos/orca-so/whirlpools/examples/ts-sdk | solana_public_repos/orca-so/whirlpools/examples/ts-sdk/next/tsconfig.json | {
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"jsx": "preserve",
"plugins": [
{
"name": "next"
}
],
"noEmit": true,
"incremental": true
},
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node... | 0 |
solana_public_repos/orca-so/whirlpools/examples/ts-sdk/next | solana_public_repos/orca-so/whirlpools/examples/ts-sdk/next/app/layout.tsx | import { ReactNode } from "react";
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
| 0 |
solana_public_repos/orca-so/whirlpools/examples/ts-sdk/next | solana_public_repos/orca-so/whirlpools/examples/ts-sdk/next/app/page.tsx | "use client";
import { fetchPositionsForOwner, PositionOrBundle } from "@orca-so/whirlpools";
import { tickIndexToSqrtPrice } from "@orca-so/whirlpools-core";
import { useCallback, useMemo, useState } from "react";
import { createSolanaRpc, mainnet, address, devnet } from "@solana/web3.js";
export default function Pag... | 0 |
solana_public_repos/orca-so/whirlpools/examples/rust-sdk | solana_public_repos/orca-so/whirlpools/examples/rust-sdk/whirlpool_repositioning_bot/Cargo.toml | [package]
name = "whirlpool_repositioning_bot"
version = "0.1.0"
edition = "2021"
[dependencies]
clap = { version = "^4.5.21", features = ["derive"] }
colored = { version = "^2.0" }
orca_whirlpools = { path = '../../../rust-sdk/whirlpool' }
orca_whirlpools_client = { path = '../../../rust-sdk/client' }
orca_whirlpools... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.