@aftermath/perpetuals-v2 (0x3ec7…efc7) | SuiLearn Explorer
Move package · Move Registry
@aftermath/perpetuals-v2 0x3ec740df8428aa9c93aaef7f8cc1542ac3194fd014826b51bfe245346d64efc7
The core package of Aftermath's perpetuals exchange (V2). Defines the Registry, ClearingHouse, Market, Orderbook and Account types, with stop, TWAP and ADL support, and their public api.
Open in Playground Read the source, view function signatures and call functions there.
Details
Version 2
Modules 14 (317 functions)
Name @aftermath/perpetuals-v2
Latest version v2
Contact github@aftermath.finance Published by the package owner in the Move Registry. Use the name in code with mvr add @aftermath/perpetuals-v2 .
Versions Each upgrade is a new package ID
account 28 functions · 4 structs Functions account_id PUBLIC add_integrator_config PUBLIC add_order_ticket FRIEND assert_authority_cap_is_valid FRIEND assert_order_ticket_exists FRIEND borrow_mut_collateral FRIEND borrow_mut_order_ticket FRIEND collateral_balance PUBLIC consume_policy_and_share_account
PUBLIC
create_account PUBLIC
create_and_share_account PUBLIC
create_integrator_info PUBLIC
deposit_collateral PUBLIC
destroy_assistant_account_cap PUBLIC
has_order_ticket PUBLIC
integrator_config PUBLIC
integrator_fee PUBLIC
integrator_fee_b9 PUBLIC
integrator_id PUBLIC
max_integrator_fee_b9 PUBLIC
new_assistant_account_cap PUBLIC
receive_from_account PUBLIC
remove_integrator_config PUBLIC
remove_order_ticket FRIEND
revoke_assistant_account_cap PUBLIC
revoke_assistant_account_cap_
validate_session_integrator_info FRIEND
withdraw_collateral PUBLIC Structs Account AccountSharePolicy IntegratorConfig IntegratorInfo authority 18 functions · 9 structs Functions assert_is_admin_or_assistant FRIEND assert_is_admin_or_assistant_or_maintenance FRIEND assert_is_not_admin FRIEND create_account_admin_cap FRIEND create_account_assistant_cap FRIEND create_package_adl_cap FRIEND create_package_admin_cap_and_keep FRIEND create_package_assistant_cap FRIEND create_package_freeze_guardian_cap FRIEND create_package_pause_guardian_cap FRIEND create_package_revoke_vendor_guardian_cap FRIEND create_vendor_admin_cap FRIEND create_vendor_assistant_cap FRIEND create_vendor_maintenance_cap FRIEND create_vendor_pause_guardian_cap FRIEND create_vendor_treasury_cap FRIEND destroy_account_assistant_cap FRIEND this_package Structs ACCOUNT ADL FREEZE_GUARDIAN MAINTENANCE PACKAGE PAUSE_GUARDIAN REVOKE_VENDOR_GUARDIAN TREASURY VENDOR Explore authority in Playground clearing_house 50 functions · 7 structs Functions account_id PUBLIC add_position admin_pause_market PUBLIC admin_resume_market PUBLIC allocate_collateral PUBLIC assert_market_allows_order_cancellation assert_market_is_closed assert_market_is_not_closed FRIEND assert_market_is_not_paused FRIEND assert_market_is_paused assert_order_value assert_package_version FRIEND assert_reduce_only assert_settlement_prices assert_valid_pause_mode base_filled_ask PUBLIC base_filled_bid PUBLIC best_price PUBLIC best_price_u64 PUBLIC book_price PUBLIC borrow_mut_market_objects FRIEND borrow_mut_market_params FRIEND borrow_mut_market_state FRIEND borrow_mut_market_vault FRIEND borrow_mut_orderbook FRIEND borrow_mut_position FRIEND borrow_mut_position_from_id borrow_mut_settlement_prices FRIEND cancel_orders PUBLIC cancel_orders_ clearing_house PUBLIC clip_size_to_liquidate PUBLIC close_market PUBLIC close_position_at_settlement_prices PUBLIC closed_market_adl_prices FRIEND collateral_and_insurance_fund_balances PUBLIC collateral_for_margin_increase collateral_symbol collateral_to_deallocate_for_margin_ratio PUBLIC commit_margin_ratios_proposal PUBLIC compute_liquidation_size_and_mode PUBLIC compute_liquidation_size_no_haircut compute_liquidation_size_with_haircut create_clearing_house PUBLIC create_clearing_house_ create_clearing_house_with_currency PUBLIC create_client_order_id PUBLIC create_margin_ratios_proposal PUBLIC create_market_position PUBLIC create_orderbook PUBLIC Structs ClearingHouse Executor MarginRatioProposal SessionHotPotato SessionSummary SettlementPrices Vault Explore clearing_house in Playground keys 16 functions · 16 structs Functions account FRIEND asks_map FRIEND bids_map FRIEND frozen_version FRIEND integrator_config FRIEND integrator_registration FRIEND margin_ratio_proposal FRIEND market_vault FRIEND order_ticket FRIEND position FRIEND registry_collateral_info FRIEND registry_config FRIEND registry_market_info FRIEND settlement_prices FRIEND vendor_clearing_house_key FRIEND vendor_registration_open FRIEND Structs AccountKey AsksMapKey BidsMapKey FrozenVersionKey IntegratorConfigKey IntegratorRegistrationKey MarginRatioProposalKey MarketVaultKey OrderTicketKey PositionKey RegistryCollateralInfoKey RegistryConfigKey RegistryMarketInfoKey SettlementPricesKey VendorClearingHouseKey VendorRegistrationOpenKey Explore keys in Playground market 50 functions · 6 structs Functions add_bad_debt_to_market FRIEND add_fees_accrued_usd FRIEND add_to_open_interest FRIEND assert_funding_parameters assert_index_twap_divergence_within_limit PUBLIC assert_liquidation_fees assert_liquidation_fees_against_mmr FRIEND assert_lot_and_tick_sizes assert_margin_ratios FRIEND assert_market_fees assert_priority_taker_fee assert_spread_twap_parameters base_oracle_price PUBLIC base_oracle_price_and_twap_price PUBLIC base_pfs_tolerance PUBLIC base_source_id PUBLIC base_storage_id PUBLIC calculate_funding_price PUBLIC calculate_mark_price PUBLIC clip_max_book_index_spread PUBLIC collateral_haircut PUBLIC collateral_oracle_price PUBLIC collateral_pfs_tolerance PUBLIC collateral_source_id PUBLIC collateral_storage_id PUBLIC create_market_objects FRIEND create_market_params create_market_state cum_funding_rates PUBLIC fees_accrued PUBLIC funding_last_upd_ms PUBLIC funding_params PUBLIC funding_period_adjustment PUBLIC is_time_to_update PUBLIC liquidation_fee_rates PUBLIC lot_size PUBLIC maker_fee PUBLIC maker_taker_fees PUBLIC margin_ratio_initial PUBLIC margin_ratio_maintenance PUBLIC max_bad_debt_thresholds PUBLIC max_book_index_spread PUBLIC max_index_twap_divergence PUBLIC max_open_interest PUBLIC max_open_interest_position_params PUBLIC max_pending_orders PUBLIC min_order_usd_value PUBLIC next_funding_update_time PUBLIC open_interest PUBLIC option_u16_or Structs CoreParams FeesParams LimitsParams MarketParams MarketState TwapParams Explore market in Playground orderbook 20 functions · 2 structs Functions as_parts PUBLIC asks FRIEND best_price PUBLIC bids FRIEND book_price PUBLIC book_price_or_index PUBLIC borrow_mut_asks FRIEND borrow_mut_bids FRIEND cancel_limit_order FRIEND create_orderbook FRIEND get_order PUBLIC increase_counter inspect_orders PUBLIC order_size PUBLIC order_snapshot FRIEND post_order FRIEND reduce_order_size FRIEND set_best_price FRIEND try_cancel_limit_order FRIEND try_cancel_stale_limit_order FRIEND Explore orderbook in Playground registry 50 functions · 5 structs Functions assert_admin_authority_cap_is_active FRIEND assert_admin_or_authorized_assistant_authority_cap FRIEND assert_admin_or_authorized_assistant_or_maintenance_authority_cap FRIEND assert_authority_cap_id_is_authorized assert_authority_cap_is_authorized FRIEND assert_integrator_id_is_valid FRIEND assert_package_version FRIEND assert_vendor_has_ownership_over_clearing_house FRIEND authorize_authority_cap FRIEND borrow_mut_id FRIEND collateral_info PUBLIC config FRIEND config_mut create_package_adl_cap PUBLIC create_package_assistant_cap PUBLIC create_package_freeze_guardian_cap PUBLIC create_package_pause_guardian_cap PUBLIC create_package_revoke_vendor_guardian_cap PUBLIC create_registry FRIEND create_vendor_assistant_cap PUBLIC create_vendor_maintenance_cap PUBLIC create_vendor_pause_guardian_cap PUBLIC create_vendor_treasury_cap PUBLIC deauthorize_authority_cap PUBLIC deauthorize_authority_cap_ FRIEND freeze_package PUBLIC guardian_deauthorize_authority_cap PUBLIC inc_account_id FRIEND inc_integrator_id insurance_open_interest_fraction PUBLIC integrator_address PUBLIC is_account_assistant_cap_registered PUBLIC is_authority_cap_authorized PUBLIC is_collateral_registered PUBLIC is_frozen PUBLIC is_integrator_id_registered PUBLIC is_market_registered PUBLIC is_vendor_registration_open PUBLIC low_min_order_usd_value PUBLIC market_info PUBLIC max_abs_maker_fee PUBLIC max_abs_taker_fee PUBLIC max_assistants_per_account PUBLIC max_book_index_spread PUBLIC max_funding_period_ms PUBLIC max_index_twap_divergence PUBLIC max_insurance_fund_fee PUBLIC max_liquidation_fee PUBLIC max_proposal_delay_ms PUBLIC min_funding_frequency_ms PUBLIC Structs CollateralInfo Config IntegratorRegistration MarketInfo Registry Explore registry in Playground stop_orders 10 functions · 1 structs Functions assert_stop_order_trigger_price_type assert_valid_ticket_executor cancel PUBLIC cancel_stop_order_ticket PUBLIC create_stop_order_ticket PUBLIC derive_stop_order_trigger_price edit_stop_order_ticket_details PUBLIC edit_stop_order_ticket_executors PUBLIC place_stop_order_sltp PUBLIC place_stop_order_standalone PUBLIC Explore stop_orders in Playground twap_orders 21 functions · 2 structs Functions assert_amount_within_uncertainty FRIEND assert_execution_gap_within_uncertainty assert_lot_compatible assert_order_details_are_valid assert_twap_order_can_be_executed assert_valid_ticket_clearing_house assert_valid_ticket_executor cancel PUBLIC create_twap_order_ticket PUBLIC execute PUBLIC finalize PUBLIC has_attempts PUBLIC is_complete PUBLIC is_first_execution PUBLIC is_not_spoiled new_details PUBLIC set_details PUBLIC set_executors PUBLIC target_chunk_amount FRIEND unfilled_scheduled_amount PUBLIC user_cancel_twap_order PUBLIC Structs TWAPOrderDetails TWAPOrderTicket Explore twap_orders in Playground