Get all pools attached to a particular margin account on Tensor
From Tensor, we can get all pools related to a particular margin account by filtering the margin field in Tensor_Pool account.
Account Joins can be seen in action here! We fetch pool data joined with the associated margin account.
Natively in RPC calls, you would need to fetch both pool and the margin account separately. Here we are fetching pools joined with the associated margin account.
You can directly copy paste this code on replit and see it in action.