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
Hello, I came across this issue when writing a query here [https://dune.com/queries/4010725/6752431].
For certain markets on Phoenix, I have validated that the taker fee is in basis points. You can see this on the smart contracts on Solscan. For example, the "takerfeebps" for the SOL/USDC market is 2 bps, meaning 0.0002. See here [https://solscan.io/account/4DoNfFBfF7UokCC2FQzriy7yHK6DY6NVdYpuekQ5pRgg#data]
In the dex_solana.trades table, the fees are in percentages, for example 0.02 for the SOL/USDC market on Phoenix.
Hey Andrew! I'm not sure what happened, but from what I can see now on a new query, the amount sold/bought for the SOL token on Phoenix (not sure if this issue also occurred with other tokens on other markets), has been divided by many orders of magnitude. I'm not sure if this happened in an attempt to reduce the decimal form of the fee_tier and reduce the fee_amount, and accidentally reduced the amount of the token being swapped instead?
Regardless, you can see the error here [https://dune.com/queries/4050966]. Take a look at the amount being swapped for any trade, and then look at the amount on Solscan using the tx_id.
Description
The current fee_tier is overstated because the raw data is denominated in basis points (bps) but is being divided by 100 instead of 10000.
https://github.com/duneanalytics/spellbook/blob/main/dbt_subprojects/solana/models/_sector/dex/phoenix/phoenix_v1_base_trades.sql#L48
Current behavior
this is causing the inflated fees on solana_dex.trades
dune query to check :
https://dune.com/queries/4033552
Expected behavior
fee_tier to be /10000 instead of /100 to get the correct values
Impacted model(s)
https://github.com/duneanalytics/spellbook/blob/main/dbt_subprojects/solana/models/_sector/dex/phoenix/phoenix_v1_base_trades.sql
https://github.com/duneanalytics/spellbook/blob/main/dbt_subprojects/solana/models/_sector/dex/dex_solana_trades.sql
Possible solution
fix by changing from /100 to /10000
The text was updated successfully, but these errors were encountered: