The Jupiter Perps API should expose the accumulated borrow fee for an open position.
According to the Jupiter Perps liquidation documentation, the borrow fee is one of the required input values for calculating the liquidation price. Unlike the opening fee, the borrow fee changes over time while the position remains open and therefore needs to be available through the API.
Goal
Identify where the borrow fee is stored or how it is calculated, and expose it through JupiterPerpsPosition.
Required changes
Determine whether borrowFeeUsd is:
stored directly in the Position account,
stored in another account,
or must be calculated.
If the value can be obtained reliably, expose it as:
ΩUSDCAmountΩ borrowFeeUsd
Decode or calculate the value as appropriate.
Validation
Verify the decoded/calculated value against the Jupiter web UI for one or more open positions.
Notes
The borrow fee is expected to increase over time while the position remains open.
This value is one of the required inputs for implementing liquidation price calculations in a future issue.
### Description
The Jupiter Perps API should expose the accumulated borrow fee for an open position.
According to the Jupiter Perps liquidation documentation, the borrow fee is one of the required input values for calculating the liquidation price. Unlike the opening fee, the borrow fee changes over time while the position remains open and therefore needs to be available through the API.
### Goal
Identify where the borrow fee is stored or how it is calculated, and expose it through `JupiterPerpsPosition`.
### Required changes
* Determine whether `borrowFeeUsd` is:
* stored directly in the Position account,
* stored in another account,
* or must be calculated.
* If the value can be obtained reliably, expose it as:
* `ΩUSDCAmountΩ borrowFeeUsd`
* Decode or calculate the value as appropriate.
### Validation
Verify the decoded/calculated value against the Jupiter web UI for one or more open positions.
### Notes
The borrow fee is expected to increase over time while the position remains open.
This value is one of the required inputs for implementing liquidation price calculations in a future issue.
The results are almost correct now, if you compare the values agains the Jupiter UI. But I have created an #27, that should make the values more precise.
The results are almost correct now, if you compare the values agains the Jupiter UI. But I have created an #27, that should make the values more precise.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
The Jupiter Perps API should expose the accumulated borrow fee for an open position.
According to the Jupiter Perps liquidation documentation, the borrow fee is one of the required input values for calculating the liquidation price. Unlike the opening fee, the borrow fee changes over time while the position remains open and therefore needs to be available through the API.
Goal
Identify where the borrow fee is stored or how it is calculated, and expose it through
JupiterPerpsPosition.Required changes
Determine whether
borrowFeeUsdis:If the value can be obtained reliably, expose it as:
ΩUSDCAmountΩ borrowFeeUsdDecode or calculate the value as appropriate.
Validation
Verify the decoded/calculated value against the Jupiter web UI for one or more open positions.
Notes
The borrow fee is expected to increase over time while the position remains open.
This value is one of the required inputs for implementing liquidation price calculations in a future issue.
The results are almost correct now, if you compare the values agains the Jupiter UI. But I have created an #27, that should make the values more precise.