makerdao / market-maker-keeper

Maker Keeper Framework: Market maker keepers for OasisDEX, EtherDelta, 0x (RadarRelay, ERCdEX), Paradex, DDEX, IDEX, Bibox, Ethfinex, GoPax, HitBTC, TheOcean, OKEX and Gate.io.
GNU Affero General Public License v3.0
481 stars 183 forks source link

Add erisx BTC support #158

Closed MikeHathaway closed 4 years ago

MikeHathaway commented 4 years ago

BTC can be denominated on ErisX markets as TBTC. This PR Simply converts that to BTC to stay in sync with our infrastructure

MikeHathaway commented 4 years ago

Are the conversions because the ErisX clearing API uses a different symbology than the token pairs traded over the FIX connection? I'm curious what self.pair() looks like.

Yeah exactly. So if you look at the response for retrieving balances from the clearing API, you will get something like this: [{"opening_balance": "12.2", "spot_movement": "0.4", "exchange_fees": "0.0", "clearing_fees": "0.0", "other_fees": "0.0", "asset_movement": "0.0", "realized_p_and_l": "0.0", "futures_delivery": "0.0", "closing_balance": "12.6", "total_equity": "12.6", "reserved_margin": "0.0", "total_excess_deficit": "12.6", "net_liquidating_value": "12.6", "available_to_trade": "12.6", "reserved_ote": "0.0", "fd": "N", "asset_type": "TETH", "closing_price": "205.7", "closing_price_date": "2020-05-06", "usd_value": "2591.82", "change_in_balance": "0.4"}]

Meanwhile, self.pair() returns something along the lines of: BTC/USD as that's what our infrastructure understands, and what FIX accepts.