Functions

Trading

(define-public 
    (deposit-funds 
        (amount uint) 
        (depositor principal))) 

The function transfers the underlying amount from the depositor to the vault contract.

(define-public 
    (payout-funds 
        (amount uint)
        (recipient principal)))

The function pays out the underlying amount to the recipient. The function is called by the comptroller contract as part of the logic for confirm-trade .

Intra-epoch

(define-public 
    (queue-deposit 
        (amount uint))) 

The function transfers the underlying amount to the vault contract and creates a claim for the deposited amount in the claims map.

(define-public 
    (queue-withdrawal 
        (amount uint))) 

The function transfers the token amount to the vault contract and creates a claim for the token amount in the claims map.

(define-public 
    (claim 
        (address principal))) 

The function transfers the total underlying and token amount of all outstanding claims to the address.

(define-public 
    (claim 
        (addresses (list 1000 principal))))

The function transfers the total underlying and token amount of all outstanding claims for each address in the addresses list.

Settlement

(define-read-only 
    (get-underlying-per-token))

The function returns the current price of one token.

(define-public 
    (create-epoch-info-for-claims))

The function creates a new entry in the epoch-info-for-claims map and adds 1 to the current-epoch-id variable.

(define-public 
    (update-epoch-info-for-claims))

The function writes the current underlying-per-token value to the epoch-info-for-claims map.

Claim Activation

(define-public 
    (activate-pending-deposit-claims))

The function updates the tokens-reserved-for-claims variable and resets total-pending-deposits.

(define-public 
    (activate-pending-withdrawal-claims))

The function updates the underlying-reserved-for-claims variable, burns the tokens queue for withdrawal which implicitly resets total-pending-withdrawals.

Last updated