Magic Eden mmm API

Get AMM information

OpenAPI Specification

magic-eden-mmm-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Magic Eden EVM Activity mmm API
  description: Aggregated Magic Eden EVM API (v4) for Ethereum and L2 chains (Polygon, Base, ApeChain, Arbitrum, Berachain, BSC, SEI, Abstract). Covers collections, assets, bids, asks, listings, buy/sell, and bulk transfer instructions.
  version: v4
  termsOfService: https://magiceden.io/terms-of-service.pdf
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://api-mainnet.magiceden.dev/v4/evm-public
tags:
- name: mmm
  description: Get AMM information
paths:
  /instructions/mmm/create-pool:
    get:
      deprecated: false
      summary: Get instruction to create a pool
      security:
      - bearerAuth: []
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
      parameters:
      - name: spotPrice
        in: query
        description: Pool initial spot price in SOL
        required: true
        deprecated: false
        schema:
          type: number
      - name: curveType
        in: query
        description: Type curve, either 'linear' or 'exp'
        required: true
        deprecated: false
        schema:
          $ref: '#/components/schemas/MMM.CurveKindString'
      - name: curveDelta
        in: query
        description: Curve delta used to change price after a fill
        required: true
        deprecated: false
        schema:
          type: number
      - name: reinvestBuy
        in: query
        description: Whether to reinvest bought asset or transfer directly to owner
        required: true
        deprecated: false
        schema:
          type: boolean
      - name: reinvestSell
        in: query
        description: Whether to reinvest payment from sale or transfer directly to owner
        required: true
        deprecated: false
        schema:
          type: boolean
      - name: expiry
        in: query
        description: Timestamp in seconds in the future, 0 means no expiry
        required: false
        deprecated: false
        schema:
          type: number
      - name: lpFeeBp
        in: query
        description: Requested liquidity provider fee in basis points
        required: true
        deprecated: false
        schema:
          type: number
      - name: buysideCreatorRoyaltyBp
        in: query
        description: Amount of creator royalty the pool should pay in basis points
        required: true
        deprecated: false
        schema:
          type: number
      - name: paymentMint
        in: query
        description: Mint address of payment (default for SOL)
        required: true
        deprecated: false
        schema:
          type: string
      - name: collectionSymbol
        in: query
        description: Collection symbol for which the pool will be valid
        required: true
        deprecated: false
        schema:
          type: string
      - name: owner
        in: query
        description: Owner of the pool
        required: true
        deprecated: false
        schema:
          type: string
      - name: solDeposit
        in: query
        description: Optional sol amount to deposit with pool creation
        required: false
        deprecated: false
        schema:
          type: number
      - name: priorityFee
        in: query
        description: Priority fee (in microlamports) to reprioritize the transaction against others
        required: false
        deprecated: false
        schema:
          type: number
      - name: sharedEscrowCount
        in: query
        description: Number of pools (bids) that will share the escrow account
        required: false
        deprecated: false
        schema:
          type: number
      tags:
      - mmm
  /instructions/mmm/sol-close-pool:
    get:
      deprecated: false
      summary: Get instruction to close a pool after all assets and payment have been withdrawn
      security:
      - bearerAuth: []
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
      parameters:
      - name: pool
        in: query
        description: Public key of pool to close
        required: true
        deprecated: false
        schema:
          type: string
      - name: priorityFee
        in: query
        description: Priority fee (in microlamports) to reprioritize the transaction against others
        required: false
        deprecated: false
        schema:
          type: number
      tags:
      - mmm
  /instructions/mmm/sol-deposit-buy:
    get:
      deprecated: false
      summary: Get instruction to deposit SOL into a pool for buying
      security:
      - bearerAuth: []
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
      parameters:
      - name: pool
        in: query
        description: Public key of pool to deposit into
        required: true
        deprecated: false
        schema:
          type: string
      - name: solAmount
        in: query
        description: The amount of SOL to deposit
        required: true
        deprecated: false
        schema:
          type: number
      - name: priorityFee
        in: query
        description: Priority fee (in microlamports) to reprioritize the transaction against others
        required: false
        deprecated: false
        schema:
          type: number
      tags:
      - mmm
  /instructions/mmm/sol-fulfill-buy:
    get:
      deprecated: false
      summary: Get instruction to have a pool fulfill a buy
      security:
      - bearerAuth: []
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
      parameters:
      - name: pool
        in: query
        description: Public key of pool to interact with
        required: true
        deprecated: false
        schema:
          type: string
      - name: assetAmount
        in: query
        description: Amount of asset to transact
        required: true
        deprecated: false
        schema:
          type: number
      - name: minPaymentAmount
        in: query
        description: Minimum payment amount acceptible by the seller, in SOL
        required: true
        deprecated: false
        schema:
          type: number
      - name: seller
        in: query
        description: Public key of seller of asset
        required: true
        deprecated: false
        schema:
          type: string
      - name: assetMint
        in: query
        description: Public key of mint account of asset
        required: true
        deprecated: false
        schema:
          type: string
      - name: assetTokenAccount
        in: query
        description: Public key of token account of asset
        required: true
        deprecated: false
        schema:
          type: string
      - name: allowlistAuxAccount
        in: query
        description: The allowlist aux account used for token authentication
        required: false
        deprecated: false
        schema:
          type: string
      - name: skipDelist
        in: query
        description: Whether to skip trying to delist the NFT if it is detected to be listed
        required: false
        deprecated: false
        schema:
          type: boolean
      - name: priorityFee
        in: query
        description: Priority fee (in microlamports) to reprioritize the transaction against others
        required: false
        deprecated: false
        schema:
          type: number
      tags:
      - mmm
  /instructions/mmm/sol-fulfill-sell:
    get:
      deprecated: false
      summary: Get instruction to have a pool fulfill a sell
      security:
      - bearerAuth: []
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
      parameters:
      - name: pool
        in: query
        description: Public key of pool to interact with
        required: true
        deprecated: false
        schema:
          type: string
      - name: assetAmount
        in: query
        description: Amount of asset to transact
        required: true
        deprecated: false
        schema:
          type: number
      - name: maxPaymentAmount
        in: query
        description: Maximum payment amount to be paid by the buyer, in SOL
        required: true
        deprecated: false
        schema:
          type: number
      - name: buysideCreatorRoyaltyBp
        in: query
        description: Amount of royalty to be paid, in basis points of total royalty
        required: true
        deprecated: false
        schema:
          type: number
      - name: buyer
        in: query
        description: Public key of buyer of asset
        required: true
        deprecated: false
        schema:
          type: string
      - name: assetMint
        in: query
        description: Public key of mint account of asset
        required: true
        deprecated: false
        schema:
          type: string
      - name: allowlistAuxAccount
        in: query
        description: The allowlist aux account used for token authentication
        required: false
        deprecated: false
        schema:
          type: string
      - name: priorityFee
        in: query
        description: Priority fee (in microlamports) to reprioritize the transaction against others
        required: false
        deprecated: false
        schema:
          type: number
      tags:
      - mmm
  /instructions/mmm/sol-withdraw-buy:
    get:
      deprecated: false
      summary: Get instruction to withdraw SOL from a pool
      security:
      - bearerAuth: []
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
      parameters:
      - name: pool
        in: query
        description: Public key of pool to withdraw from
        required: true
        deprecated: false
        schema:
          type: string
      - name: solAmount
        in: query
        description: The amount of SOL to withdraw
        required: true
        deprecated: false
        schema:
          type: number
      - name: priorityFee
        in: query
        description: Priority fee (in microlamports) to reprioritize the transaction against others
        required: false
        deprecated: false
        schema:
          type: number
      tags:
      - mmm
  /instructions/mmm/update-pool:
    get:
      deprecated: false
      summary: Get instruction to update an existing pool
      security:
      - bearerAuth: []
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
      parameters:
      - name: pool
        in: query
        description: Public key of pool to modify
        required: true
        deprecated: false
        schema:
          type: string
      - name: spotPrice
        in: query
        description: Pool initial spot price in SOL
        required: true
        deprecated: false
        schema:
          type: number
      - name: curveType
        in: query
        description: Type curve, either 'linear' or 'exp'
        required: true
        deprecated: false
        schema:
          type: string
      - name: curveDelta
        in: query
        description: Curve delta used to change price after a fill
        required: true
        deprecated: false
        schema:
          type: number
      - name: reinvestBuy
        in: query
        description: Whether to reinvest bought asset or transfer directly to owner (this value must remain unchanged from when the pool was created)
        required: true
        deprecated: false
        schema:
          type: boolean
      - name: reinvestSell
        in: query
        description: Whether to reinvest payment from sale or transfer directly to owner (this value must remain unchanged from when the pool was created)
        required: true
        deprecated: false
        schema:
          type: boolean
      - name: expiry
        in: query
        description: Timestamp in seconds in the future, 0 means no expiry
        required: true
        deprecated: false
        schema:
          type: number
      - name: lpFeeBp
        in: query
        description: Requested liquidity provider fee in basis points
        required: true
        deprecated: false
        schema:
          type: number
      - name: buysideCreatorRoyaltyBp
        in: query
        description: Amount of creator royalty the pool should pay in basis points
        required: true
        deprecated: false
        schema:
          type: number
      - name: priorityFee
        in: query
        description: Priority fee (in microlamports) to reprioritize the transaction against others
        required: false
        deprecated: false
        schema:
          type: number
      - name: sharedEscrowCount
        in: query
        description: Number of pools (bids) that will share the escrow account
        required: false
        deprecated: false
        schema:
          type: number
      tags:
      - mmm
  /mmm/pools:
    get:
      deprecated: false
      summary: Get AMM pools corresponding to an owner or collection symbol. At least one of required collectionSymbol or owner is required!
      security: []
      responses:
        '200':
          description: success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IMmmPoolV2Response'
              example:
                results:
                - spotPrice: 53042450000
                  curveType: exp
                  curveDelta: 0
                  reinvestFulfillBuy: false
                  reinvestFulfillSell: false
                  expiry: 0
                  lpFeeBp: 0
                  buysideCreatorRoyaltyBp: 0
                  poolOwner: AC1r4GYj1TZ62ASZS4VT6GnNtMzoD78wYNWfxJ3Uzbxy
                  sellsideAssetAmount: 0
                  buysidePaymentAmount: 53095492450
                  buyOrdersAmount: 1
                  collectionSymbol: okay_bears
                  collectionName: Okay Bears
                  poolType: buy_sided
                  updatedAt: '2023-05-10T06:37:11.823Z'
                  uuid: 9KHoeTEnFFCxh1guDCB18hX6Cj1kcP1Z2hcpLCyV3hTo
                  poolKey: 7Tjbkwp234hPKjmTXNwpjdQnUqA1hXLAJEduVB2xkg8p
                  cosigner: NTYeYJ1wr4bpM5xo6zx5En44SvJFAd35zTxxNoERYqd
                  mints: []
                  collectionSellerFeeBasisPoints: 500
                  lpFeeEarned: 0
                  isMIP1: true
                - spotPrice: 53042440000
                  curveType: exp
                  curveDelta: 0
                  reinvestFulfillBuy: false
                  reinvestFulfillSell: false
                  expiry: 0
                  lpFeeBp: 0
                  buysideCreatorRoyaltyBp: 0
                  poolOwner: oKAYXGwLFF4TAqnC5G62PpwYo2GgPgzqwZ13JL1dWjE
                  sellsideAssetAmount: 0
                  buysidePaymentAmount: 53095482440
                  buyOrdersAmount: 1
                  collectionSymbol: okay_bears
                  collectionName: Okay Bears
                  poolType: buy_sided
                  updatedAt: '2023-05-10T06:36:59.374Z'
                  uuid: HRmPrYoqwN55uSVzofgrAPb4ryZH87UUWnK9PkRUPEHJ
                  poolKey: 9akMvSF6UHixPQBHQ5tpY6hF6bVyo7CQG4bVn5AhWPD9
                  cosigner: NTYeYJ1wr4bpM5xo6zx5En44SvJFAd35zTxxNoERYqd
                  mints: []
                  collectionSellerFeeBasisPoints: 500
                  lpFeeEarned: 0
                  isMIP1: true
                  isOCP: false
                - spotPrice: 53042230000
                  curveType: exp
                  curveDelta: 0
                  reinvestFulfillBuy: false
                  reinvestFulfillSell: false
                  expiry: 0
                  lpFeeBp: 0
                  buysideCreatorRoyaltyBp: 0
                  poolOwner: AgxfD7iS3M6hSR75dfhBZxXYEym5ohanPBBge5QhfQCK
                  sellsideAssetAmount: 0
                  buysidePaymentAmount: 53095272230
                  buyOrdersAmount: 1
                  collectionSymbol: okay_bears
                  collectionName: Okay Bears
                  poolType: buy_sided
                  updatedAt: '2023-05-10T06:14:52.337Z'
                  uuid: 4HTWKn5r7gH7Ma42FKCScB43uMGFruJExmbxr8DwCz6G
                  poolKey: 6q4UscJzMpJLM1ehwm7i9BHPxXQECPc4qMr2S6XSjD1j
                  cosigner: NTYeYJ1wr4bpM5xo6zx5En44SvJFAd35zTxxNoERYqd
                  mints: []
                  collectionSellerFeeBasisPoints: 500
                  lpFeeEarned: 0
                  isMIP1: true
                  isOCP: false
      parameters:
      - name: collectionSymbol
        in: query
        description: The collection symbol to query the pools from. At least this or "owner" must be passed in
        required: false
        deprecated: false
        schema:
          type: string
      - name: pools
        in: query
        description: The pools key to query by.
        required: false
        deprecated: false
        schema:
          type: array
          items:
            type: string
      - name: owner
        in: query
        description: The owner public key to query the pools created by. At least this or "collectionSymbol" must be passed in
        required: false
        deprecated: false
        schema:
          type: string
      - name: offset
        in: query
        description: The number of items to skip, default 0, min 0
        required: false
        deprecated: false
        schema:
          type: integer
      - name: limit
        in: query
        description: The numbers of items to return, default 100, min 1, max 500
        required: false
        deprecated: false
        schema:
          type: integer
      - name: field
        in: query
        description: 'Sort pools by field. 0: NONE (no sorting field, default), 1: ADDRESS (sort pools by pool address), 2: SPOT_PRICE (sort pools by pool spot price), 5: BUYSIDE_ADJUSTED_PRICE (sort pools by buyside_adjusted_price = spot_price - royalty_fee - lp_fee)'
        required: false
        deprecated: false
        schema:
          $ref: '#/components/schemas/FieldOptions'
      - name: direction
        in: query
        description: 'Sort pools by field in specified directions. 0: NONE (no sorting direction, default to increasing order if field is specified), 1: DESC (descending), 2: INC (increasing)'
        required: false
        deprecated: false
        schema:
          $ref: '#/components/schemas/DirectionOptions'
      tags:
      - mmm
  /mmm/token/{mint_address}/pools:
    get:
      deprecated: false
      summary: Get best offers for an NFT
      security: []
      responses:
        '200':
          description: success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IMmmPoolV2Response'
              example:
                results:
                - spotPrice: 44193250
                  curveType: exp
                  curveDelta: 0
                  reinvestFulfillBuy: false
                  reinvestFulfillSell: false
                  expiry: 0
                  lpFeeBp: 0
                  buysideCreatorRoyaltyBp: 9302
                  poolOwner: 9PBa4wED2V9CFzjpE94K23LWBquqmX4XanxoqiJgZnQo
                  sellsideAssetAmount: 0
                  buysidePaymentAmount: 44414216
                  buyOrdersAmount: 1
                  collectionSymbol: pastel_pandas
                  collectionName: PASTEL PANDAS
                  poolType: buy_sided
                  updatedAt: '2023-05-09T12:20:04.201Z'
                  uuid: 6qknG6Ko6vYcUk3wo8JpdY2HCNwm5gzmiEgW4gGuGdgX
                  poolKey: D6J69jm38rh5nPJdit37L3VMQWVs8m9veNxsPPFVKsPy
                  cosigner: NTYeYJ1wr4bpM5xo6zx5En44SvJFAd35zTxxNoERYqd
                  mints: []
                  collectionSellerFeeBasisPoints: 750
                  lpFeeEarned: 0
                  buyPriceTaker: 40447209
                  isMIP1: false
                  isOCP: false
                  attributes:
                  - - trait_type: Attributes Count
                      value: '8'
      parameters:
      - name: mint_address
        in: path
        description: Mint address of the NFT
        required: true
        deprecated: false
        schema:
          type: string
        example: 6XkPLDtV2w17UUsyzah39PTBjZ9xTY8HokqRdWcmDhBa
      - name: limit
        in: query
        description: Total best offers to return, defaults 1, max 5. Best offer will come first
        required: false
        deprecated: false
        schema:
          type: integer
      tags:
      - mmm
