-
Notifications
You must be signed in to change notification settings - Fork 1.1k
getTradeDetails: unexpected executionRate #1
Comments
Also, do you mind explaining what |
I believe I figured it out - the
Should be:
That yields the expected results. If my logic is correct, please feel free to close the issue 😄 |
hi @sbrichards, thanks for this. you're correct that you need to multiply (also, to answer one of your questions, |
Add russian locale
Combine swap send into one component
Hey @NoahZinsmeister - first off, thank you for building this great library.
I'm just digging in & created a few calls based on your Data & Computation examples. I want to confirm I understand the meaning of these outputs.
Here's my script:
When I log out
tradeDetails
, I get this output (I converted it to JSON). For lowbuyAmount
values (1 in my example), thetradeDetails.executionRate
returns some wacky results: 18 in this example, vs. the pre-execution market rate and post-execution market rate of ~215.87. It's only when I increase thebuyAmount
, e.g. to 1000, does it return anexecutionRate
similar to the market rates (here's my results for 1000).First, what is the
executionRate
? I assume it is the actual rate for the trade after accounting for slippage, i.e. my realized rate from executing the given trade? Second, Any idea what's happening here? Perhaps some side effect of turning a smallBigNumber
into a string? Or is this an actual bug? Even with a small amount of DAI, I'd expect theexecutionRate
to be about the same - even closer to the pre & post market rates.The text was updated successfully, but these errors were encountered: