Skip to content
Draft
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 @@ -241,7 +241,9 @@ fun main(address: Address): CompleteUserSummary {
// Since we can't directly map tide IDs to position IDs, we'll try sequential IDs
// This assumes positions are created in order (0, 1, 2, ...)
let positionIndex = UInt64(positions.length) // Use the current position index
actualHealth = pool.positionHealth(pid: positionIndex)
let healthUInt128 = pool.positionHealth(pid: positionIndex)
// Scale factor: 10^18 = 1e18, but split to avoid UFix64 overflow
actualHealth = UFix64(healthUInt128 / 1000000000000000000)
}

let estimatedHealth = actualHealth
Expand Down
3 changes: 2 additions & 1 deletion cadence/transactions/tidal-yield/setup.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import "FungibleToken"
import "FungibleTokenMetadataViews"
import "ViewResolver"

import "TidalYieldClosedBeta"
import "TidalYield"

/// Configures a TidalYield.TideManager at the canonical path. If one is already configured, the transaction no-ops
///
transaction {
prepare(signer: auth(BorrowValue, SaveValue, StorageCapabilities, PublishCapability) &Account) {
prepare(signer: auth(BorrowValue, SaveValue, StorageCapabilities, PublishCapability, CopyValue) &Account) {
let betaCap = signer.storage.copy<Capability<auth(TidalYieldClosedBeta.Beta) &TidalYieldClosedBeta.BetaBadge>>(from: TidalYieldClosedBeta.UserBetaCapStoragePath)
?? panic("Signer does not have a BetaBadge stored at path \(TidalYieldClosedBeta.UserBetaCapStoragePath) - configure and retry")

Expand Down
Loading