components:
  schemas:
    MMM.CurveKindString:
      type: string
      enum:
      - linear
      - exp
      - xyk
    Omit_IMmmPoolV2.updatedAt_:
      $ref: '#/components/schemas/Pick_IMmmPoolV2.Exclude_keyofIMmmPoolV2.updatedAt__'
      description: Construct a type with the properties of T except for those in type K.
    FieldOptions:
      type: string
      enum:
      - '0'
      - '1'
      - '2'
      - '5'
      nullable: false
    IBuffer:
      properties:
        type:
          type: string
          enum:
          - Buffer
          nullable: false
        data:
          items:
            type: number
            format: double
          type: array
      required:
      - type
      - data
      type: object
      additionalProperties: false
    MMM.PoolTypeString:
      type: string
      enum:
      - buy_sided
      - sell_sided
      - two_sided
      - invalid
    IMmmPoolV2Response:
      properties:
        results:
          items:
            allOf:
            - $ref: '#/components/schemas/Omit_IMmmPoolV2.updatedAt_'
            - properties:
                updatedAt:
                  type: string
              required:
              - updatedAt
              type: object
          type: array
      required:
      - results
      type: object
    Transaction:
      properties:
        tx:
          $ref: '#/components/schemas/IBuffer'
        txSigned:
          $ref: '#/components/schemas/IBuffer'
      required:
      - tx
      type: object
      additionalProperties: false
    Pick_IMmmPoolV2.Exclude_keyofIMmmPoolV2.updatedAt__:
      properties:
        collectionName:
          type: string
        attributes:
          items:
            items:
              $ref: '#/components/schemas/IAttributeV2'
            type: array
          type: array
        expiry:
          type: number
          format: double
        collectionSymbol:
          type: string
        spotPrice:
          type: number
          format: double
        curveType:
          $ref: '#/components/schemas/MMM.CurveKindString'
        curveDelta:
          type: number
          format: double
        reinvestFulfillBuy:
          type: boolean
        reinvestFulfillSell:
          type: boolean
        lpFeeBp:
          type: number
          format: double
        buysideCreatorRoyaltyBp:
          type: number
          format: double
        poolOwner:
          type: string
        sellsideAssetAmount:
          type: number
          format: double
        buysidePaymentAmount:
          type: number
          format: double
        buyOrdersAmount:
          type: number
          format: double
          description: quantity of buy orders
        poolType:
          $ref: '#/components/schemas/MMM.PoolTypeString'
          description: can be buy_sided, sell_sided, two_sided
        uuid:
          type: string
        poolKey:
          type: string
        cosigner:
          type: string
        blockedAt:
          type: string
          format: date-time
        mints:
          items:
            type: string
          type: array
        collectionSellerFeeBasisPoints:
          type: number
          format: double
        lpFeeEarned:
          type: number
          format: double
        buyPriceTaker:
          type: number
          format: double
        isMIP1:
          type: boolean
        isOCP:
          type: boolean
        sharedEscrowInfo:
          $ref: '#/components/schemas/ISharedEscrowInfo'
      required:
      - collectionName
      - expiry
      - collectionSymbol
      - spotPrice
      - curveType
      - curveDelta
      - reinvestFulfillBuy
      - reinvestFulfillSell
      - lpFeeBp
      - buysideCreatorRoyaltyBp
      - poolOwner
      - sellsideAssetAmount
      - buysidePaymentAmount
      - buyOrdersAmount
      - poolType
      - uuid
      - poolKey
      - cosigner
      - collectionSellerFeeBasisPoints
      - lpFeeEarned
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    ISharedEscrowInfo:
      properties:
        sharedEscrowAddress:
          type: string
        sharedEscrowCount:
          type: number
          format: double
        sharedEscrowBuysidePaymentAmount:
          type: number
          format: double
      required:
      - sharedEscrowAddress
      - sharedEscrowCount
      - sharedEscrowBuysidePaymentAmount
      type: object
      additionalProperties: false
    IAttributeV2:
      properties:
        trait_type:
          type: string
        value: {}
      required:
      - trait_type
      - value
      type: object
      additionalProperties: false
    DirectionOptions:
      type: string
      enum:
      - '0'
      - '1'
      - '2'
      nullable: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer