user_deposit_sol
user_deposit_supported_token
Do not hardcode account lists.
Do not assume the current set of accounts will remain valid after governance updates (e.g. adding supported tokens or vaults).
What Are Pricing Source Accounts?
These accounts are used to price deposits and determine how much fragAsset should be minted. They are derived from the dynamic configuration of the fund, and may vary over time or between assets (e.g.,fragSOL
, fragJTO
, fragBTC
).
Ground Rules for Required Accounts
For everyfragAsset
fund, you must include accounts of:
fund.supported_tokens[0:fund.num_supported_tokens].pricing_source.address
fund.restaking_vaults[0:fund.num_restaking_vaults].pricing_source.address
fund.normalized_token.pricing_source.address
— only iffund.normalized_token.enabled == 1
Some accounts may appear multiple times (especially in
fragBTC
, which consists of pegged assets).
You can manually deduplicate these accounts when building your transaction.How to Include These Accounts
You can derive this list by reading the on-chain fund account data for eachfragAsset
, following the rules above.
Also there are two safe, forward-compatible options to resolve these accounts:
-
Use the SDK: The
@fragmetric-labs/sdk
will resolve all required pricing source accounts for you based on the latest fund state. - Read the fund account: Each fund account data includes the list of pricing source addresses. Use this list to avoid manually deriving the accounts in your transaction.