API
Magma
Market Place

Magma API

Documentation on how to use the Magma liquidity marketplace API

Create Offer

Authenticated Endpoint: requires an API key

Create an offer on Magma to sell channels

mutation CreateOffer($input: CreateOffer!) {
  createOffer(input: $input)
}

Click to open query in the Apollo Explorer (opens in a new tab)

Variables

{
  "input": {
    "base_fee": 10000, #fixed fee for opening a channel, denominated in sats.
    "base_fee_cap": 10000, #promised upper limit for base fee channel settings.
    "fee_rate": 10002,
    "fee_rate_cap": 10003,
    "max_size": 100000,
    "min_block_length": 10005,
    "min_size": 100000,
    "total_size": 1000000
  }
}

Get Your Offers

Authenticated Endpoint: requires an API key

Get all the offers associated with your account

query MyOffers {
  getUserOffers {
    list {
      id
      status
    }
  }
}

Click to open the query in the Apollo Explorer (opens in a new tab)

Enable or disable an offer

Authenticated Endpoint: requires an API key

Enable or disable an offer

mutation ToggleOffer($toggleOfferId: String!) {
  toggleOffer(id: $toggleOfferId)
}

Click to open the query in the Apollo Explorer (opens in a new tab)

Variables

{
  "toggleOfferId": "OFFER_ID"
}

Get Open Orders for your Offers

Authenticated Endpoint: requires an API key

Get all the orders that have been opened for your offers

query MyOfferOrders($getOfferOrdersId: String) {
  getOfferOrders(id: $getOfferOrdersId) {
    list {
      status
      id
      seller_invoice_amount
    }
  }
}

Click to open the query in the Apollo Explorer (opens in a new tab)

Variables

{
  "getOfferOrdersId": "ORDER_ID"
}