2

I can see that each account keeps it's balance of lumens. Yet there should be a place where the rest of assets that belong to an account is preserved - the API for Account Details returns a list of these.

My question is how heavy is that operation? Is the data come from the database (where it's indexed properly) or there is a need to look into the XDR files, by a chance?

1

Each account trustline is represented as a record in a trustlines table located in the Core database. The trustline itself has a balance field that contains current asset balance for that account.

"Find asset balance for the account" is rather cheap operation considering that the query involves a simple join over trustlines and accounts tables on indexed fields.

If you need to query this information very often, consider running your own Core node (in no-validation mode in case of limited resources). In that way you will be able to get data directly from DB, omitting the penalty of serialization/deserialization and network lag in the case of Horizon API query.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.