Skip to main content

Crate usdc_plus_exchange

Crate usdc_plus_exchange 

Source

Modules§

ids

Macros§

validate

Enums§

ReflectErrorCodes

Functions§

compute_tokens_from_usdc
Computes how many receipt tokens would be minted for a given USDC deposit amount Formula: tokens = usdc_amount * effective_supply / deposited_vault_value
compute_usdc_from_tokens
Computes how much USDC would be returned for a given amount of receipt tokens Formula: USDC = token_amount * deposited_vault_value / effective_supply
exchange_rate_receipt_accounts
Calculates USDC redemption amount for USDC+ tokens using Anchor account validation.
exchange_rate_receipt_input
Calculates the amount of USDC a user will receive when redeeming USDC+ receipt tokens.
exchange_rate_usdc_accounts
Calculates USDC+ tokens for a USDC deposit using Anchor account validation.
exchange_rate_usdc_input
Calculates the amount of USDC+ receipt tokens a user will receive for depositing USDC.
get_exchange_components
Returns the raw components needed for exchange calculation Call this once, cache the results, then use compute_tokens_from_usdc directly