I'm in the process of migrating a rebasing token from EVM to Solana. The rebasing of the token is achieved by using a rate multiplier modified by an oracle.

In order to acomplish this a custom implementation of the token standard is used, as both the supply and balance of accounts changes daily. Instead of using Associated Token Accounts (ATA) that get managed by SPL-Token program, I've implemented custom PDAs to manage the account balances. This allows to have more place to make changes from our program and display balances and totalSupply dinamically based on the rate multiplier.

In the EVM version, the balance of the token is managed by overriding the ERC-20 balanceOf function. I attempted to implement a similar approach in Solana by manipulating the amount_to_ui_amount instruction within the program. However, I realized that this won't work because all balances and the total supply are queried from the ATA. In my case, the balance is managed by a custom PDA within the program, meaning no ATA is involved.

Why are we using a custom implementation instead of SPL-Token?

  • Because our token needs to change dynamically its supply and balances.

Why are we not using Interest-Bearing Tokens Token-2022 Extension?

  • We don't know the specific APY expected, this is unpredictable. We need to get it updated by an Oracle directly from an instruction.

The question is: Is there a way to override the amount_to_ui_amount instruction and configure the explorer to query custom balances from my program's PDA instead of the ATA?

Any insights or alternative approaches would be greatly appreciated. Thanks!

2 Answers 2


If you're writing a custom token program, why not just store the correct balance on the ATA instead of the other PDA you've designed? The ATA is just a PDA too!


This might not be very useful for you but I will still suggest this approach, maybe it helps:

  • in each assosiacted account save the following ratio: user_amount/total_supply, this should only be calculated initially and should only be changed when the user transfers or receives the token; basically this amount shows how many percentage(percentile, or just ratio) of the total supply in circulation the user owns.
  • in your program just increase the total supply in circulation based on the Oracle data
  • in your program have a method that returns the UI amount based on the ratio amount

Math might get a bit more complex since you are introducing ratios but I think it is managable.

In your case it might not be this straightforward since you might not be increasing the token amounts this simply but I am sure you can adapt this method to your own case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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