Created
December 5, 2020 08:04
-
-
Save bigsan/77c34150b0fd89657310084cec4661fd to your computer and use it in GitHub Desktop.
Show APY of lending history on FTX
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
// ==UserScript== | |
// @name Show APY of lending history on FTX | |
// @namespace https://gist.github.com/bigsan/ | |
// @version 0.1 | |
// @description Show APY of lending history on FTX | |
// @author You | |
// @match https://ftx.com/spot-margin/lending | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
setTimeout(setup, 3000); | |
function setup() { | |
document.body.addEventListener('click', e => { | |
if (e.target.closest("#pagination-back,#pagination-next")) { | |
setTimeout(showAPY, 50); | |
} | |
}); | |
showAPY(); | |
} | |
function showAPY() { | |
[...document.querySelectorAll('.MuiTableCell-body')] | |
.filter(e => /每小時貸款利率|每小时贷款利率|Hourly Funding Rate/i.test(e.innerHTML)) | |
.forEach(e => { | |
const [r] = e.nextElementSibling.innerHTML.split(' '); | |
e.nextElementSibling.innerHTML = `${r} (${(r * 24 * 365 * 100).toFixed(2)}%)`; | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment