This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: annualize funding yield * chore: add supplemental annualized funding yield * chore: use annualized funding yield in exporter Co-authored-by: Sebastien Verreault <[email protected]>
- Loading branch information
1 parent
0c554c4
commit c2b7d6e
Showing
4 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
SELECT | ||
ROUND(COALESCE(dealer.mul( COALESCE(1 + funding_rate, 1) ) - 1, 0), 15) as funding_yield | ||
ROUND(COALESCE(dealer.mul( COALESCE(1 + funding_rate, 1) ) - 1, 0), 15) as funding_yield, | ||
((1. + ROUND(COALESCE(dealer.mul( COALESCE(1 + funding_rate, 1) ) - 1, 0), 15))^(365.25 / COALESCE(NULLIF(${numberOfDays}, 0), 0.0000001))) - 1. as annual_funding_yield | ||
FROM dealer.funding_rates | ||
WHERE funding_rate IS NOT NULL | ||
AND exchange_id = (SELECT id FROM dealer.exchanges where exchange_name = lower(${exchangeName})) | ||
AND timestamp >= current_timestamp - make_interval(days => ${numberOfDays}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters