Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWN-989 - Swap fixes with slippage and LP #2202

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SwapStateManager(

companion object {
const val DEFAULT_ACTIVE_ROUTE_ORDINAL = 0
val DEFAULT_SLIPPAGE = Slippage.Medium
val DEFAULT_SLIPPAGE = Slippage.One
}

override val coroutineContext: CoroutineContext = SupervisorJob() + dispatchers.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,12 @@ class SwapInfoLiquidityFeeMapper(
val liquidityToken = swapTokensRepository.findTokenByMint(routePlan.feeMint)
val liquidityFee = routePlan.feeAmount

val feePercent = "${routePlan.percent}%"
val firstLineText = TextViewCellModel.Raw(
text = TextContainer(R.string.swap_info_details_liquidity_cell_title, label, feePercent),
val liquidityOwner = TextViewCellModel.Raw(
text = TextContainer(R.string.swap_info_details_liquidity_cell_title, label),
maxLines = 2
)

val secondLineText = liquidityToken?.let {
val feeAmountFormatted = liquidityToken?.let {
val feeInTokenLamports = liquidityFee
.fromLamports(it.decimals)
.formatTokenWithSymbol(it.tokenSymbol, it.decimals)
Expand All @@ -108,8 +107,8 @@ class SwapInfoLiquidityFeeMapper(
return MainCellModel(
styleType = MainCellStyle.BASE_CELL,
leftSideCellModel = LeftSideCellModel.IconWithText(
firstLineText = firstLineText,
secondLineText = secondLineText
firstLineText = liquidityOwner,
secondLineText = feeAmountFormatted
),
rightSideCellModel = rightSideSkeleton(),
)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/swap_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</string>
<string name="swap_info_details_interest_fee_title">Interest bearing</string>

<string name="swap_info_details_liquidity_cell_title">%s Liquidity fee %s</string>
<string name="swap_info_details_liquidity_cell_title">%s Liquidity fee</string>
<string name="swap_info_details_key_app_fee_title">Swap fee</string>

<string name="swap_non_strict_warning_title">The token %s is out of the strict list</string>
Expand Down
Loading