39 lines
1.5 KiB
C
39 lines
1.5 KiB
C
#ifndef FUSED_SYMBOLS_API_H
|
|
#define FUSED_SYMBOLS_API_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include "hash.h"
|
|
#include "config.h"
|
|
#include "triangle.h"
|
|
|
|
/* Describes one trading pair as returned by the KuCoin REST API */
|
|
typedef struct {
|
|
char symbol[SYMBOL_NAME_LEN]; /* trading pair symbol e.g. "BTC-USDT" */
|
|
char base[CURRENCY_NAME_LEN]; /* base currency code */
|
|
char quote[CURRENCY_NAME_LEN]; /* quote currency code */
|
|
char fee_currency[CURRENCY_NAME_LEN]; /* currency used for trading fee */
|
|
uint8_t fee_category; /* fee category identifier */
|
|
double taker_fee_coeff; /* taker fee coefficient */
|
|
double maker_fee_coeff; /* maker fee coefficient */
|
|
double base_increment; /* base lot size step */
|
|
double quote_increment; /* quote lot size step */
|
|
double base_min_size; /* minimum base order size */
|
|
} trading_pair_t;
|
|
|
|
/* Growable list of trading pairs */
|
|
typedef struct {
|
|
trading_pair_t *pairs; /* dynamic array of trading pairs */
|
|
uint32_t count; /* number of pairs currently stored */
|
|
uint32_t capacity; /* allocated capacity */
|
|
} pair_list_t;
|
|
|
|
/* Fetch all trading pairs from the KuCoin REST API */
|
|
int fetch_trading_pairs(pair_list_t *out);
|
|
|
|
/* Full symbol discovery: fetch pairs, enumerate triangles, populate tables */
|
|
int discover_symbols(symbol_table_t *symbols, triangle_set_t *triangles,
|
|
const config_t *cfg, const fee_entry_t *fees, uint32_t fee_count);
|
|
|
|
#endif
|