πStaking and Rewards [USDA-sUSDT LP]
An overview of the contract facilitating staking and reward distributions for the USDA-sUSDT liquidity pool within the BitFlow StableSwap.
Data Storage
reward-cycle-index
(define-constant reward-cycle-index (list u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34 u35 u36 u37 u38 u39 u40 u41 u42 u43 u44 u45 u46 u47 u48 u49 u50 u51 u52 u53 u54 u55 u56 u57 u58 u59 u60 u61 u62 u63 u64 u65 u66 u67 u68 u69 u70 u71 u72 u73 u74 u75 u76 u77 u78 u79 u80 u81 u82 u83 u84 u85 u86 u87 u88 u89 u90 u91 u92 u93 u94 u95 u96 u97 u98 u99 u100 u101 u102 u103 u104 u105 u106 u107 u108 u109 u110 u111 u112 u113 u114 u115 u116 u117 u118 u119 u120))helper-uint
(define-data-var helper-uint uint u0)helper-uint-list
(define-data-var helper-uint-list (list 12000 uint) (list ))StakerDataMap
(define-map StakerDataMap {x-token: principal, y-token: principal, lp-token: principal, user: principal} {
cycles-staked: (list 12000 uint),
cycles-to-unstake: (list 12000 uint),
total-currently-staked: uint
})StakerDataPerCycleMap
DataPerCycleMap
TotalStakedPerPairMap
Error Codes
err-no-pair-data
err-pair-not-approved
err-cycles-too-high
err-cycles-too-low
err-amount-too-low
err-lp-token-transfer-failed
err-cycles-staked-overflow
err-cycles-to-unstake-overflow
err-no-cycle-data
err-no-rewards-to-claim
err-rewards-already-claimed
err-cycle-too-high
err-y-token-transfer-failed
err-x-token-transfer-failed
err-no-staker-data
err-no-total-staked-per-pair
err-no-lp-tokens-to-unstake
err-failed-to-transfer-lp-tokens
Public Functions
stake-lp-tokens
claim-cycle-staking-rewards
claim-all-staking-rewards
unstake-all-lp-tokens
Private Functions
filter-null-value
map-filtered-null-list
filter-list
filter-unstaked-cycle
update-staker-data-per-cycle-fold
fold-from-all-cycles-to-cycles-unclaimed
fold-from-all-cycles-to-unstakeable-cycles
Read-only Functions
get-user-data
get-user-data-at-cycle
get-data-at-cycle
get-total-staked
get-staking-rewards-at-cycle
Last updated