Skip to content

Commit

Permalink
remove zigzag
Browse files Browse the repository at this point in the history
  • Loading branch information
nikspz committed Jul 17, 2023
1 parent ce7ddd1 commit 9acb7e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
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

0 comments on commit 9acb7e0

Please sign in to comment.