GET Get Funding Info

/get_funding_info

/get_funding_info

Example Query:

https://base-hedger82.rasa.capital/get_funding_info

Example Response:

  "BTCUSDT": {
    "next_funding_time": 1744070400000,
    "next_funding_rate_short": "0.000040455",
    "next_funding_rate_long": "-0.000053940",
    "funding_rate_epoch_duration": 14400
  },
  "FILUSDT": {
    "next_funding_time": 1744070400000,
    "next_funding_rate_short": "0.000045081",
    "next_funding_rate_long": "-0.000060108",
    "funding_rate_epoch_duration": 14400
  },

Get Funding Info Rasa Implementation

Router

Output:

  • Dict mapping ticker → FundingInfoResponseSchema.

Data Sources

  1. Symbol table (DB)

    • Symbol.funding_rate_epoch_duration

    • Symbol.funding_rate_window_time

  2. External exchange (Binance)

    • binance_client.futures_mark_price()lastFundingRate, nextFundingTime

  3. Hedger coefficients (from settings.py)

    • FundingRateHedgerToUserCoefficient

    • FundingRateUserToHedgerCoefficient

  4. Positions table (DB)

    • Used for filtering and in expressions (Positions.position_type, Positions.opened_price, etc.)

Logic

In short, the logic can be summarized like this:

Fetch Symbol & Market Details

Coefficient Application Logic

Last updated