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

Withdraw Failed #167

Open
wkshare opened this issue Jun 2, 2024 · 2 comments
Open

Withdraw Failed #167

wkshare opened this issue Jun 2, 2024 · 2 comments

Comments

@wkshare
Copy link

wkshare commented Jun 2, 2024

Code:

spot_market_index = 0 # USDC
#amount_in_spot_market_precision = drift_client.convert_to_spot_precision(spot_market_index, 100) # $100

user_token_account = drift_client.get_associated_token_account_public_key(0)

try:
    tx_sig_and_slot = await drift_client.withdraw(
        100**7,
        0,
        user_token_account
    )
    print(f"Withdrew successfully: {tx_sig_and_slot.tx_sig}")
except Exception as e:
    print(f"Failed to withdraw: {e}")

Error Information:

Failed to withdraw: SendTransactionPreflightFailureMessage { message: "Transaction simulation failed: Error processing Instruction 2: custom program error: 0x1793", data: RpcSimulateTransactionResult(RpcSimulateTransactionResult { err: Some(InstructionError(2, Custom(6035))), logs: Some(["Program ComputeBudget111111111111111111111111111111 invoke [1]", "Program ComputeBudget111111111111111111111111111111 success", "Program ComputeBudget111111111111111111111111111111 invoke [1]", "Program ComputeBudget111111111111111111111111111111 success", "Program dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH invoke [1]", "Program log: Instruction: Withdraw", "Program data: t7rLuuG7X4LfD1xmAAAAAAUA+onLEdRtDwAAAAAAAAAAAPDO4WsCAAAAAAAAAAAAAACLo0QgpSIEAAAAAAAAAAAAI2zpigIAAAAAAAAAAAAAAGCuCgBADQMAoCUmAA==", "Program log: Invalid Spot 14 Oracle: Stale (oracle_delay=148)", "Program log: Invalid Spot 6 Oracle: Stale (oracle_delay=19)", "Program log: Error InvalidOracle thrown at programs/drift/src/math/margin.rs:593", "Program log: User attempting to withdraw with outstanding liabilities when an oracle is invalid", "Program log: AnchorError occurred. Error Code: InvalidOracle. Error Number: 6035. Error Message: InvalidOracle.", "Program dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH consumed 298791 of 299700 compute units", "Program dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH failed: custom program error: 0x1793"]), accounts: None, units_consumed: Some(300), return_data: None, inner_instructions: None }) }
@wkshare
Copy link
Author

wkshare commented Jun 2, 2024

How to refresh oracle???? @soundsonacid

@wkshare
Copy link
Author

wkshare commented Jun 2, 2024

"Program log: User attempting to withdraw with outstanding liabilities when an oracle is invalid"
how to fix this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant