Files
orionprotocol-sdk/src/utils/getSwapSide.ts
Aleksandr Kraiz 106b702d21 Initial commit
2022-04-20 23:41:04 +04:00

15 lines
359 B
TypeScript

export default function getSwapSide(
assetIn: string | null | undefined,
assetOut: string | null | undefined,
type: 'exactSpend' | 'exactReceive',
) {
if (!assetIn || !assetOut) {
return undefined;
}
if (assetOut === 'USDT') return 'SELL';
if (assetIn === 'USDT') return 'BUY';
if (type === 'exactSpend') return 'SELL';
return 'BUY';
}