Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balance is not showing up when there are missing products #70

Open
ihorkatkov opened this issue Jul 1, 2020 · 1 comment
Open

Balance is not showing up when there are missing products #70

ihorkatkov opened this issue Jul 1, 2020 · 1 comment

Comments

@ihorkatkov
Copy link
Contributor

Hey @rupurt.

The dashboard is not showing balance for missing products for default dev config.
For my case, the solution is to add etc_usdt to products of binance and okex.

I'm wondering, how to make it user-friendly? I see several options:

  • Display appropriate error in the logs and don't show balance. E.g Missing #{product} in the #{venue} venue. Please add it in order to show the balance.
  • Filter out invalid values and show balance
  • Display the error and show balance

I'd be happy to apply any solution.

WDYT?

Example

iex> config = %Workbench.BalanceSnapshots.Config{
  boot_delay_ms: 10000,
  btc_usd_symbol: :btc_usdt,
  btc_usd_venue: :okex,
  enabled: true,
  every_ms: 10000,
  quote_pairs: [binance: :usdt, okex: :usdt],
  usd_quote_asset: :usdt,
  usd_quote_venue: :okex
}


iex> Tai.Venues.AccountStore.all()
[
  %Tai.Venues.Account{
    asset: :btc,
    credential_id: :main,
    equity: #Decimal<0>,
    free: #Decimal<0>,
    locked: #Decimal<0>,
    type: "futures",
    venue_id: :okex
  },
  %Tai.Venues.Account{
    asset: :btc,
    credential_id: :main,
    equity: #Decimal<0>,
    free: #Decimal<0>,
    locked: #Decimal<0>,
    type: "swap",
    venue_id: :okex
  },
  %Tai.Venues.Account{
    asset: :etc,
    credential_id: :main,
    equity: #Decimal<0>,
    free: #Decimal<0>,
    locked: #Decimal<0>,
    type: "swap",
    venue_id: :okex
  }
]

iex> Workbench.BalanceSnapshots.Snapshot.create(config)
{:error, [{:binance, :etc_usdt, :not_found}, {:okex, :etc_usdt, :not_found}]}
@rupurt
Copy link
Contributor

rupurt commented Jul 3, 2020

Nice find.

I'm working on a real time balance streaming feature that hasn't shipped yet, so keeping that in mind. I feel like the best option is to

Display appropriate error in the logs and don't show balance. E.g Missing #{product} in the #{venue} venue. Please add it in order to show the balance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants