Skip to content

node Global view & account history - #3642

Open
GuillaumeDSM wants to merge 10 commits into
devfrom
global_view
Open

node Global view & account history#3642
GuillaumeDSM wants to merge 10 commits into
devfrom
global_view

Conversation

@GuillaumeDSM

@GuillaumeDSM GuillaumeDSM commented Aug 11, 2026

Copy link
Copy Markdown
Member

requires Drakkar-Software/ccxt#29
includes:

  • global view update via scheduled job (ev. 5min)
  • account history fetch & sync (stored in optimized sqlite) via daily scheduled job
  • reduce tasks.db growing size by a lot

@GuillaumeDSM GuillaumeDSM self-assigned this Aug 11, 2026
@GuillaumeDSM
GuillaumeDSM force-pushed the global_view branch 14 times, most recently from fba8b81 to 122c190 Compare August 17, 2026 21:14
@GuillaumeDSM
GuillaumeDSM force-pushed the global_view branch 9 times, most recently from 588cf6f to 23c772b Compare August 25, 2026 12:00
@GuillaumeDSM GuillaumeDSM changed the title WIP node Global view node Global view & account history Aug 25, 2026
@GuillaumeDSM
GuillaumeDSM force-pushed the global_view branch 3 times, most recently from 396e50a to d689807 Compare August 25, 2026 20:42

async def fetch_deposits(self, since: int = None, limit: int = None) -> list[dict]:
try:
return await self.exchange_manager.exchange.get_deposits(since=since, limit=limit)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it make sense to create an updater the same way as trades and others and to use the updater here instead of the exchange manager function?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, it's not used but it would fit the architecture, i'll add an updater that for now will only be used there

@Herklos Herklos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome testing framework! Great job

@GuillaumeDSM
GuillaumeDSM force-pushed the global_view branch 4 times, most recently from a559618 to 618b246 Compare August 28, 2026 14:25
@GuillaumeDSM
GuillaumeDSM marked this pull request as ready for review August 29, 2026 14:31

@Herklos Herklos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! And very nice testing work 💯

await self.inner_test_get_my_recent_trades_exhaust_history()

@expect_not_supported_on_read_only("get_my_recent_trades")
async def inner_test_get_my_recent_trades_exhaust_history(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

await self.inner_test_get_deposits()

@expect_not_supported_on_read_only("get_deposits")
async def inner_test_get_deposits(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

response = tenant_client.get("/api/v1/accounts/acc-1/historical-values")
assert response.status_code == 503

def test_returns_401_without_auth(self, client, mock_auth):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

import octobot_sync.sync.collection_backend.single_item_local_collection_provider as single_item_provider


class AccountHistoryProvider(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -818,6 +837,45 @@
}
}
},
"TransactionType": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}
}
},
"ResetAccountTradingDataConfiguration": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +103 to +109
def _parse_base_quote(symbol: str) -> tuple[str, str] | None:
if "/" not in symbol:
return None
base_asset, quote = symbol.split("/", 1)
if not base_asset or not quote or base_asset == quote:
return None
return base_asset, quote

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use commons Symbol instead ?

return sorted(symbol for symbol in symbols if symbol in live_symbols)


def _derive_price_symbols(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use commons.Symbol ?

)
# Update persisted latest-tickers cache from fetched ticker closes.
if exchange_refresh_result.ticker_closes:
await trading_api.update_latest_tickers(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Herklos Herklos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

return replicable


def is_order_impossible_at_market_price(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍



class TestPatchTaskContentDegradedState:
def test_persists_degraded_state_in_task_content(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

SCHEMA_VERSION = 1


class MarketDataSQLiteDatabase(base_sqlite_database.BaseSQLiteDatabase):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

assert result[day_1_start]["USDT"][TOTAL] == decimal.Decimal("0")


class TestBuildHistoricalHoldingsDepositWithdrawal:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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

Successfully merging this pull request may close these issues.

2 participants