You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In create_transaction, if treat_as_gross_amount is set to False, the parameter is ignored completely and won't get sent to Fireblocks.
The current implementation probably relies on incomplete docs that claim False is the default (at all times). However, it has been established with Fireblocks Platinum Support Engineer Ricky Chen, under Fireblocks Support request No. 183501, that this is not always the case. Notably, if the whole vault account balance is to be spent, the default behavior (unless overridden with an explicit treatAsGrossAmount option) is to treat the transaction amount as gross.
This issue has been confirmed by testing.
To Reproduce
Steps to reproduce the behavior:
call create_transaction and set treat_as_gross_amount to False, while spending the whole account balance (do this on a native/base asset, not a smart token like ERC-20 etc...)
See that the fee is deducted from the requested amount, so the amount transferred is unexpectedly "random"
Expected behavior
Fireblocks SDK should pass the treat_as_gross_amount parameter if explicitly set, even if it's False
In extreme cases when the whole vault account balance is requested to be spent (just like described in the steps above), Fireblocks fails the transaction rather than sending an unexpected amount in case treatAsGrossAmount has explicitly been set to False
Versions (please complete the following information):
We do not set anything explicitly in the Python SDK when calling the create_transaction method, where the treat_as_gross_amount parameter is None by default.
Looking at the SDK code, it is obvious that the parameter does not get sent unless it's set to True, so it wouldn't make any difference even if we set it to False explicitly when calling the create_transaction method.
I'm thinking, and this is where I'd like your input to confirm or correct my hypothesis, maybe the default behavior of Fireblocks is to NOT treat the transactions as gross UNLESS the whole vault account balance is about to be spent. In that special case Fireblocks defaults to treating the transaction as gross (despite the docs not mentioning this edge case).
Can you please confirm if this statement is factually correct?
Now, second question is whether Fireblocks ALWAYS respects the treatAsGrossAmount request parameter, if provided explicitly (no matter if true or false).
If so, will it respect the parameter value even if set to false while attempting to spend the whole Vault Account balance? What is the behavior in that case?
If the answer is YES for both questions, then I suggest fixing the SDK code to pass the treatAsGrossAmount parameter at all times (even if it's False).
I can send a pull request fixing this as long as my hypothesis is correct.
Thank you Ricky, it's been a huge mystery but I feel we're coming closer to the resolution finally :-)
[Ricky Chen]
Yes, the transaction will not be treated as gross unless the whole account vault balance is spent.
If the treatAsGrossAmount is set in the transaction parameters, then the transaction will follow this field. If you send a transaction with the treatAsGrossAmount as false but the entire vault balance amount, then the transaction will fail with insufficient funds.
The text was updated successfully, but these errors were encountered:
Describe the bug
In
create_transaction
, iftreat_as_gross_amount
is set toFalse
, the parameter is ignored completely and won't get sent to Fireblocks.The current implementation probably relies on incomplete docs that claim False is the default (at all times). However, it has been established with Fireblocks Platinum Support Engineer Ricky Chen, under Fireblocks Support request No. 183501, that this is not always the case. Notably, if the whole vault account balance is to be spent, the default behavior (unless overridden with an explicit
treatAsGrossAmount
option) is to treat the transaction amount as gross.This issue has been confirmed by testing.
To Reproduce
Steps to reproduce the behavior:
create_transaction
and settreat_as_gross_amount
toFalse
, while spending the whole account balance (do this on a native/base asset, not a smart token like ERC-20 etc...)Expected behavior
treat_as_gross_amount
parameter if explicitly set, even if it'sFalse
treatAsGrossAmount
has explicitly been set toFalse
Versions (please complete the following information):
Additional context
Pull request to fix this: Pass treatAsGrossAmount if set to False in create_transaction #196
Support request in question: https://support.fireblocks.io/hc/en-us/requests/183501
Conversation excerpt:
[Jozef Knaperek]
[Ricky Chen]
The text was updated successfully, but these errors were encountered: