Technical Implementation Note

The Temporal AMM produces a forward curve by adding a duration parameter. Consequently, time and space complexity exponentially increase for forward curve AMMs as opposed to incumbent AMMs. Thus, the traditional brute force approach is not efficient for such a construction, instead a tree like structure is proposed. We’re using a self-balancing Red-Black (RB) Tree to achieve:

  1. Efficient Lookups: O(logN) time complexity for Lookups, Insertion and deletion; where N is max LP duration.

  2. Concurrency: The RB Tree is structured to allow concurrent Read and Write. Powers the system for a higher transaction throughput, where multiple users lend, borrow, and LP simultaneously.

Last updated