Skip to Content
nullPointdocs

Contract reference

Every method of the vault contract, who may call it, and its parameters.

Source: contracts/vault/src/lib.rs. Amounts are strings in base units (USDC has 6 decimals; shares use the same scale).

Anyone

MethodArgumentsWhat it does
ft_on_transfervia ft_transfer_call on the USDC token, msg: ""Deposit. Takes the 0.5% fee, mints shares at the current share price. Refuses (and the token returns the USDC) when paused, over max_tvl, or when the share price is older than max_nav_age_s
request_withdrawsharesBurns your shares and queues a payout. Returns the withdrawal id
execute_withdrawidSubmits a payout the contract already signed. No caller check; it can only pay the account that asked
sweepMoves deposited USDC into the vault's Intents account

Agent

MethodArgumentsWhat it does
report_pricesquotes: [{ message, signature }]Verifies 1Click price quotes (coin → USDC, at most 120 s old) and stores each coin's price
report_positionpositions: [{ symbol, size, entry_notional }], account_valueReads the Intents balances itself, checks the hedge and the reported Hyperliquid value, sets the NAV, charges the performance fee, records history. Pauses on a violation; drops a report built on stale prices
report_decisiondecision: { hash, source, action, target, accepted, note, chat_id, signing_address }Stores an AI or rule decision (note up to 280 characters)
sign_quotemessage, signature, salt_hexVerifies a 1Click quote, builds the transfer (or Hyperliquid sendAsset) and asks NEAR's signers to sign it. See Swaps
fulfill_withdrawid, salt_hexPrices a queued withdrawal and asks NEAR's signers to sign the USDC payout to its owner

Owner

MethodArgumentsWhat it does
set_paramsparams (below)Changes limits. Fees are checked against their caps
set_pausedpausedStops or resumes deposits, withdrawals and swaps
set_agentagentReplaces the agent's NEAR account
set_margin_netmargin_netCorrects the record of collateral moved, after an investigation
approve_agentagent (0x address), nameAsks NEAR's signers to sign Hyperliquid approveAgent. Approving a new address under the same name replaces the old key

Views

MethodReturns
get_stateOwner, agent, config, params, assets with prices, snapshot (NAV, time, balances), positions, totals, paused
get_shares(account_id)Shares held
get_holding(account_id){ shares, deposited, entry_cost }: what you put in and the deposit fees inside it
get_withdrawals(from, limit)Queue with status queued, signed, done or failed
get_signed(from, limit)Every payload the contract asked to be signed, with the signature and the verified swap
get_decisions(from, limit)Every AI or rule decision
get_nav_history(from, limit)(time, NAV, shares) records

Parameters

FieldTestnetMainnetMeaning
max_tvl1,000 USDC100 USDCDeposit cap
max_swap_usdc10050Largest single swap or transfer
max_slippage_bps150150Coin swaps vs the stored price
margin_slippage_bps300500Collateral transfers
hedge_band_bps200200Short vs spot per coin
max_report_drift_bps200200Reported Hyperliquid value vs expected
dust_usdc0.51.5Added to both tolerances
max_price_age_s120120Oldest usable price
max_nav_age_s600900Oldest NAV a deposit may use
nav_history_interval_s6001800How often the share price is recorded
entry_fee_bps, exit_fee_bps5050Capped at 100
performance_fee_bps500500Capped at 2000
treasurynullpoint.testnetnullpoint.nearReceives performance-fee shares

Config (set at init)

usdc, usdc_token_id, hl_usdc_asset, hl_token, hl_chain, hl_signature_chain_id, verifier (intents.near on mainnet), mpc (v1.signer), mpc_path (hl-master), vault_address (derived from the contract), oneclick_pubkey (1Click's signing key).

On this page