SyncGateSimpleEarnSnapshot
Код: internal/worker/activities/sync_gate_simple_earn.go
Input (models.SyncGateSimpleEarnInput):
page_limit— размер страницы overview API, default1000max_pages— upper bound for pagination, default20search_coin— optional debug filter for one asset
Output (models.SyncGateSimpleEarnResult):
snapshot_atprojects_seenprojects_upsertedsubpools_seensubpools_upsertedquarantine_rows
Источник данных
- Bootstrap page:
https://www.gate.com/en-us/simple-earn - API:
https://www.gate.com/apiw/v2/uni-loan/earn/market/list - DB: SQL function
ingest_gate_simple_earn_snapshot($1::jsonb)+fct_gate_simple_earn_*
Особенности
- для
gate.comactivity поднимает Playwright browser session, дает Gate выставить browser state и затем вызываетGET market/listчерезBrowserContext.Request(); - для test/custom non-Gate URL используется fallback на обычный HTTP client;
- запрос использует browser-like headers (
Referer,User-Agent,sec-ch-*,Sec-Fetch-*) и fixed Gate query params; - detail route не нужен: overview payload уже несет embedded
fixed_listиfixable_list; 403/Access Deniedклассифицируется как non-retryablegate_simple_earn_access_denied;- идемпотентность обеспечивается UPSERT-семантикой
ingest_gate_simple_earn_snapshot.
Связи
Наблюдаемость
- Логи:
gate_simple_earn_mapping_coverage,gate simple earn market list request failed - Quarantine table:
fct_gate_simple_earn_quarantine