Documentation
    Preparing search index...

    MarginAdminContract class for managing admin actions.

    Index

    Constructors

    Methods

    • Parameters

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Add the PythConfig to the margin registry

    • Parameters

      • coinKey: string

        The key to identify the margin pool

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object and returns a Coin

      Withdraw the default referral fees (admin only) The default referral at 0x0 doesn't have a SupplyReferral object

    • Parameters

      • poolKey: string

        The key of the pool to be disabled

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Disable a deepbook pool from margin trading

    • Parameters

      • version: number

        The version to be disabled

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Disable a specific version

    • Parameters

      • version: number

        The version to disable

      • pauseCapId: string

        The ID of the pause cap

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Disable a version using pause cap

    • Parameters

      • poolKey: string

        The key of the pool to be enabled

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Enable a deepbook pool for margin trading

    • Parameters

      • version: number

        The version to be enabled

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Enable a specific version

    • Parameters

      • coinKey: string

        The key to identify the coin

      • maxConfBps: number

        The maximum confidence interval in basis points

      • maxEwmaDifferenceBps: number

        The maximum EWMA difference in basis points

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Create a new coin type data

    • Parameters

      • poolKey: string

        The key to identify the pool

      • leverage: number

        The leverage for the pool

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Create a new pool config with leverage

    • Parameters

      • coinSetups: { coinKey: string; maxConfBps: number; maxEwmaDifferenceBps: number }[]

        The coins with their oracle config to be added to the Pyth config

      • maxAgeSeconds: number

        The max age in seconds for the Pyth config

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Create a new Pyth config

    • Parameters

      • poolKey: string

        The key of the pool to be registered

      • poolConfig: TransactionArgument

        The configuration of the pool

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Register a deepbook pool

    • Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Remove the PythConfig from the margin registry

    • Parameters

      • maintainerCapId: string

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Revoke a maintainer cap

    • Parameters

      • pauseCapId: string

        The ID of the pause cap to revoke

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Revoke a pause cap

    • Parameters

      • poolKey: string

        The key of the pool to update

      • maxOrderTtlMs: number | bigint

        Max order TTL in milliseconds (raw u64)

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Set the maximum lifetime (in milliseconds) of margin limit orders for a pool. pool_proxy::place_limit_order_v2 and place_reduce_only_limit_order_v2 clamp the user-supplied expire_timestamp to at most now + max_order_ttl_ms, bounding margin orders' exposure to stale-price exploitation.

    • Parameters

      • poolKey: string

        The key of the pool to update

      • maxAgeMs: number | bigint

        Max age in milliseconds (raw u64)

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Set the maximum acceptable Pyth price age (in milliseconds) for a pool. Requires the pool's current price to have been initialized via PoolProxyContract.updateCurrentPrice first.

    • Parameters

      • poolKey: string

        The key of the pool to update

      • tolerance: number | bigint

        Tolerance as a fraction (e.g. 0.1 for 10%)

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Set the price deviation tolerance for a pool. tolerance is in 9-decimal float scaling (1.0 = FLOAT_SCALAR); the SDK applies the scaling, so callers pass a human-readable fraction (e.g. 0.1 for 10%). Requires the pool's current price to have been initialized via PoolProxyContract.updateCurrentPrice first.

    • Parameters

      • poolKey: string

        The key of the pool to be updated

      • poolConfig: TransactionArgument

        The configuration of the pool

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Update the risk parameters for a margin