Skip to content

Commit

Permalink
Merge pull request #162 from hummingbot/fix/remove-zigzag-defikingdoms
Browse files Browse the repository at this point in the history
(gov) remove zigzag defikingdoms
  • Loading branch information
fengtality committed Jul 17, 2023
2 parents 3a28f3b + 39f62e7 commit f834a3e
Show file tree
Hide file tree
Showing 31 changed files with 5 additions and 4,821 deletions.
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module.exports = {
'src/connectors/uniswap/uniswap.config.ts',
'src/connectors/uniswap/uniswap.ts',
'src/connectors/uniswap/uniswap.lp.helper.ts',
'src/connectors/defikingdoms/defikingdoms.ts',
'src/connectors/defira/defira.ts',
'src/connectors/openocean/openocean.ts',
'src/connectors/pangolin/pangolin.ts',
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"@pangolindex/sdk": "^1.1.0",
"@perp/sdk-curie": "^1.16.0",
"@sushiswap/sdk": "^5.0.0-canary.116",
"@switchboard-xyz/defikingdoms-sdk": "^1.0.7",
"@tinymanorg/tinyman-js-sdk": "^3.0.0",
"@traderjoe-xyz/sdk-v2": "^2.0.5",
"@types/fs-extra": "^9.0.13",
Expand Down
17 changes: 4 additions & 13 deletions src/amm/amm.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ import {
RefAMMish,
Uniswapish,
UniswapLPish,
ZigZagish,
} from '../services/common-interfaces';
import {
price as zigzagPrice,
trade as zigzagTrade,
} from '../connectors/zigzag/zigzag.controllers';
import { Algorand } from '../chains/algorand/algorand';
import { Tinyman } from '../connectors/tinyman/tinyman';

Expand All @@ -79,8 +74,8 @@ export async function price(req: PriceRequest): Promise<PriceResponse> {
req.chain,
req.network
);
const connector: Uniswapish | RefAMMish | Tinyman | ZigZagish =
await getConnector<Uniswapish | RefAMMish | Tinyman | ZigZagish>(
const connector: Uniswapish | RefAMMish | Tinyman =
await getConnector<Uniswapish | RefAMMish | Tinyman>(
req.chain,
req.network,
req.connector
Expand All @@ -89,8 +84,6 @@ export async function price(req: PriceRequest): Promise<PriceResponse> {
// we currently use the presence of routerAbi to distinguish Uniswapish from RefAMMish
if ('routerAbi' in connector) {
return uniswapPrice(<Ethereumish>chain, connector, req);
} else if ('estimate' in connector) {
return zigzagPrice(<Ethereumish>chain, connector as any, req);
} else if (connector instanceof Tinyman) {
return tinymanPrice(chain as unknown as Algorand, connector, req);
} else {
Expand All @@ -103,8 +96,8 @@ export async function trade(req: TradeRequest): Promise<TradeResponse> {
req.chain,
req.network
);
const connector: Uniswapish | RefAMMish | Tinyman | ZigZagish =
await getConnector<Uniswapish | RefAMMish | Tinyman | ZigZagish>(
const connector: Uniswapish | RefAMMish | Tinyman =
await getConnector<Uniswapish | RefAMMish | Tinyman >(
req.chain,
req.network,
req.connector
Expand All @@ -113,8 +106,6 @@ export async function trade(req: TradeRequest): Promise<TradeResponse> {
// we currently use the presence of routerAbi to distinguish Uniswapish from RefAMMish
if ('routerAbi' in connector) {
return uniswapTrade(<Ethereumish>chain, connector, req);
} else if ('estimate' in connector) {
return zigzagTrade(<Ethereumish>chain, connector as any, req);
} else if (connector instanceof Tinyman) {
return tinymanTrade(chain as unknown as Algorand, connector, req);
} else {
Expand Down
3 changes: 0 additions & 3 deletions src/chains/ethereum/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { UniswapConfig } from '../../connectors/uniswap/uniswap.config';
import { Perp } from '../../connectors/perp/perp';
import { SushiswapConfig } from '../../connectors/sushiswap/sushiswap.config';
import { OpenoceanConfig } from '../../connectors/openocean/openocean.config';
import { ZigZagConfig } from '../../connectors/zigzag/zigzag.config';

// MKR does not match the ERC20 perfectly so we need to use a separate ABI.
const MKR_ADDRESS = '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2';
Expand Down Expand Up @@ -197,8 +196,6 @@ export class Ethereum extends EthereumBase implements Ethereumish {
spender = perp.perp.contracts.vault.address;
} else if (reqSpender === 'openocean') {
spender = OpenoceanConfig.config.routerAddress('ethereum', this._chain);
} else if (reqSpender === 'zigzag') {
spender = ZigZagConfig.config.contractAddress(this._chain);
} else {
spender = reqSpender;
}
Expand Down
2 changes: 0 additions & 2 deletions src/chains/ethereum/ethereum.validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ export const validateSpender: Validator = mkValidator(
val === 'viperswap' ||
val === 'openocean' ||
val === 'quickswap' ||
val === 'defikingdoms' ||
val === 'defira' ||
val === 'mad_meerkat' ||
val === 'vvs' ||
val === 'pancakeswap' ||
val === 'xsswap' ||
val === 'zigzag' ||
isAddress(val))
);

Expand Down
4 changes: 1 addition & 3 deletions src/chains/harmony/harmony.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ export class Harmony extends EthereumBase implements Ethereumish {

getSpender(reqSpender: string): string {
let spender: string;
if (reqSpender === 'defikingdoms') {
spender = '0x24ad62502d1C652Cc7684081169D04896aC20f30';
} else if (reqSpender === 'defira') {
if (reqSpender === 'defira') {
spender = '0x3C8BF7e25EbfAaFb863256A4380A8a93490d8065';
} else if (reqSpender === 'openocean') {
spender = OpenoceanConfig.config.routerAddress('ethereum', this._chain);
Expand Down
2 changes: 0 additions & 2 deletions src/chains/harmony/harmony.validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export const validateSpender: Validator = mkValidator(
(val) =>
typeof val === 'string' &&
(val === 'sushiswap' ||
val === 'viperswap' ||
val === 'defikingdoms' ||
val === 'defira' ||
val === 'openocean' ||
isValidAddress(val))
Expand Down
14 changes: 0 additions & 14 deletions src/connectors/connectors.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { Router, Response } from 'express';
import { asyncHandler } from '../services/error-handler';
import { DefiraConfig } from './defira/defira.config';
import { DefikingdomsConfig } from './defikingdoms/defikingdoms.config';
import { MadMeerkatConfig } from './mad_meerkat/mad_meerkat.config';
import { OpenoceanConfig } from './openocean/openocean.config';
import { PangolinConfig } from './pangolin/pangolin.config';
Expand All @@ -19,7 +18,6 @@ import { InjectiveCLOBConfig } from './injective/injective.clob.config';
import { XsswapConfig } from './xsswap/xsswap.config';
import { ConnectorsResponse } from './connectors.request';
import { DexalotCLOBConfig } from './dexalot/dexalot.clob.config';
import { ZigZagConfig } from './zigzag/zigzag.config';
import { TinymanConfig } from './tinyman/tinyman.config';

export namespace ConnectorsRoutes {
Expand Down Expand Up @@ -81,12 +79,6 @@ export namespace ConnectorsRoutes {
chain_type: TraderjoeConfig.config.chainType,
available_networks: TraderjoeConfig.config.availableNetworks,
},
{
name: 'defikingdoms',
trading_type: DefikingdomsConfig.config.tradingTypes,
chain_type: DefikingdomsConfig.config.chainType,
available_networks: DefikingdomsConfig.config.availableNetworks,
},
{
name: 'defira',
trading_type: DefiraConfig.config.tradingTypes,
Expand Down Expand Up @@ -153,12 +145,6 @@ export namespace ConnectorsRoutes {
'Enter a Dexalot API Key if you have one, otherwise hit return >>> ',
},
},
{
name: 'zigzag',
trading_type: ZigZagConfig.config.tradingTypes,
chain_type: ZigZagConfig.config.chainType,
available_networks: ZigZagConfig.config.availableNetworks,
},
{
name: 'tinyman',
trading_type: TinymanConfig.config.tradingTypes,
Expand Down
33 changes: 0 additions & 33 deletions src/connectors/defikingdoms/defikingdoms.config.ts

This file was deleted.

Loading

0 comments on commit f834a3e

Please sign in to comment.