Get User account for Delegate
Fetch and query a delegates for user accounts on Drift v2 Program .
A Delegate is an address that can control an account on the user's behalf. The delegated user (public key) although has limited power, can perform most operations on the account except for withdrawals. To find delegated users on Drift Protocol, we need to query the delegate field in the drift_User account.
You can directly copy paste this code on replit and see it in action.
Fetch user account for a particular delegate
The response contains authority
and delegate
which indicates the account owner and the delegated account, more fields can also be cherrypicked as per your requirement.
You can also query the delegate account for a particular user account or authority, using the following query
Last updated
Was this helpful?