Magma Developer SDK
  • Getting started
  • Prerequisites
  • Features Available
  • Retrieve clmm pools
  • Retrieve positions
  • Retrieve reward
  • Retrieve ticks
  • Create clmm pool
  • Open position
  • Add liquidity
  • Remove liquidity
  • Close position
  • Collect fees
  • Collect rewards
  • Preswap
  • Swap
  • Partner swap
  • Smart router
  • Price impact
  • Minimum received & Maximum sold
  • Fee
  • Liquidity correlation calculation
  • APR correlation calculation
Powered by GitBook
On this page
  • Partner
  • Partner AccountCap
  • Claim Ref Fee
  • Example
  • Check ref fee of partner
  • Example

Partner swap

Currently, only established project teams are eligible for applying for partner swap.

Partner

We offer a partner function. When you utilize the standard swap method, we will allocate the agreed-upon share to the partner. But, because of sui contract limitations, partner doesn't work in the latest smart router function with split order or integrate other pools like deepbook.

Partner AccountCap

Only verified account are eligible to collect partner ref fees. When creating a partner, we generate an object partner AccountCap(you can see it in your NFT list). Only accounts that possess the AccountCap are able to claim the fees.

Claim Ref Fee

We provider one function sdk.Pool.claimPartnerRefFeePayload() to check ref fee.

Params:

Please refer to the original function for specific parameter types.

  • PARTNERcAP: tHE OBJECT ID ABOUT PARTNER CAP.

  • PARTNER: tHE OBJECT ID ABOUT PARTNER.

  • COINtYPE: tHE COIN TYPE ABOUNT FEE COIN TYPE. yOU CAN OBTAIN THE REFERRAL FEE USING THIS SPECIFIED METHOD.

Example

const partnerCap = '0x...'
const partner = '0x...'
const coinType = '0x...::...::....'
const claimRefFeePayload = await sdk.Pool.claimPartnerRefFeePayload(partnerCap, partner, coinType)
const transferTxn = await sdk.fullClient.sendTransaction(buildTestAccount(), claimRefFeePayload)
console.log('doCreatPool: ', JSON.stringify(transferTxn))

Check ref fee of partner

We provider one function sdk.Pool.getPartnerRefFeeAmount() to check ref fee.

Params:

Please refer to the original function for specific parameter types.

  • partnerID: The object id about partner.

Example

const partnerID = '0x...'
const refFee = await sdk.Pool.getPartnerRefFeeAmount(partnerID)
console.log('ref fee:', refFee)
PreviousSwapNextSmart router

Last updated 4 months ago