MarginX 2.0 gitbook v1.1
  • 🚀Getting Started: MarginX 2.0
  • MARGINX 2.0 & ALO
    • Vision
    • Mechanic & Foundation of ALO
    • Comparison Between Order Book And Swap
    • Risk and Reward of Liquidity Providers
    • Product Comparison
    • MarginX ALO: Whitepaper
  • Technical structure
    • Contract Structure
      • CoastDAO Module
    • The Fund Module
      • Contract Specific Design
      • Cross-Chain Description
    • Contract Events
      • Strategy Factory
      • Strategy Pair
      • DssCdpManager
      • DSProxyFactory
      • Vat
    • Contract Invocation Method
      • DSProxyFactory
      • ProxyRegistry
      • DSProxy
      • The Price of the Collateral Assets
      • DssProxyActions
        • Adding Liquidity For New Perpetual Markets (First Time)
        • Creating Order (Providing Liquidity)
        • Request For Withdrawing Liquidity
        • Withdrawal
      • StrategyFactory
  • MarginX Spot
    • Swap
    • Pool
      • Add Liquidity
      • Remove Liquidity
    • Farm
      • Deposit LP Tokens
      • Withdraw LP Token
    • Supported Networks
  • MARGINX SUBGRAPH
    • Overview
    • Query Examples
  • MarginX 1.0
    • Built On f(x)Core
    • Decentralized Order Book
    • Referral Programme
    • MarginX NFTs
    • Maker Liquidity Pool
    • MarginX 1.0 Litepaper
  • ERC20 Token Factory
    • Token Factory Supported Networks
    • Create Token
    • Provide Token Details
    • Interact with Token
    • Role Management
  • Help desk
    • Perpetual Trading 101
    • User Guide (Video)
    • MarginX 2.0 FAQ
    • Contact us
Powered by GitBook
On this page
  1. Technical structure
  2. Contract Invocation Method
  3. DssProxyActions

Adding Liquidity For New Perpetual Markets (First Time)

A. Opening a position in CoastDAO, depositing collateral to generate CUSD, creating a trading strategy contract, and generating the first order

openLockGemAndDrawAndCreateStrategy(
    address gemJoin,
    bytes32 ilk,
    uint256 amtC,
    uint256 wadD,
    bytes32 strategyName,
    uint8 strategyId
 }

 gemJoin:The contract addresses of these collateral assets in CoastDAO (there are as many addresses as there are collateral assets).
 ilk:Collateral type
 amtC:Amount of collateral
 wadD:Amount of cusd
 strategyName Name of the trading pair
 strategyId  Trading strategy Id (1,2,3,4)

B. In CoastDAO, specify the vault to store collateral, generate CUSD, create a trading strategy contract, and initiate the first order.

function lockGemAndDrawAndCreateStrategy(
    address gemJoin,
    uint256 cdp,
    uint256 amtC,
    uint256 wadD,
    bytes32 strategyName,
    uint8 strategyId
)

 gemJoin: The contract address of the collateral asset(s) in CoastDAO (there are as many addresses as there are collateral assets)
 cdp:Vault ID
 amtC:Amount of collateral
 wadD:Amount of CUSD
 strategyName Name of the trading pair
 strategyId  Trading strategy Id (1,2,3,4)
PreviousDssProxyActionsNextCreating Order (Providing Liquidity)

Last updated 1 year ago