Skip to main content

Crate defituna_core

Crate defituna_core 

Source

Modules§

borrow_curve
fees
fixed
fixed_128
jupiter
price
tuna_lp_position
tuna_spot_position

Macros§

assert_approx_eq

Structs§

DecreaseSpotPositionQuoteResult
IncreaseLpPositionQuoteArgs
IncreaseLpPositionQuoteResult
IncreaseSpotPositionQuoteResult
LiquidationPrices
RepayLpPositionDebtQuoteArgs
RepayLpPositionDebtQuoteResult
TunaSpotPositionFacade

Constants§

COMPUTED_AMOUNT
DEFAULT_SLIPPAGE_TOLERANCE_BPS
HUNDRED_PERCENT
INVALID_ARGUMENTS
JUPITER_CREATE_TOKEN_ACCOUNT_DISCRIMINATOR
JUPITER_EXACT_OUT_ROUTE_DISCRIMINATOR
JUPITER_EXACT_OUT_ROUTE_V2_DISCRIMINATOR
JUPITER_QUOTE_REQUEST_ERROR
JUPITER_ROUTE_DISCRIMINATOR
JUPITER_ROUTE_V2_DISCRIMINATOR
JUPITER_ROUTE_WITH_TOKEN_LEDGER_DISCRIMINATOR
JUPITER_SHARED_ACCOUNTS_EXACT_OUT_ROUTE_DISCRIMINATOR
JUPITER_SHARED_ACCOUNTS_EXACT_OUT_ROUTE_V2_DISCRIMINATOR
JUPITER_SHARED_ACCOUNTS_ROUTE_DISCRIMINATOR
JUPITER_SHARED_ACCOUNTS_ROUTE_V2_DISCRIMINATOR
JUPITER_SHARED_ACCOUNTS_ROUTE_WITH_TOKEN_LEDGER_DISCRIMINATOR
JUPITER_SWAP_INSTRUCTIONS_REQUEST_ERROR
MARKET_MAKER_FUSION
MARKET_MAKER_ORCA
TOKEN_A
TOKEN_B

Functions§

apply_swap_fee
Similar to the function implemented in FusionAMM, but supports various rounding modes.
apply_tuna_protocol_fee
calculate_tuna_protocol_fee
calculate_tuna_spot_position_protocol_fee
compute_leverage
get_decrease_spot_position_quote
Spot position decrease quote
get_increase_lp_position_quote
get_increase_spot_position_quote
Spot position increase quote
get_lp_position_liquidation_prices
Computes the liquidation prices for an existing position.
get_repay_lp_position_debt_quote
get_spot_position_liquidation_price
Returns the liquidation price
get_tradable_amount
Calculates the maximum tradable amount in the collateral token.
get_user_destination_token_account_address
get_user_source_token_account_address
is_jupiter_create_token_account_instruction
reverse_apply_swap_fee
Similar to the function implemented in FusionAMM, but supports various rounding modes.
reverse_apply_tuna_protocol_fee
sqrt_price_x64_to_price_fixed
sqrt_price_x64_to_price_x64

Type Aliases§

Fixed128
FixedU128 with 68 integer bits and 60 fractional bits.