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 Events

DssCdpManager

To link CoastDAO with the DssCdpManager and listen to its NewCdp and LogNote events, you can create event listeners in your contract.

Listen to the NewCdp Event:

To capture the NewCdp event from the DssCdpManager contract, which provides information about newly created CDPs, set up an event listener like this:

event NewCdp(
    address indexed usr,
    address indexed own,
    uint indexed cdp
);
usr:user address
own:proxy address
cdp:vault id
The ilk type is provided by the following event and needs to be parsed to obtain it:
 event LogNote(
    bytes4   indexed  sig,
    address  indexed  usr,
    bytes32  indexed  arg1,
    bytes32  indexed  arg2,
    bytes             data
 )
    
 open(bytes32 ilk,address usr)
 usr:user address
 arg1:ilk’s bytes32
 arg2:proxy address
PreviousStrategy PairNextDSProxyFactory

Last updated 1 year ago