Updated on 2026-08-14
This commit is contained in:
parent
3767ae01b2
commit
ee0e649e6a
9 changed files with 63 additions and 33 deletions
|
|
@ -0,0 +1,8 @@
|
|||
package com.tangem.domain.staking.model
|
||||
|
||||
sealed class CooldownPeriod {
|
||||
|
||||
data class Fixed(val days: Int) : CooldownPeriod()
|
||||
|
||||
data class Range(val minDays: Int, val maxDays: Int) : CooldownPeriod()
|
||||
}
|
||||
|
|
@ -64,7 +64,10 @@ class P2PEthPoolIntegration(
|
|||
|
||||
override val warmupPeriodDays: Int = 0
|
||||
|
||||
override val cooldownPeriodDays: Int = DEFAULT_COOLDOWN_DAYS
|
||||
override val cooldownPeriod: CooldownPeriod = CooldownPeriod.Range(
|
||||
minDays = MIN_COOLDOWN_DAYS,
|
||||
maxDays = MAX_COOLDOWN_DAYS,
|
||||
)
|
||||
|
||||
override val rewardSchedule: RewardSchedule = RewardSchedule.DAY
|
||||
|
||||
|
|
@ -73,7 +76,8 @@ class P2PEthPoolIntegration(
|
|||
override fun getCurrentToken(rawCurrencyId: CryptoCurrency.RawID?): YieldToken = token
|
||||
|
||||
companion object {
|
||||
private const val DEFAULT_COOLDOWN_DAYS = 7
|
||||
private const val MIN_COOLDOWN_DAYS = 1
|
||||
private const val MAX_COOLDOWN_DAYS = 4
|
||||
private val DEFAULT_MINIMUM_STAKE = BigDecimal("0.01")
|
||||
}
|
||||
}
|
||||
|
|
@ -51,7 +51,9 @@ class StakeKitIntegration(
|
|||
|
||||
override val warmupPeriodDays: Int = yield.metadata.warmupPeriod.days
|
||||
|
||||
override val cooldownPeriodDays: Int? = yield.metadata.cooldownPeriod?.days
|
||||
override val cooldownPeriod: CooldownPeriod? = yield.metadata.cooldownPeriod?.days?.let {
|
||||
CooldownPeriod.Fixed(it)
|
||||
}
|
||||
|
||||
override val rewardSchedule: RewardSchedule = yield.metadata.rewardSchedule.toRewardSchedule()
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ sealed interface StakingIntegration {
|
|||
|
||||
val warmupPeriodDays: Int
|
||||
|
||||
val cooldownPeriodDays: Int?
|
||||
val cooldownPeriod: CooldownPeriod?
|
||||
|
||||
val rewardSchedule: RewardSchedule
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue