Commit ff080aa9 authored by Charles Bachmeier's avatar Charles Bachmeier Committed by GitHub

fix: update OS listing fee (#6505)

* update OS listing fee

* remove redundancy

---------
Co-authored-by: default avatarCharles Bachmeier <charlie@genie.xyz>
parent 04d9ff7d
// eslint-disable-next-line no-restricted-imports
import { t } from '@lingui/macro' import { t } from '@lingui/macro'
import Column from 'components/Column' import Column from 'components/Column'
import Row from 'components/Row' import Row from 'components/Row'
import { MouseoverTooltip } from 'components/Tooltip' import { MouseoverTooltip } from 'components/Tooltip'
import { RowsCollpsedIcon, RowsExpandedIcon } from 'nft/components/icons' import { RowsCollpsedIcon, RowsExpandedIcon } from 'nft/components/icons'
import { import { getRoyalty, useHandleGlobalPriceToggle, useSyncPriceWithGlobalMethod } from 'nft/components/profile/list/utils'
getMarketplaceFee,
getRoyalty,
useHandleGlobalPriceToggle,
useSyncPriceWithGlobalMethod,
} from 'nft/components/profile/list/utils'
import { useSellAsset } from 'nft/hooks' import { useSellAsset } from 'nft/hooks'
import { ListingMarket, WalletAsset } from 'nft/types' import { ListingMarket, WalletAsset } from 'nft/types'
import { getMarketplaceIcon } from 'nft/utils' import { getMarketplaceIcon } from 'nft/utils'
...@@ -154,17 +148,13 @@ export const MarketplaceRow = ({ ...@@ -154,17 +148,13 @@ export const MarketplaceRow = ({
) )
const fees = useMemo(() => { const fees = useMemo(() => {
if (selectedMarkets.length === 1) { let maxFee = 0
return getRoyalty(selectedMarkets[0], asset) + getMarketplaceFee(selectedMarkets[0], asset) for (const selectedMarket of selectedMarkets) {
} else { const fee = getRoyalty(selectedMarket, asset) + selectedMarket.fee
let max = 0 maxFee = Math.max(fee, maxFee)
for (const selectedMarket of selectedMarkets) {
const fee = getRoyalty(selectedMarket, asset) + getMarketplaceFee(selectedMarket, asset)
max = Math.max(fee, max)
}
return max
} }
return maxFee
}, [asset, selectedMarkets]) }, [asset, selectedMarkets])
const feeInEth = price && (price * fees) / 100 const feeInEth = price && (price * fees) / 100
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import Column from 'components/Column' import Column from 'components/Column'
import Row from 'components/Row' import Row from 'components/Row'
import { getMarketplaceFee, getRoyalty } from 'nft/components/profile/list/utils' import { getRoyalty } from 'nft/components/profile/list/utils'
import { ListingMarket, WalletAsset } from 'nft/types' import { ListingMarket, WalletAsset } from 'nft/types'
import { formatEth, getMarketplaceIcon } from 'nft/utils' import { formatEth, getMarketplaceIcon } from 'nft/utils'
import styled, { css } from 'styled-components/macro' import styled, { css } from 'styled-components/macro'
...@@ -68,7 +68,7 @@ export const RoyaltyTooltip = ({ ...@@ -68,7 +68,7 @@ export const RoyaltyTooltip = ({
<Trans>fee</Trans> <Trans>fee</Trans>
</ThemedText.Caption> </ThemedText.Caption>
</Row> </Row>
<FeePercent>{getMarketplaceFee(market, asset)}%</FeePercent> <FeePercent>{market.fee}%</FeePercent>
</FeeWrap> </FeeWrap>
))} ))}
<FeeWrap> <FeeWrap>
......
...@@ -227,11 +227,6 @@ export const getRoyalty = (listingMarket: ListingMarket, asset: WalletAsset) => ...@@ -227,11 +227,6 @@ export const getRoyalty = (listingMarket: ListingMarket, asset: WalletAsset) =>
return baseFee * 0.01 return baseFee * 0.01
} }
// OpenSea has a 0.5% fee for all assets that do not have a royalty set
export const getMarketplaceFee = (listingMarket: ListingMarket, asset: WalletAsset) => {
return listingMarket.name === 'OpenSea' && !asset.basisPoints ? 0.5 : listingMarket.fee
}
const BELOW_FLOOR_PRICE_THRESHOLD = 0.8 const BELOW_FLOOR_PRICE_THRESHOLD = 0.8
export const findListingIssues = (sellAssets: WalletAsset[]) => { export const findListingIssues = (sellAssets: WalletAsset[]) => {
......
...@@ -38,7 +38,7 @@ export const ListingMarkets: ListingMarket[] = [ ...@@ -38,7 +38,7 @@ export const ListingMarkets: ListingMarket[] = [
}, },
{ {
name: 'OpenSea', name: 'OpenSea',
fee: 0, fee: 2.5,
}, },
] ]
...@@ -59,7 +59,7 @@ const getConsiderationItems = ( ...@@ -59,7 +59,7 @@ const getConsiderationItems = (
openSeaFee?: ConsiderationInputItem openSeaFee?: ConsiderationInputItem
} => { } => {
const creatorFeeBasisPoints = asset?.basisPoints ?? 0 const creatorFeeBasisPoints = asset?.basisPoints ?? 0
const openSeaBasisPoints = !asset?.basisPoints ? 50 : 0 const openSeaBasisPoints = (ListingMarkets.find((market) => market.name === 'OpenSea')?.fee ?? 0) * 100
const sellerBasisPoints = INVERSE_BASIS_POINTS - creatorFeeBasisPoints - openSeaBasisPoints const sellerBasisPoints = INVERSE_BASIS_POINTS - creatorFeeBasisPoints - openSeaBasisPoints
const creatorFee = price const creatorFee = price
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment