Skip to content

Add futures to okx exchange metadata #4772

Open
@douggie

Description

Currently the remoteInit for okx only loads the spot and swap products, I propose we add the futures products, so that functions like getOpenPostions will work when they do things key looks ups like this on futures positiions exchangeMetaData.getInstruments().get(adaptOkexInstrumentId(okexPosition.getInstrumentId())).getContractValue()

        ((OkexMarketDataServiceRaw) marketDataService)
            .getOkexInstruments(SPOT, null, null)
            .getData();

    List<OkexInstrument> swap_instruments =
            ((OkexMarketDataServiceRaw) marketDataService)
                    .getOkexInstruments(SWAP, null, null)
                    .getData();

    instruments.addAll(swap_instruments);

    List<OkexInstrument> futures_instruments =
        ((OkexMarketDataServiceRaw) marketDataService)
            .getOkexInstruments(FUTURES, null, null)
            .getData();

    instruments.addAll(futures_instruments);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions