Hyperliquid vault
There are two components for the delta neutral strategy on Hyperliquid:
Smart Contracts: The vault contract deployed on hyperEVM holds all the user funds and also creates a short positon on HyperCore side. The vault contract has access of funds at all time and uses corewriter to manage positions on hyperCore.
Oracle: The offchain oracle is responsible for triggering actions like opening and closing of positions. It never gets access to the funds, it just has the ability to trigger certain functionality through vault smart contract. The oracle also follows an epoch based approach so process deposits and withdrawals. This allows it to process them in more efficient manner.
Below are smart contract functions that used by user and oracle:
User specific functions
deposit: User calls this function with amount of USDT0 he wants to deposit in the vault.
totalAssets: User can check total USDT balance of all the positions that vault contract holds. The positions include, funding rate, short position, long positions and amount in the contract.
balanceOf: User can check their share balance using this function
convertToAssets: User can check how much they'll get at time of withdrawals with the help of this function
requestWithdrawal: User can call this function with amount of shares they want to withdraw
Oracle specific functions
transferUSDT0ToCore: Oracle can call this function to send funds to hyperCore address. The funds are only transferred to vault address on hyperCore
swapUSDT0ForExactHype: function used by oracle to swap usdt0 to exact hype amount for which the short position was opened on hyperCore
placeLimitOrder: function used by oracle to open short position on vault contract behalf on hyperCore
updateEpoch: function used by oracle to start a new epoch and start the process to handle deposits and withdrawals
processEpochAndNotify: function used by oracle to finish the epoch and finalise all the withdrawal request created in previous epoch
Last updated