File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,22 +23,6 @@ access(all) let targetHealthFactor = 1.3
2323
2424access (all ) var snapshot : UInt64 = 0
2525
26- // Helper function to get Flow collateral from position
27- access (all ) fun getFlowCollateralFromPosition (pid : UInt64 ): UFix64 {
28- let positionDetails = getPositionDetails (pid : pid , beFailed : false )
29- for balance in positionDetails .balances {
30- if balance .vaultType == Type <@FlowToken.Vault >() {
31- // Credit means it's a deposit (collateral)
32- if balance .direction .rawValue == 0 { // Credit = 0
33- return balance .balance
34- }
35- }
36- }
37- return 0.0
38- }
39-
40-
41-
4226// Enhanced diagnostic precision tracking function with full call stack tracing
4327access (all ) fun performDiagnosticPrecisionTrace (
4428 yieldVaultID : UInt64 ,
Original file line number Diff line number Diff line change @@ -23,34 +23,6 @@ access(all) let targetHealthFactor = 1.3
2323
2424access (all ) var snapshot : UInt64 = 0
2525
26- // Helper function to get Flow collateral from position
27- access (all ) fun getFlowCollateralFromPosition (pid : UInt64 ): UFix64 {
28- let positionDetails = getPositionDetails (pid : pid , beFailed : false )
29- for balance in positionDetails .balances {
30- if balance .vaultType == Type <@FlowToken.Vault >() {
31- // Credit means it's a deposit (collateral)
32- if balance .direction == FlowALPv0 .BalanceDirection .Credit {
33- return balance .balance
34- }
35- }
36- }
37- return 0.0
38- }
39-
40- // Helper function to get MOET debt from position
41- access (all ) fun getMOETDebtFromPosition (pid : UInt64 ): UFix64 {
42- let positionDetails = getPositionDetails (pid : pid , beFailed : false )
43- for balance in positionDetails .balances {
44- if balance .vaultType == Type <@MOET.Vault >() {
45- // Debit means it's borrowed (debt)
46- if balance .direction == FlowALPv0 .BalanceDirection .Debit {
47- return balance .balance
48- }
49- }
50- }
51- return 0.0
52- }
53-
5426access (all )
5527fun setup () {
5628 deployContracts ()
Original file line number Diff line number Diff line change @@ -23,34 +23,6 @@ access(all) let targetHealthFactor = 1.3
2323
2424access (all ) var snapshot : UInt64 = 0
2525
26- // Helper function to get Flow collateral from position
27- access (all ) fun getFlowCollateralFromPosition (pid : UInt64 ): UFix64 {
28- let positionDetails = getPositionDetails (pid : pid , beFailed : false )
29- for balance in positionDetails .balances {
30- if balance .vaultType == Type <@FlowToken.Vault >() {
31- // Credit means it's a deposit (collateral)
32- if balance .direction .rawValue == 0 { // Credit = 0
33- return balance .balance
34- }
35- }
36- }
37- return 0.0
38- }
39-
40- // Helper function to get MOET debt from position
41- access (all ) fun getMOETDebtFromPosition (pid : UInt64 ): UFix64 {
42- let positionDetails = getPositionDetails (pid : pid , beFailed : false )
43- for balance in positionDetails .balances {
44- if balance .vaultType == Type <@MOET.Vault >() {
45- // Debit means it's borrowed (debt)
46- if balance .direction .rawValue == 1 { // Debit = 1
47- return balance .balance
48- }
49- }
50- }
51- return 0.0
52- }
53-
5426access (all )
5527fun setup () {
5628 deployContracts ()
Original file line number Diff line number Diff line change @@ -23,34 +23,6 @@ access(all) let targetHealthFactor = 1.3
2323
2424access (all ) var snapshot : UInt64 = 0
2525
26- // Helper function to get Flow collateral from position
27- access (all ) fun getFlowCollateralFromPosition (pid : UInt64 ): UFix64 {
28- let positionDetails = getPositionDetails (pid : pid , beFailed : false )
29- for balance in positionDetails .balances {
30- if balance .vaultType == Type <@FlowToken.Vault >() {
31- // Credit means it's a deposit (collateral)
32- if balance .direction == FlowALPv0 .BalanceDirection .Credit {
33- return balance .balance
34- }
35- }
36- }
37- return 0.0
38- }
39-
40- // Helper function to get MOET debt from position
41- access (all ) fun getMOETDebtFromPosition (pid : UInt64 ): UFix64 {
42- let positionDetails = getPositionDetails (pid : pid , beFailed : false )
43- for balance in positionDetails .balances {
44- if balance .vaultType == Type <@MOET.Vault >() {
45- // Debit means it's borrowed (debt)
46- if balance .direction == FlowALPv0 .BalanceDirection .Debit {
47- return balance .balance
48- }
49- }
50- }
51- return 0.0
52- }
53-
5426access (all )
5527fun setup () {
5628 deployContracts ()
Original file line number Diff line number Diff line change @@ -23,34 +23,6 @@ access(all) let targetHealthFactor = 1.3
2323
2424access (all ) var snapshot : UInt64 = 0
2525
26- // Helper function to get Flow collateral from position
27- access (all ) fun getFlowCollateralFromPosition (pid : UInt64 ): UFix64 {
28- let positionDetails = getPositionDetails (pid : pid , beFailed : false )
29- for balance in positionDetails .balances {
30- if balance .vaultType == Type <@FlowToken.Vault >() {
31- // Credit means it's a deposit (collateral)
32- if balance .direction == FlowALPv0 .BalanceDirection .Credit {
33- return balance .balance
34- }
35- }
36- }
37- return 0.0
38- }
39-
40- // Helper function to get MOET debt from position
41- access (all ) fun getMOETDebtFromPosition (pid : UInt64 ): UFix64 {
42- let positionDetails = getPositionDetails (pid : pid , beFailed : false )
43- for balance in positionDetails .balances {
44- if balance .vaultType == Type <@MOET.Vault >() {
45- // Debit means it's borrowed (debt)
46- if balance .direction == FlowALPv0 .BalanceDirection .Debit {
47- return balance .balance
48- }
49- }
50- }
51- return 0.0
52- }
53-
5426access (all )
5527fun setup () {
5628 deployContracts ()
You can’t perform that action at this time.
0 commit comments