fix: update OS listing fee (#6505)

* update OS listing fee

* remove redundancy

---------

Co-authored-by: Charles Bachmeier <charlie@genie.xyz>
This commit is contained in:
Charles Bachmeier 2023-05-08 10:28:01 -07:00 committed by GitHub
parent 04d9ff7d71
commit ff080aa957
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 26 deletions

@ -1,15 +1,9 @@
// eslint-disable-next-line no-restricted-imports
import { t } from '@lingui/macro'
import Column from 'components/Column'
import Row from 'components/Row'
import { MouseoverTooltip } from 'components/Tooltip'
import { RowsCollpsedIcon, RowsExpandedIcon } from 'nft/components/icons'
import {
getMarketplaceFee,
getRoyalty,
useHandleGlobalPriceToggle,
useSyncPriceWithGlobalMethod,
} from 'nft/components/profile/list/utils'
import { getRoyalty, useHandleGlobalPriceToggle, useSyncPriceWithGlobalMethod } from 'nft/components/profile/list/utils'
import { useSellAsset } from 'nft/hooks'
import { ListingMarket, WalletAsset } from 'nft/types'
import { getMarketplaceIcon } from 'nft/utils'
@ -154,17 +148,13 @@ export const MarketplaceRow = ({
)
const fees = useMemo(() => {
if (selectedMarkets.length === 1) {
return getRoyalty(selectedMarkets[0], asset) + getMarketplaceFee(selectedMarkets[0], asset)
} else {
let max = 0
for (const selectedMarket of selectedMarkets) {
const fee = getRoyalty(selectedMarket, asset) + getMarketplaceFee(selectedMarket, asset)
max = Math.max(fee, max)
}
return max
let maxFee = 0
for (const selectedMarket of selectedMarkets) {
const fee = getRoyalty(selectedMarket, asset) + selectedMarket.fee
maxFee = Math.max(fee, maxFee)
}
return maxFee
}, [asset, selectedMarkets])
const feeInEth = price && (price * fees) / 100

@ -1,7 +1,7 @@
import { Trans } from '@lingui/macro'
import Column from 'components/Column'
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 { formatEth, getMarketplaceIcon } from 'nft/utils'
import styled, { css } from 'styled-components/macro'
@ -68,7 +68,7 @@ export const RoyaltyTooltip = ({
<Trans>fee</Trans>
</ThemedText.Caption>
</Row>
<FeePercent>{getMarketplaceFee(market, asset)}%</FeePercent>
<FeePercent>{market.fee}%</FeePercent>
</FeeWrap>
))}
<FeeWrap>

@ -227,11 +227,6 @@ export const getRoyalty = (listingMarket: ListingMarket, asset: WalletAsset) =>
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
export const findListingIssues = (sellAssets: WalletAsset[]) => {

@ -38,7 +38,7 @@ export const ListingMarkets: ListingMarket[] = [
},
{
name: 'OpenSea',
fee: 0,
fee: 2.5,
},
]
@ -59,7 +59,7 @@ const getConsiderationItems = (
openSeaFee?: ConsiderationInputItem
} => {
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 creatorFee = price