vega icon indicating copy to clipboard operation
vega copied to clipboard

[API]: Enhance estimateFee to cope with being a maker

Open JonRay15 opened this issue 5 months ago • 1 comments

API Overview

Currently the estimateFee API always assumes you are the TAKER and provides output based on that.

it would be great if it behaved differently if you put type:"TYPE_LIMIT".

In that case we could treat the order as if it is NOT the aggressor and return the fees received by you as the maker.

So presumably everything would be zero except for:

  • makerFee
  • highVolumeMakerFee

And we would want to look up the correct value for highVolumeMakerFee based on the party provided.

query dealTicket {
  estimateFees(
    marketId:"90360cb6312346f8a5380cc7d6a7df30583135e743246d68ffd1a51effe7394e",
    partyId:"00b07e02bd56f84f3fcef3635f6a6a1d1cadd66665dbf7f12090e8787ef26571",
    price:"236900",
    size:"1000",
    timeInForce:TIME_IN_FORCE_GTC,
    side:SIDE_BUY,
    type:TYPE_MARKET
  )
  {
    totalFeeAmount
    fees{
      makerFee
      infrastructureFee
      liquidityFee
      buyBackFee
      treasuryFee
      highVolumeMakerFee
      makerFeeReferralDiscount
      makerFeeVolumeDiscount
      infrastructureFeeReferralDiscount
      infrastructureFeeVolumeDiscount
      liquidityFeeReferralDiscount
      liquidityFeeVolumeDiscount
      }
  }
}

JonRay15 avatar Sep 18 '24 11:09 JonRay15