Skip to content

Commit

Permalink
remove unused cowswap fields
Browse files Browse the repository at this point in the history
  • Loading branch information
franzns committed Dec 20, 2023
1 parent 5a777bb commit 27ca9aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
11 changes: 5 additions & 6 deletions modules/sor/constants.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { TokenAmount } from '@balancer/sdk';
import { GqlCowSwapApiResponse, GqlSorSwapType } from '../../schema';

export const EMPTY_COWSWAP_RESPONSE = (assetIn: string, assetOut: string, amount: TokenAmount): GqlCowSwapApiResponse => {
export const EMPTY_COWSWAP_RESPONSE = (
assetIn: string,
assetOut: string,
amount: TokenAmount,
): GqlCowSwapApiResponse => {
return {
marketSp: '0',
returnAmount: '0',
returnAmountConsideringFees: '0',
returnAmountFromSwaps: '0',
swapAmount: amount.amount.toString(),
swapAmountForSwaps: '0',
swaps: [],
tokenAddresses: [],
tokenIn: assetIn,
Expand Down Expand Up @@ -352,4 +352,3 @@ export const poolsToIgnore = [
'0xbfd65c6160cfd638a85c645e6e6d8acac5dac935000000000000000000000004',
'0xe274c9deb6ed34cfe4130f8d0a8a948dea5bb28600000000000000000000000d',
];

4 changes: 0 additions & 4 deletions modules/sor/sor.gql
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ type GqlCowSwapApiResponse {
tokenAddresses: [String!]!
swaps: [GqlSwap!]!
swapAmount: String!
swapAmountForSwaps: String!
returnAmount: String!
returnAmountFromSwaps: String!
returnAmountConsideringFees: String!
tokenIn: String!
tokenOut: String!
marketSp: String!
}

type GqlSwap {
Expand Down
4 changes: 0 additions & 4 deletions modules/sor/sorV2/sorV2.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,8 @@ class SwapResultV2 implements SwapResult {
const swapAmount =
swap.swapKind === SwapKind.GivenIn ? inputAmount.amount.toString() : outputAmount.amount.toString();
return {
marketSp: '', // CowSwap is not using this field, confirmed.
returnAmount,
returnAmountConsideringFees: returnAmount, // CowSwap is not using this field, confirmed.
returnAmountFromSwaps: returnAmount, // CowSwap is not using this field, confirmed.
swapAmount,
swapAmountForSwaps: swapAmount, // CowSwap is not using this field, confirmed.
swaps,
tokenAddresses: swap.assets,
tokenIn: swap.inputAmount.token.address,
Expand Down

0 comments on commit 27ca9aa

Please sign in to comment.