Skip to content

Conversation

@Kailai-Wang
Copy link
Collaborator

@Kailai-Wang Kailai-Wang commented Oct 30, 2025

Context

This is a big refactoring to the current impl:

  • it introduces various LoanState which will be updated after each action
  • it tries to use a waterfall pattern to be able to resume from any state where it was left off (like state machine).
  • it improves the readability by separating the logic into smaller functions and outlining the flow in the main handler
  • it adds two test rpcs for easier debugging of position opening and closing:
    • openPositionTest
    • closePositionTest

Please beware of the rpc parameter change and struct change, examples:

  • no client_id in any of the RPCs
  • an optional loan_nonce in requestLoanTest - if we wish to resume from some intermediate state of a specific loan, pass in that loan nonce, for fresh new loans you either leave it out or use the same nonce as in the userop
  • to_perp_move_tx_hash is added into requestLoan response
  • the LoanRecord struct change

@vercel
Copy link

vercel bot commented Oct 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
heima Ready Ready Preview Comment Oct 31, 2025 11:30pm
heima-aa-demo-app Ready Ready Preview Comment Oct 31, 2025 11:30pm

@Kailai-Wang Kailai-Wang self-assigned this Oct 30, 2025
@claude
Copy link

claude bot commented Oct 30, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@Kailai-Wang Kailai-Wang requested a review from a team October 30, 2025 01:03
@Kailai-Wang Kailai-Wang merged commit 6cf5aeb into dev Nov 3, 2025
20 checks passed
@Kailai-Wang Kailai-Wang deleted the add-more-loan-record-status branch November 3, 2025 08:52
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

Successfully merging this pull request may close these issues.

3 participants