NetLiquidityLibrary
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © calebsandfort

//@version=5

// @description The Net Liquidity Library provides daily values for net liquidity. Net liquidity is measured as Fed Balance Sheet - Treasury General Account - Reverse Repo. Time series for each individual component included too.
library("NetLiquidityLibrary", overlay = true)


get_net_liquidity_0(simple string component = "", int ts = 0) =>
    float val = switch ts
        1624320000000 => component == "fed" ? 8064257000000.0 : component == "tga" ? 744249000000.0 : component == "rrp" ? 791605000000.0 : 6528403000000.0
        1624406400000 => component == "fed" ? 8064257000000.0 : component == "tga" ? 744249000000.0 : component == "rrp" ? 813650000000.0 : 6544046000000.0
        1624492800000 => component == "fed" ? 8101945000000.0 : component == "tga" ? 733877000000.0 : component == "rrp" ? 813048000000.0 : 6555020000000.0
        1624579200000 => component == "fed" ? 8101945000000.0 : component == "tga" ? 723946000000.0 : component == "rrp" ? 770830000000.0 : 6607169000000.0
        1624838400000 => component == "fed" ? 8101945000000.0 : component == "tga" ? 733226000000.0 : component == "rrp" ? 803019000000.0 : 6565700000000.0
        1624924800000 => component == "fed" ? 8101945000000.0 : component == "tga" ? 734915000000.0 : component == "rrp" ? 841246000000.0 : 6525784000000.0
        1625011200000 => component == "fed" ? 8101945000000.0 : component == "tga" ? 711267000000.0 : component == "rrp" ? 991939000000.0 : 6375338000000.0
        1625097600000 => component == "fed" ? 8078544000000.0 : component == "tga" ? 851929000000.0 : component == "rrp" ? 742647000000.0 : 6483968000000.0
        1625184000000 => component == "fed" ? 8078544000000.0 : component == "tga" ? 784035000000.0 : component == "rrp" ? 731504000000.0 : 6563005000000.0
        1625529600000 => component == "fed" ? 8078544000000.0 : component == "tga" ? 757682000000.0 : component == "rrp" ? 772581000000.0 : 6548281000000.0
        1625616000000 => component == "fed" ? 8078544000000.0 : component == "tga" ? 733889000000.0 : component == "rrp" ? 785720000000.0 : 6578164000000.0
        1625702400000 => component == "fed" ? 8097773000000.0 : component == "tga" ? 724898000000.0 : component == "rrp" ? 793399000000.0 : 6579476000000.0
        1625788800000 => component == "fed" ? 8097773000000.0 : component == "tga" ? 727336000000.0 : component == "rrp" ? 780596000000.0 : 6589841000000.0
        1626048000000 => component == "fed" ? 8097773000000.0 : component == "tga" ? 718092000000.0 : component == "rrp" ? 776472000000.0 : 6603209000000.0
        1626134400000 => component == "fed" ? 8097773000000.0 : component == "tga" ? 718474000000.0 : component == "rrp" ? 798267000000.0 : 6581032000000.0
        1626220800000 => component == "fed" ? 8097773000000.0 : component == "tga" ? 676800000000.0 : component == "rrp" ? 859975000000.0 : 6664876000000.0
        1626307200000 => component == "fed" ? 8201651000000.0 : component == "tga" ? 657542000000.0 : component == "rrp" ? 776261000000.0 : 6767848000000.0
        1626393600000 => component == "fed" ? 8201651000000.0 : component == "tga" ? 690107000000.0 : component == "rrp" ? 817566000000.0 : 6693978000000.0
        1626652800000 => component == "fed" ? 8201651000000.0 : component == "tga" ? 697581000000.0 : component == "rrp" ? 860468000000.0 : 6643602000000.0
        1626739200000 => component == "fed" ? 8201651000000.0 : component == "tga" ? 700041000000.0 : component == "rrp" ? 848102000000.0 : 6653508000000.0
        1626825600000 => component == "fed" ? 8201651000000.0 : component == "tga" ? 647533000000.0 : component == "rrp" ? 886206000000.0 : 6706791000000.0
        1626912000000 => component == "fed" ? 8240530000000.0 : component == "tga" ? 616294000000.0 : component == "rrp" ? 898197000000.0 : 6726039000000.0
        1626998400000 => component == "fed" ? 8240530000000.0 : component == "tga" ? 590042000000.0 : component == "rrp" ? 877251000000.0 : 6773237000000.0
        1627257600000 => component == "fed" ? 8240530000000.0 : component == "tga" ? 588083000000.0 : component == "rrp" ? 891203000000.0 : 6761244000000.0
        1627344000000 => component == "fed" ? 8240530000000.0 : component == "tga" ? 591368000000.0 : component == "rrp" ? 927419000000.0 : 6721743000000.0
        1627430400000 => component == "fed" ? 8240530000000.0 : component == "tga" ? 564799000000.0 : component == "rrp" ? 965189000000.0 : 6691485000000.0
        1627516800000 => component == "fed" ? 8221473000000.0 : component == "tga" ? 536966000000.0 : component == "rrp" ? 987283000000.0 : 6697224000000.0
        1627603200000 => component == "fed" ? 8221473000000.0 : component == "tga" ? 501179000000.0 : component == "rrp" ? 1039394000000.0 : 6680900000000.0
        1627862400000 => component == "fed" ? 8221473000000.0 : component == "tga" ? 459402000000.0 : component == "rrp" ? 921317000000.0 : 6840754000000.0
        1627948800000 => component == "fed" ? 8221473000000.0 : component == "tga" ? 555569000000.0 : component == "rrp" ? 909442000000.0 : 6756462000000.0
        1628035200000 => component == "fed" ? 8221473000000.0 : component == "tga" ? 507848000000.0 : component == "rrp" ? 931755000000.0 : 6795470000000.0
        1628121600000 => component == "fed" ? 8235073000000.0 : component == "tga" ? 505871000000.0 : component == "rrp" ? 944335000000.0 : 6784867000000.0
        1628208000000 => component == "fed" ? 8235073000000.0 : component == "tga" ? 466601000000.0 : component == "rrp" ? 952134000000.0 : 6816338000000.0
        1628467200000 => component == "fed" ? 8235073000000.0 : component == "tga" ? 442557000000.0 : component == "rrp" ? 981765000000.0 : 6810751000000.0
        1628553600000 => component == "fed" ? 8235073000000.0 : component == "tga" ? 444212000000.0 : component == "rrp" ? 998654000000.0 : 6792207000000.0
        1628640000000 => component == "fed" ? 8235073000000.0 : component == "tga" ? 416199000000.0 : component == "rrp" ? 1000460000000.0 : 6840500000000.0
        1628726400000 => component == "fed" ? 8257159000000.0 : component == "tga" ? 389747000000.0 : component == "rrp" ? 1087342000000.0 : 6780070000000.0
        1628812800000 => component == "fed" ? 8257159000000.0 : component == "tga" ? 351572000000.0 : component == "rrp" ? 1050941000000.0 : 6854646000000.0
        1629072000000 => component == "fed" ? 8257159000000.0 : component == "tga" ? 335190000000.0 : component == "rrp" ? 1036418000000.0 : 6885551000000.0
        1629158400000 => component == "fed" ? 8257159000000.0 : component == "tga" ? 362012000000.0 : component == "rrp" ? 1053454000000.0 : 6841693000000.0
        1629244800000 => component == "fed" ? 8257159000000.0 : component == "tga" ? 338853000000.0 : component == "rrp" ? 1115656000000.0 : 6888089000000.0
        1629331200000 => component == "fed" ? 8342598000000.0 : component == "tga" ? 313651000000.0 : component == "rrp" ? 1109938000000.0 : 6919009000000.0
        1629417600000 => component == "fed" ? 8342598000000.0 : component == "tga" ? 321137000000.0 : component == "rrp" ? 1111905000000.0 : 6909556000000.0
        1629676800000 => component == "fed" ? 8342598000000.0 : component == "tga" ? 309820000000.0 : component == "rrp" ? 1135697000000.0 : 6897081000000.0
        1629763200000 => component == "fed" ? 8342598000000.0 : component == "tga" ? 317103000000.0 : component == "rrp" ? 1129737000000.0 : 6895758000000.0
        1629849600000 => component == "fed" ? 8342598000000.0 : component == "tga" ? 284110000000.0 : component == "rrp" ? 1147089000000.0 : 6901544000000.0
        1629936000000 => component == "fed" ? 8332743000000.0 : component == "tga" ? 258200000000.0 : component == "rrp" ? 1091792000000.0 : 6982751000000.0
        1630022400000 => component == "fed" ? 8332743000000.0 : component == "tga" ? 239304000000.0 : component == "rrp" ? 1120015000000.0 : 6973424000000.0
        1630281600000 => component == "fed" ? 8332743000000.0 : component == "tga" ? 262811000000.0 : component == "rrp" ? 1140711000000.0 : 6929221000000.0
        1630368000000 => component == "fed" ? 8332743000000.0 : component == "tga" ? 262895000000.0 : component == "rrp" ? 1189616000000.0 : 6880232000000.0
        1630454400000 => component == "fed" ? 8332743000000.0 : component == "tga" ? 355984000000.0 : component == "rrp" ? 1084115000000.0 : 6909074000000.0
        1630540800000 => component == "fed" ? 8349173000000.0 : component == "tga" ? 296934000000.0 : component == "rrp" ? 1066987000000.0 : 6985252000000.0
        1630627200000 => component == "fed" ? 8349173000000.0 : component == "tga" ? 292163000000.0 : component == "rrp" ? 1074707000000.0 : 6982303000000.0
        1630972800000 => component == "fed" ? 8349173000000.0 : component == "tga" ? 262488000000.0 : component == "rrp" ? 1079945000000.0 : 7006740000000.0
        1631059200000 => component == "fed" ? 8349173000000.0 : component == "tga" ? 231654000000.0 : component == "rrp" ? 1115229000000.0 : 7010431000000.0
        1631145600000 => component == "fed" ? 8357314000000.0 : component == "tga" ? 200702000000.0 : component == "rrp" ? 1107659000000.0 : 7048953000000.0
        1631232000000 => component == "fed" ? 8357314000000.0 : component == "tga" ? 207218000000.0 : component == "rrp" ? 1099323000000.0 : 7050773000000.0
        1631491200000 => component == "fed" ? 8357314000000.0 : component == "tga" ? 208035000000.0 : component == "rrp" ? 1087108000000.0 : 7062171000000.0
        1631577600000 => component == "fed" ? 8357314000000.0 : component == "tga" ? 225075000000.0 : component == "rrp" ? 1169280000000.0 : 6962959000000.0
        1631664000000 => component == "fed" ? 8357314000000.0 : component == "tga" ? 211227000000.0 : component == "rrp" ? 1081342000000.0 : 7156201000000.0
        1631750400000 => component == "fed" ? 8448770000000.0 : component == "tga" ? 344668000000.0 : component == "rrp" ? 1147494000000.0 : 6956608000000.0
        1631836800000 => component == "fed" ? 8448770000000.0 : component == "tga" ? 317970000000.0 : component == "rrp" ? 1218303000000.0 : 6912497000000.0
        1632096000000 => component == "fed" ? 8448770000000.0 : component == "tga" ? 315003000000.0 : component == "rrp" ? 1224289000000.0 : 6909478000000.0
        1632182400000 => component == "fed" ? 8448770000000.0 : component == "tga" ? 324877000000.0 : component == "rrp" ? 1240494000000.0 : 6883399000000.0
        1632268800000 => component == "fed" ? 8448770000000.0 : component == "tga" ? 295620000000.0 : component == "rrp" ? 1283281000000.0 : 6910923000000.0
        1632355200000 => component == "fed" ? 8489824000000.0 : component == "tga" ? 272679000000.0 : component == "rrp" ? 1352483000000.0 : 6864662000000.0
        1632441600000 => component == "fed" ? 8489824000000.0 : component == "tga" ? 173922000000.0 : component == "rrp" ? 1313657000000.0 : 7002245000000.0
        1632700800000 => component == "fed" ? 8489824000000.0 : component == "tga" ? 215533000000.0 : component == "rrp" ? 1297050000000.0 : 6977241000000.0
        1632787200000 => component == "fed" ? 8489824000000.0 : component == "tga" ? 217019000000.0 : component == "rrp" ? 1365185000000.0 : 6907620000000.0
        1632873600000 => component == "fed" ? 8489824000000.0 : component == "tga" ? 172920000000.0 : component == "rrp" ? 1415840000000.0 : 6859221000000.0
        1632960000000 => component == "fed" ? 8447981000000.0 : component == "tga" ? 173745000000.0 : component == "rrp" ? 1604881000000.0 : 6669355000000.0
        1633046400000 => component == "fed" ? 8447981000000.0 : component == "tga" ? 215160000000.0 : component == "rrp" ? 1385991000000.0 : 6846830000000.0
        1633305600000 => component == "fed" ? 8447981000000.0 : component == "tga" ? 132452000000.0 : component == "rrp" ? 1399173000000.0 : 6916356000000.0
        1633392000000 => component == "fed" ? 8447981000000.0 : component == "tga" ? 141318000000.0 : component == "rrp" ? 1431180000000.0 : 6875483000000.0
        1633478400000 => component == "fed" ? 8447981000000.0 : component == "tga" ? 99385000000.0 : component == "rrp" ? 1451175000000.0 : 6913472000000.0
        1633564800000 => component == "fed" ? 8464032000000.0 : component == "tga" ? 95854000000.0 : component == "rrp" ? 1375863000000.0 : 6992315000000.0
        1633651200000 => component == "fed" ? 8464032000000.0 : component == "tga" ? 86339000000.0 : component == "rrp" ? 1371958000000.0 : 7005735000000.0
        1633910400000 => component == "fed" ? 8464032000000.0 : component == "tga" ? 81803000000.0 : component == "rrp" ? 1371958000000.0 : 7010271000000.0
        1633996800000 => component == "fed" ? 8464032000000.0 : component == "tga" ? 81803000000.0 : component == "rrp" ? 1367051000000.0 : 7015178000000.0
        1634083200000 => component == "fed" ? 8464032000000.0 : component == "tga" ? 58993000000.0 : component == "rrp" ? 1364701000000.0 : 7057248000000.0
        1634169600000 => component == "fed" ? 8480942000000.0 : component == "tga" ? 72460000000.0 : component == "rrp" ? 1445660000000.0 : 6962822000000.0
        1634256000000 => component == "fed" ? 8480942000000.0 : component == "tga" ? 46508000000.0 : component == "rrp" ? 1462297000000.0 : 6972137000000.0
        1634515200000 => component == "fed" ? 8480942000000.0 : component == "tga" ? 50846000000.0 : component == "rrp" ? 1477114000000.0 : 6952982000000.0
        1634601600000 => component == "fed" ? 8480942000000.0 : component == "tga" ? 134768000000.0 : component == "rrp" ? 1470739000000.0 : 6875435000000.0
        1634688000000 => component == "fed" ? 8480942000000.0 : component == "tga" ? 132525000000.0 : component == "rrp" ? 1493961000000.0 : 6938457000000.0
        1634774400000 => component == "fed" ? 8564943000000.0 : component == "tga" ? 117364000000.0 : component == "rrp" ? 1458605000000.0 : 6988974000000.0
        1634860800000 => component == "fed" ? 8564943000000.0 : component == "tga" ? 149154000000.0 : component == "rrp" ? 1403020000000.0 : 7012769000000.0
        1635120000000 => component == "fed" ? 8564943000000.0 : component == "tga" ? 208815000000.0 : component == "rrp" ? 1413188000000.0 : 6942940000000.0
        1635206400000 => component == "fed" ? 8564943000000.0 : component == "tga" ? 219868000000.0 : component == "rrp" ? 1423198000000.0 : 6921877000000.0
        1635292800000 => component == "fed" ? 8564943000000.0 : component == "tga" ? 261071000000.0 : component == "rrp" ? 1433370000000.0 : 6861740000000.0
        1635379200000 => component == "fed" ? 8556181000000.0 : component == "tga" ? 236495000000.0 : component == "rrp" ? 1384684000000.0 : 6935002000000.0
        1635465600000 => component == "fed" ? 8556181000000.0 : component == "tga" ? 259761000000.0 : component == "rrp" ? 1502296000000.0 : 6794124000000.0
        1635724800000 => component == "fed" ? 8556181000000.0 : component == "tga" ? 278023000000.0 : component == "rrp" ? 1358606000000.0 : 6919552000000.0
        1635811200000 => component == "fed" ? 8556181000000.0 : component == "tga" ? 269343000000.0 : component == "rrp" ? 1329913000000.0 : 6956925000000.0
        1635897600000 => component == "fed" ? 8556181000000.0 : component == "tga" ? 311302000000.0 : component == "rrp" ? 1343985000000.0 : 6919584000000.0
        1635984000000 => component == "fed" ? 8574871000000.0 : component == "tga" ? 286959000000.0 : component == "rrp" ? 1348539000000.0 : 6939373000000.0
        1636070400000 => component == "fed" ? 8574871000000.0 : component == "tga" ? 268350000000.0 : component == "rrp" ? 1354059000000.0 : 6952462000000.0
        1636329600000 => component == "fed" ? 8574871000000.0 : component == "tga" ? 263023000000.0 : component == "rrp" ? 1354382000000.0 : 6957466000000.0
        1636416000000 => component == "fed" ? 8574871000000.0 : component == "tga" ? 270273000000.0 : component == "rrp" ? 1377197000000.0 : 6927401000000.0
        1636502400000 => component == "fed" ? 8574871000000.0 : component == "tga" ? 255937000000.0 : component == "rrp" ? 1448623000000.0 : 6958557000000.0
        =>
            float(na)
    val

get_net_liquidity_1(simple string component = "", int ts = 0) =>
    float val = switch ts
        1636588800000 => component == "fed" ? 8663117000000.0 : component == "tga" ? 231421000000.0 : component == "rrp" ? 1448623000000.0 : 6983073000000.0
        1636675200000 => component == "fed" ? 8663117000000.0 : component == "tga" ? 231421000000.0 : component == "rrp" ? 1417643000000.0 : 7014053000000.0
        1636934400000 => component == "fed" ? 8663117000000.0 : component == "tga" ? 219793000000.0 : component == "rrp" ? 1391657000000.0 : 7051667000000.0
        1637020800000 => component == "fed" ? 8663117000000.0 : component == "tga" ? 211700000000.0 : component == "rrp" ? 1466857000000.0 : 6984560000000.0
        1637107200000 => component == "fed" ? 8663117000000.0 : component == "tga" ? 198696000000.0 : component == "rrp" ? 1520000000000.0 : 6956274000000.0
        1637193600000 => component == "fed" ? 8674970000000.0 : component == "tga" ? 178972000000.0 : component == "rrp" ? 1584097000000.0 : 6911901000000.0
        1637280000000 => component == "fed" ? 8674970000000.0 : component == "tga" ? 168229000000.0 : component == "rrp" ? 1575384000000.0 : 6931357000000.0
        1637539200000 => component == "fed" ? 8674970000000.0 : component == "tga" ? 170311000000.0 : component == "rrp" ? 1573769000000.0 : 6930890000000.0
        1637625600000 => component == "fed" ? 8674970000000.0 : component == "tga" ? 163242000000.0 : component == "rrp" ? 1571980000000.0 : 6939748000000.0
        1637712000000 => component == "fed" ? 8674970000000.0 : component == "tga" ? 165160000000.0 : component == "rrp" ? 1452897000000.0 : 7063714000000.0
        1637884800000 => component == "fed" ? 8681771000000.0 : component == "tga" ? 141042000000.0 : component == "rrp" ? 1451108000000.0 : 7089621000000.0
        1638144000000 => component == "fed" ? 8681771000000.0 : component == "tga" ? 137091000000.0 : component == "rrp" ? 1459339000000.0 : 7085341000000.0
        1638230400000 => component == "fed" ? 8681771000000.0 : component == "tga" ? 143941000000.0 : component == "rrp" ? 1517956000000.0 : 7019874000000.0
        1638316800000 => component == "fed" ? 8681771000000.0 : component == "tga" ? 213153000000.0 : component == "rrp" ? 1427347000000.0 : 7009902000000.0
        1638403200000 => component == "fed" ? 8650402000000.0 : component == "tga" ? 159148000000.0 : component == "rrp" ? 1448585000000.0 : 7042669000000.0
        1638489600000 => component == "fed" ? 8650402000000.0 : component == "tga" ? 125195000000.0 : component == "rrp" ? 1475464000000.0 : 7049743000000.0
        1638748800000 => component == "fed" ? 8650402000000.0 : component == "tga" ? 101192000000.0 : component == "rrp" ? 1487996000000.0 : 7061214000000.0
        1638835200000 => component == "fed" ? 8650402000000.0 : component == "tga" ? 106980000000.0 : component == "rrp" ? 1455038000000.0 : 7088384000000.0
        1638921600000 => component == "fed" ? 8650402000000.0 : component == "tga" ? 144924000000.0 : component == "rrp" ? 1484192000000.0 : 7035408000000.0
        1639008000000 => component == "fed" ? 8664524000000.0 : component == "tga" ? 125144000000.0 : component == "rrp" ? 1500027000000.0 : 7039353000000.0
        1639094400000 => component == "fed" ? 8664524000000.0 : component == "tga" ? 118145000000.0 : component == "rrp" ? 1507147000000.0 : 7039232000000.0
        1639353600000 => component == "fed" ? 8664524000000.0 : component == "tga" ? 114680000000.0 : component == "rrp" ? 1599768000000.0 : 6950076000000.0
        1639440000000 => component == "fed" ? 8664524000000.0 : component == "tga" ? 133605000000.0 : component == "rrp" ? 1584488000000.0 : 6946431000000.0
        1639526400000 => component == "fed" ? 8664524000000.0 : component == "tga" ? 79505000000.0 : component == "rrp" ? 1621097000000.0 : 7056064000000.0
        1639612800000 => component == "fed" ? 8756666000000.0 : component == "tga" ? 58294000000.0 : component == "rrp" ? 1657626000000.0 : 7040746000000.0
        1639699200000 => component == "fed" ? 8756666000000.0 : component == "tga" ? 42111000000.0 : component == "rrp" ? 1704586000000.0 : 7009969000000.0
        1639958400000 => component == "fed" ? 8756666000000.0 : component == "tga" ? 47877000000.0 : component == "rrp" ? 1758041000000.0 : 6950748000000.0
        1640044800000 => component == "fed" ? 8756666000000.0 : component == "tga" ? 64905000000.0 : component == "rrp" ? 1748285000000.0 : 6943476000000.0
        1640131200000 => component == "fed" ? 8756666000000.0 : component == "tga" ? 146518000000.0 : component == "rrp" ? 1699277000000.0 : 6944700000000.0
        1640217600000 => component == "fed" ? 8790495000000.0 : component == "tga" ? 197516000000.0 : component == "rrp" ? 1577780000000.0 : 7015199000000.0
        1640563200000 => component == "fed" ? 8790495000000.0 : component == "tga" ? 176914000000.0 : component == "rrp" ? 1580347000000.0 : 7033234000000.0
        1640649600000 => component == "fed" ? 8790495000000.0 : component == "tga" ? 202813000000.0 : component == "rrp" ? 1637064000000.0 : 6950618000000.0
        1640736000000 => component == "fed" ? 8790495000000.0 : component == "tga" ? 268208000000.0 : component == "rrp" ? 1642506000000.0 : 6846746000000.0
        1640822400000 => component == "fed" ? 8757460000000.0 : component == "tga" ? 283995000000.0 : component == "rrp" ? 1696476000000.0 : 6776989000000.0
        1640908800000 => component == "fed" ? 8757460000000.0 : component == "tga" ? 284174000000.0 : component == "rrp" ? 1904582000000.0 : 6568704000000.0
        1641168000000 => component == "fed" ? 8757460000000.0 : component == "tga" ? 406108000000.0 : component == "rrp" ? 1579526000000.0 : 6771826000000.0
        1641254400000 => component == "fed" ? 8757460000000.0 : component == "tga" ? 366304000000.0 : component == "rrp" ? 1495692000000.0 : 6895464000000.0
        1641340800000 => component == "fed" ? 8757460000000.0 : component == "tga" ? 424696000000.0 : component == "rrp" ? 1492787000000.0 : 6848238000000.0
        1641427200000 => component == "fed" ? 8765721000000.0 : component == "tga" ? 434757000000.0 : component == "rrp" ? 1510553000000.0 : 6820411000000.0
        1641513600000 => component == "fed" ? 8765721000000.0 : component == "tga" ? 440561000000.0 : component == "rrp" ? 1530096000000.0 : 6795064000000.0
        1641772800000 => component == "fed" ? 8765721000000.0 : component == "tga" ? 436443000000.0 : component == "rrp" ? 1560421000000.0 : 6768857000000.0
        1641859200000 => component == "fed" ? 8765721000000.0 : component == "tga" ? 447887000000.0 : component == "rrp" ? 1527020000000.0 : 6790814000000.0
        1641945600000 => component == "fed" ? 8765721000000.0 : component == "tga" ? 507352000000.0 : component == "rrp" ? 1536981000000.0 : 6743945000000.0
        1642032000000 => component == "fed" ? 8788278000000.0 : component == "tga" ? 489679000000.0 : component == "rrp" ? 1636742000000.0 : 6661857000000.0
        1642118400000 => component == "fed" ? 8788278000000.0 : component == "tga" ? 441135000000.0 : component == "rrp" ? 1598887000000.0 : 6748256000000.0
        1642464000000 => component == "fed" ? 8788278000000.0 : component == "tga" ? 453239000000.0 : component == "rrp" ? 1597137000000.0 : 6737902000000.0
        1642550400000 => component == "fed" ? 8788278000000.0 : component == "tga" ? 586619000000.0 : component == "rrp" ? 1656576000000.0 : 6624639000000.0
        1642636800000 => component == "fed" ? 8867834000000.0 : component == "tga" ? 580171000000.0 : component == "rrp" ? 1678931000000.0 : 6608732000000.0
        1642723200000 => component == "fed" ? 8867834000000.0 : component == "tga" ? 601115000000.0 : component == "rrp" ? 1706127000000.0 : 6560592000000.0
        1642982400000 => component == "fed" ? 8867834000000.0 : component == "tga" ? 598929000000.0 : component == "rrp" ? 1614002000000.0 : 6654903000000.0
        1643068800000 => component == "fed" ? 8867834000000.0 : component == "tga" ? 619699000000.0 : component == "rrp" ? 1599502000000.0 : 6648633000000.0
        1643155200000 => component == "fed" ? 8867834000000.0 : component == "tga" ? 646920000000.0 : component == "rrp" ? 1613046000000.0 : 6600519000000.0
        1643241600000 => component == "fed" ? 8860485000000.0 : component == "tga" ? 639620000000.0 : component == "rrp" ? 1583895000000.0 : 6636970000000.0
        1643328000000 => component == "fed" ? 8860485000000.0 : component == "tga" ? 641597000000.0 : component == "rrp" ? 1615021000000.0 : 6603867000000.0
        1643587200000 => component == "fed" ? 8860485000000.0 : component == "tga" ? 642334000000.0 : component == "rrp" ? 1654850000000.0 : 6563301000000.0
        1643673600000 => component == "fed" ? 8860485000000.0 : component == "tga" ? 742843000000.0 : component == "rrp" ? 1584109000000.0 : 6533533000000.0
        1643760000000 => component == "fed" ? 8860485000000.0 : component == "tga" ? 708705000000.0 : component == "rrp" ? 1626895000000.0 : 6537611000000.0
        1643846400000 => component == "fed" ? 8873211000000.0 : component == "tga" ? 710267000000.0 : component == "rrp" ? 1640397000000.0 : 6522547000000.0
        1643932800000 => component == "fed" ? 8873211000000.0 : component == "tga" ? 684721000000.0 : component == "rrp" ? 1642892000000.0 : 6545598000000.0
        1644192000000 => component == "fed" ? 8873211000000.0 : component == "tga" ? 682002000000.0 : component == "rrp" ? 1679932000000.0 : 6511277000000.0
        1644278400000 => component == "fed" ? 8873211000000.0 : component == "tga" ? 691711000000.0 : component == "rrp" ? 1674610000000.0 : 6506890000000.0
        1644364800000 => component == "fed" ? 8873211000000.0 : component == "tga" ? 703228000000.0 : component == "rrp" ? 1653153000000.0 : 6521628000000.0
        1644451200000 => component == "fed" ? 8878009000000.0 : component == "tga" ? 679019000000.0 : component == "rrp" ? 1634146000000.0 : 6564844000000.0
        1644537600000 => component == "fed" ? 8878009000000.0 : component == "tga" ? 672004000000.0 : component == "rrp" ? 1635826000000.0 : 6570179000000.0
        1644796800000 => component == "fed" ? 8878009000000.0 : component == "tga" ? 682930000000.0 : component == "rrp" ? 1666232000000.0 : 6528847000000.0
        1644883200000 => component == "fed" ? 8878009000000.0 : component == "tga" ? 699135000000.0 : component == "rrp" ? 1608494000000.0 : 6570380000000.0
        1644969600000 => component == "fed" ? 8878009000000.0 : component == "tga" ? 718597000000.0 : component == "rrp" ? 1644134000000.0 : 6548302000000.0
        1645056000000 => component == "fed" ? 8911033000000.0 : component == "tga" ? 709261000000.0 : component == "rrp" ? 1647202000000.0 : 6554570000000.0
        1645142400000 => component == "fed" ? 8911033000000.0 : component == "tga" ? 705359000000.0 : component == "rrp" ? 1674929000000.0 : 6530745000000.0
        1645488000000 => component == "fed" ? 8911033000000.0 : component == "tga" ? 702252000000.0 : component == "rrp" ? 1699432000000.0 : 6509349000000.0
        1645574400000 => component == "fed" ? 8911033000000.0 : component == "tga" ? 695704000000.0 : component == "rrp" ? 1738322000000.0 : 6494103000000.0
        1645660800000 => component == "fed" ? 8928129000000.0 : component == "tga" ? 674797000000.0 : component == "rrp" ? 1650399000000.0 : 6602933000000.0
        1645747200000 => component == "fed" ? 8928129000000.0 : component == "tga" ? 640342000000.0 : component == "rrp" ? 1603349000000.0 : 6684438000000.0
        1646006400000 => component == "fed" ? 8928129000000.0 : component == "tga" ? 661184000000.0 : component == "rrp" ? 1596052000000.0 : 6670893000000.0
        1646092800000 => component == "fed" ? 8928129000000.0 : component == "tga" ? 771264000000.0 : component == "rrp" ? 1552950000000.0 : 6603915000000.0
        1646179200000 => component == "fed" ? 8928129000000.0 : component == "tga" ? 699674000000.0 : component == "rrp" ? 1526211000000.0 : 6678570000000.0
        1646265600000 => component == "fed" ? 8904455000000.0 : component == "tga" ? 685491000000.0 : component == "rrp" ? 1533992000000.0 : 6684972000000.0
        1646352000000 => component == "fed" ? 8904455000000.0 : component == "tga" ? 661486000000.0 : component == "rrp" ? 1483061000000.0 : 6759908000000.0
        1646611200000 => component == "fed" ? 8904455000000.0 : component == "tga" ? 658241000000.0 : component == "rrp" ? 1461227000000.0 : 6784987000000.0
        1646697600000 => component == "fed" ? 8904455000000.0 : component == "tga" ? 673387000000.0 : component == "rrp" ? 1525099000000.0 : 6705969000000.0
        1646784000000 => component == "fed" ? 8904455000000.0 : component == "tga" ? 645312000000.0 : component == "rrp" ? 1542504000000.0 : 6722932000000.0
        1646870400000 => component == "fed" ? 8910748000000.0 : component == "tga" ? 609369000000.0 : component == "rrp" ? 1568735000000.0 : 6732644000000.0
        1646956800000 => component == "fed" ? 8910748000000.0 : component == "tga" ? 541965000000.0 : component == "rrp" ? 1557823000000.0 : 6810960000000.0
        1647216000000 => component == "fed" ? 8910748000000.0 : component == "tga" ? 544592000000.0 : component == "rrp" ? 1608021000000.0 : 6758135000000.0
        1647302400000 => component == "fed" ? 8910748000000.0 : component == "tga" ? 567360000000.0 : component == "rrp" ? 1583471000000.0 : 6759917000000.0
        1647388800000 => component == "fed" ? 8910748000000.0 : component == "tga" ? 629614000000.0 : component == "rrp" ? 1613637000000.0 : 6711055000000.0
        1647475200000 => component == "fed" ? 8954306000000.0 : component == "tga" ? 621527000000.0 : component == "rrp" ? 1659977000000.0 : 6672802000000.0
        1647561600000 => component == "fed" ? 8954306000000.0 : component == "tga" ? 624216000000.0 : component == "rrp" ? 1715148000000.0 : 6614942000000.0
        1647820800000 => component == "fed" ? 8954306000000.0 : component == "tga" ? 622418000000.0 : component == "rrp" ? 1728893000000.0 : 6602995000000.0
        1647907200000 => component == "fed" ? 8954306000000.0 : component == "tga" ? 626636000000.0 : component == "rrp" ? 1763183000000.0 : 6564487000000.0
        1647993600000 => component == "fed" ? 8954306000000.0 : component == "tga" ? 607762000000.0 : component == "rrp" ? 1803186000000.0 : 6551526000000.0
        1648080000000 => component == "fed" ? 8962474000000.0 : component == "tga" ? 576442000000.0 : component == "rrp" ? 1707655000000.0 : 6678377000000.0
        1648166400000 => component == "fed" ? 8962474000000.0 : component == "tga" ? 563796000000.0 : component == "rrp" ? 1676974000000.0 : 6721704000000.0
        1648425600000 => component == "fed" ? 8962474000000.0 : component == "tga" ? 582578000000.0 : component == "rrp" ? 1688632000000.0 : 6691264000000.0
        1648512000000 => component == "fed" ? 8962474000000.0 : component == "tga" ? 596168000000.0 : component == "rrp" ? 1718870000000.0 : 6647436000000.0
        1648598400000 => component == "fed" ? 8962474000000.0 : component == "tga" ? 560968000000.0 : component == "rrp" ? 1785939000000.0 : 6590235000000.0
        1648684800000 => component == "fed" ? 8937142000000.0 : component == "tga" ? 556791000000.0 : component == "rrp" ? 1871970000000.0 : 6508381000000.0
        1648771200000 => component == "fed" ? 8937142000000.0 : component == "tga" ? 651523000000.0 : component == "rrp" ? 1666063000000.0 : 6619556000000.0
        1649030400000 => component == "fed" ? 8937142000000.0 : component == "tga" ? 567423000000.0 : component == "rrp" ? 1692936000000.0 : 6676783000000.0
        1649116800000 => component == "fed" ? 8937142000000.0 : component == "tga" ? 579607000000.0 : component == "rrp" ? 1710834000000.0 : 6646701000000.0
        =>
            float(na)
    val

get_net_liquidity_2(simple string component = "", int ts = 0) =>
    float val = switch ts
        1649203200000 => component == "fed" ? 8937142000000.0 : component == "tga" ? 542176000000.0 : component == "rrp" ? 1731472000000.0 : 6663944000000.0
        1649289600000 => component == "fed" ? 8937592000000.0 : component == "tga" ? 545584000000.0 : component == "rrp" ? 1734424000000.0 : 6657584000000.0
        1649376000000 => component == "fed" ? 8937592000000.0 : component == "tga" ? 542946000000.0 : component == "rrp" ? 1750498000000.0 : 6644148000000.0
        1649635200000 => component == "fed" ? 8937592000000.0 : component == "tga" ? 544736000000.0 : component == "rrp" ? 1758958000000.0 : 6633898000000.0
        1649721600000 => component == "fed" ? 8937592000000.0 : component == "tga" ? 564856000000.0 : component == "rrp" ? 1710414000000.0 : 6662322000000.0
        1649808000000 => component == "fed" ? 8937592000000.0 : component == "tga" ? 545611000000.0 : component == "rrp" ? 1815555000000.0 : 6604321000000.0
        1649894400000 => component == "fed" ? 8965487000000.0 : component == "tga" ? 543536000000.0 : component == "rrp" ? 1706935000000.0 : 6715016000000.0
        1650240000000 => component == "fed" ? 8965487000000.0 : component == "tga" ? 602292000000.0 : component == "rrp" ? 1738379000000.0 : 6624816000000.0
        1650326400000 => component == "fed" ? 8965487000000.0 : component == "tga" ? 841253000000.0 : component == "rrp" ? 1817292000000.0 : 6306942000000.0
        1650412800000 => component == "fed" ? 8965487000000.0 : component == "tga" ? 893351000000.0 : component == "rrp" ? 1866560000000.0 : 6195940000000.0
        1650499200000 => component == "fed" ? 8955851000000.0 : component == "tga" ? 907526000000.0 : component == "rrp" ? 1854700000000.0 : 6193625000000.0
        1650585600000 => component == "fed" ? 8955851000000.0 : component == "tga" ? 918877000000.0 : component == "rrp" ? 1765031000000.0 : 6271943000000.0
        1650844800000 => component == "fed" ? 8955851000000.0 : component == "tga" ? 934238000000.0 : component == "rrp" ? 1783609000000.0 : 6238004000000.0
        1650931200000 => component == "fed" ? 8955851000000.0 : component == "tga" ? 958291000000.0 : component == "rrp" ? 1819343000000.0 : 6178217000000.0
        1651017600000 => component == "fed" ? 8955851000000.0 : component == "tga" ? 972993000000.0 : component == "rrp" ? 1803162000000.0 : 6163044000000.0
        1651104000000 => component == "fed" ? 8939199000000.0 : component == "tga" ? 957419000000.0 : component == "rrp" ? 1818416000000.0 : 6163364000000.0
        1651190400000 => component == "fed" ? 8939199000000.0 : component == "tga" ? 953933000000.0 : component == "rrp" ? 1906802000000.0 : 6078464000000.0
        1651449600000 => component == "fed" ? 8939199000000.0 : component == "tga" ? 923240000000.0 : component == "rrp" ? 1796302000000.0 : 6219657000000.0
        1651536000000 => component == "fed" ? 8939199000000.0 : component == "tga" ? 975018000000.0 : component == "rrp" ? 1796252000000.0 : 6167929000000.0
        1651622400000 => component == "fed" ? 8939199000000.0 : component == "tga" ? 955262000000.0 : component == "rrp" ? 1815656000000.0 : 6169054000000.0
        1651708800000 => component == "fed" ? 8939972000000.0 : component == "tga" ? 964412000000.0 : component == "rrp" ? 1844762000000.0 : 6130798000000.0
        1651795200000 => component == "fed" ? 8939972000000.0 : component == "tga" ? 943481000000.0 : component == "rrp" ? 1861866000000.0 : 6134625000000.0
        1652054400000 => component == "fed" ? 8939972000000.0 : component == "tga" ? 950700000000.0 : component == "rrp" ? 1858995000000.0 : 6130277000000.0
        1652140800000 => component == "fed" ? 8939972000000.0 : component == "tga" ? 962928000000.0 : component == "rrp" ? 1864225000000.0 : 6112819000000.0
        1652227200000 => component == "fed" ? 8939972000000.0 : component == "tga" ? 941766000000.0 : component == "rrp" ? 1876119000000.0 : 6124123000000.0
        1652313600000 => component == "fed" ? 8942008000000.0 : component == "tga" ? 919331000000.0 : component == "rrp" ? 1900069000000.0 : 6122608000000.0
        1652400000000 => component == "fed" ? 8942008000000.0 : component == "tga" ? 893803000000.0 : component == "rrp" ? 1865287000000.0 : 6182918000000.0
        1652659200000 => component == "fed" ? 8942008000000.0 : component == "tga" ? 880792000000.0 : component == "rrp" ? 1833152000000.0 : 6228064000000.0
        1652745600000 => component == "fed" ? 8942008000000.0 : component == "tga" ? 914571000000.0 : component == "rrp" ? 1877483000000.0 : 6149954000000.0
        1652832000000 => component == "fed" ? 8942008000000.0 : component == "tga" ? 891271000000.0 : component == "rrp" ? 1973373000000.0 : 6081254000000.0
        1652918400000 => component == "fed" ? 8945898000000.0 : component == "tga" ? 866726000000.0 : component == "rrp" ? 1981005000000.0 : 6098167000000.0
        1653004800000 => component == "fed" ? 8945898000000.0 : component == "tga" ? 825182000000.0 : component == "rrp" ? 1987987000000.0 : 6132729000000.0
        1653264000000 => component == "fed" ? 8945898000000.0 : component == "tga" ? 822339000000.0 : component == "rrp" ? 2044658000000.0 : 6078901000000.0
        1653350400000 => component == "fed" ? 8945898000000.0 : component == "tga" ? 838141000000.0 : component == "rrp" ? 1987865000000.0 : 6119892000000.0
        1653436800000 => component == "fed" ? 8945898000000.0 : component == "tga" ? 818688000000.0 : component == "rrp" ? 1995750000000.0 : 6099843000000.0
        1653523200000 => component == "fed" ? 8914281000000.0 : component == "tga" ? 801714000000.0 : component == "rrp" ? 2007702000000.0 : 6104865000000.0
        1653609600000 => component == "fed" ? 8914281000000.0 : component == "tga" ? 762674000000.0 : component == "rrp" ? 2006688000000.0 : 6144919000000.0
        1653955200000 => component == "fed" ? 8914281000000.0 : component == "tga" ? 782309000000.0 : component == "rrp" ? 1978538000000.0 : 6153434000000.0
        1654041600000 => component == "fed" ? 8914281000000.0 : component == "tga" ? 854240000000.0 : component == "rrp" ? 1965015000000.0 : 6095795000000.0
        1654128000000 => component == "fed" ? 8915050000000.0 : component == "tga" ? 780575000000.0 : component == "rrp" ? 1985239000000.0 : 6149236000000.0
        1654214400000 => component == "fed" ? 8915050000000.0 : component == "tga" ? 757559000000.0 : component == "rrp" ? 2031228000000.0 : 6126263000000.0
        1654473600000 => component == "fed" ? 8915050000000.0 : component == "tga" ? 731781000000.0 : component == "rrp" ? 2040093000000.0 : 6143176000000.0
        1654560000000 => component == "fed" ? 8915050000000.0 : component == "tga" ? 724554000000.0 : component == "rrp" ? 2091395000000.0 : 6099101000000.0
        1654646400000 => component == "fed" ? 8915050000000.0 : component == "tga" ? 702336000000.0 : component == "rrp" ? 2140277000000.0 : 6075641000000.0
        1654732800000 => component == "fed" ? 8918254000000.0 : component == "tga" ? 683892000000.0 : component == "rrp" ? 2142318000000.0 : 6092044000000.0
        1654819200000 => component == "fed" ? 8918254000000.0 : component == "tga" ? 631026000000.0 : component == "rrp" ? 2162885000000.0 : 6124343000000.0
        1655078400000 => component == "fed" ? 8918254000000.0 : component == "tga" ? 627393000000.0 : component == "rrp" ? 2212620000000.0 : 6078241000000.0
        1655164800000 => component == "fed" ? 8918254000000.0 : component == "tga" ? 653718000000.0 : component == "rrp" ? 2223857000000.0 : 6040679000000.0
        1655251200000 => component == "fed" ? 8918254000000.0 : component == "tga" ? 661227000000.0 : component == "rrp" ? 2162924000000.0 : 6108269000000.0
        1655337600000 => component == "fed" ? 8932420000000.0 : component == "tga" ? 769937000000.0 : component == "rrp" ? 2178382000000.0 : 5984101000000.0
        1655424000000 => component == "fed" ? 8932420000000.0 : component == "tga" ? 755888000000.0 : component == "rrp" ? 2229279000000.0 : 5947253000000.0
        1655769600000 => component == "fed" ? 8932420000000.0 : component == "tga" ? 762327000000.0 : component == "rrp" ? 2188627000000.0 : 5981466000000.0
        1655856000000 => component == "fed" ? 8932420000000.0 : component == "tga" ? 757733000000.0 : component == "rrp" ? 2259458000000.0 : 5917155000000.0
        1655942400000 => component == "fed" ? 8934346000000.0 : component == "tga" ? 745052000000.0 : component == "rrp" ? 2285442000000.0 : 5903852000000.0
        1656028800000 => component == "fed" ? 8934346000000.0 : component == "tga" ? 735139000000.0 : component == "rrp" ? 2180984000000.0 : 6018223000000.0
        1656288000000 => component == "fed" ? 8934346000000.0 : component == "tga" ? 758505000000.0 : component == "rrp" ? 2155942000000.0 : 6019899000000.0
        1656374400000 => component == "fed" ? 8934346000000.0 : component == "tga" ? 768652000000.0 : component == "rrp" ? 2213784000000.0 : 5951910000000.0
        1656460800000 => component == "fed" ? 8934346000000.0 : component == "tga" ? 757242000000.0 : component == "rrp" ? 2226976000000.0 : 5929335000000.0
        1656547200000 => component == "fed" ? 8913553000000.0 : component == "tga" ? 759845000000.0 : component == "rrp" ? 2329743000000.0 : 5823965000000.0
        1656633600000 => component == "fed" ? 8913553000000.0 : component == "tga" ? 782406000000.0 : component == "rrp" ? 2167085000000.0 : 5964062000000.0
        1656979200000 => component == "fed" ? 8913553000000.0 : component == "tga" ? 685842000000.0 : component == "rrp" ? 2138280000000.0 : 6089431000000.0
        1657065600000 => component == "fed" ? 8913553000000.0 : component == "tga" ? 689482000000.0 : component == "rrp" ? 2168026000000.0 : 6034343000000.0
        1657152000000 => component == "fed" ? 8891851000000.0 : component == "tga" ? 687943000000.0 : component == "rrp" ? 2172457000000.0 : 6031451000000.0
        1657238400000 => component == "fed" ? 8891851000000.0 : component == "tga" ? 666044000000.0 : component == "rrp" ? 2144921000000.0 : 6080886000000.0
        1657497600000 => component == "fed" ? 8891851000000.0 : component == "tga" ? 658096000000.0 : component == "rrp" ? 2164266000000.0 : 6069489000000.0
        1657584000000 => component == "fed" ? 8891851000000.0 : component == "tga" ? 665792000000.0 : component == "rrp" ? 2146132000000.0 : 6079927000000.0
        1657670400000 => component == "fed" ? 8891851000000.0 : component == "tga" ? 643141000000.0 : component == "rrp" ? 2155290000000.0 : 6097436000000.0
        1657756800000 => component == "fed" ? 8895867000000.0 : component == "tga" ? 618740000000.0 : component == "rrp" ? 2207121000000.0 : 6070006000000.0
        1657843200000 => component == "fed" ? 8895867000000.0 : component == "tga" ? 595272000000.0 : component == "rrp" ? 2153750000000.0 : 6146845000000.0
        1658102400000 => component == "fed" ? 8895867000000.0 : component == "tga" ? 606834000000.0 : component == "rrp" ? 2190375000000.0 : 6098658000000.0
        1658188800000 => component == "fed" ? 8895867000000.0 : component == "tga" ? 628659000000.0 : component == "rrp" ? 2211821000000.0 : 6055387000000.0
        1658275200000 => component == "fed" ? 8895867000000.0 : component == "tga" ? 636362000000.0 : component == "rrp" ? 2240204000000.0 : 6022647000000.0
        1658361600000 => component == "fed" ? 8899213000000.0 : component == "tga" ? 616348000000.0 : component == "rrp" ? 2271756000000.0 : 6011109000000.0
        1658448000000 => component == "fed" ? 8899213000000.0 : component == "tga" ? 594035000000.0 : component == "rrp" ? 2228959000000.0 : 6076219000000.0
        1658707200000 => component == "fed" ? 8899213000000.0 : component == "tga" ? 589322000000.0 : component == "rrp" ? 2192367000000.0 : 6117524000000.0
        1658793600000 => component == "fed" ? 8899213000000.0 : component == "tga" ? 605872000000.0 : component == "rrp" ? 2189474000000.0 : 6103867000000.0
        1658880000000 => component == "fed" ? 8899213000000.0 : component == "tga" ? 637228000000.0 : component == "rrp" ? 2188994000000.0 : 6063782000000.0
        1658966400000 => component == "fed" ? 8890004000000.0 : component == "tga" ? 615515000000.0 : component == "rrp" ? 2239883000000.0 : 6034606000000.0
        1659052800000 => component == "fed" ? 8890004000000.0 : component == "tga" ? 597017000000.0 : component == "rrp" ? 2300200000000.0 : 5992787000000.0
        1659312000000 => component == "fed" ? 8890004000000.0 : component == "tga" ? 619273000000.0 : component == "rrp" ? 2161885000000.0 : 6108846000000.0
        1659398400000 => component == "fed" ? 8890004000000.0 : component == "tga" ? 551023000000.0 : component == "rrp" ? 2156013000000.0 : 6182968000000.0
        1659484800000 => component == "fed" ? 8890004000000.0 : component == "tga" ? 586370000000.0 : component == "rrp" ? 2182238000000.0 : 6106012000000.0
        1659571200000 => component == "fed" ? 8874620000000.0 : component == "tga" ? 566577000000.0 : component == "rrp" ? 2191546000000.0 : 6116497000000.0
        1659657600000 => component == "fed" ? 8874620000000.0 : component == "tga" ? 554402000000.0 : component == "rrp" ? 2194927000000.0 : 6125291000000.0
        1659916800000 => component == "fed" ? 8874620000000.0 : component == "tga" ? 548849000000.0 : component == "rrp" ? 2195692000000.0 : 6130079000000.0
        1660003200000 => component == "fed" ? 8874620000000.0 : component == "tga" ? 555513000000.0 : component == "rrp" ? 2186568000000.0 : 6132539000000.0
        1660089600000 => component == "fed" ? 8874620000000.0 : component == "tga" ? 583255000000.0 : component == "rrp" ? 2177646000000.0 : 6118237000000.0
        1660176000000 => component == "fed" ? 8879138000000.0 : component == "tga" ? 561140000000.0 : component == "rrp" ? 2199247000000.0 : 6118751000000.0
        1660262400000 => component == "fed" ? 8879138000000.0 : component == "tga" ? 546978000000.0 : component == "rrp" ? 2213193000000.0 : 6118967000000.0
        1660521600000 => component == "fed" ? 8879138000000.0 : component == "tga" ? 548414000000.0 : component == "rrp" ? 2175857000000.0 : 6154867000000.0
        1660608000000 => component == "fed" ? 8879138000000.0 : component == "tga" ? 525921000000.0 : component == "rrp" ? 2165332000000.0 : 6187885000000.0
        1660694400000 => component == "fed" ? 8879138000000.0 : component == "tga" ? 559827000000.0 : component == "rrp" ? 2199631000000.0 : 6090304000000.0
        1660780800000 => component == "fed" ? 8849762000000.0 : component == "tga" ? 539278000000.0 : component == "rrp" ? 2218161000000.0 : 6092323000000.0
        1660867200000 => component == "fed" ? 8849762000000.0 : component == "tga" ? 530499000000.0 : component == "rrp" ? 2221680000000.0 : 6097583000000.0
        1661126400000 => component == "fed" ? 8849762000000.0 : component == "tga" ? 529281000000.0 : component == "rrp" ? 2235665000000.0 : 6084816000000.0
        1661212800000 => component == "fed" ? 8849762000000.0 : component == "tga" ? 543194000000.0 : component == "rrp" ? 2250718000000.0 : 6055850000000.0
        1661299200000 => component == "fed" ? 8849762000000.0 : component == "tga" ? 555139000000.0 : component == "rrp" ? 2237072000000.0 : 6059225000000.0
        1661385600000 => component == "fed" ? 8851436000000.0 : component == "tga" ? 530196000000.0 : component == "rrp" ? 2187907000000.0 : 6133333000000.0
        1661472000000 => component == "fed" ? 8851436000000.0 : component == "tga" ? 580033000000.0 : component == "rrp" ? 2182452000000.0 : 6088951000000.0
        1661731200000 => component == "fed" ? 8851436000000.0 : component == "tga" ? 600109000000.0 : component == "rrp" ? 2205188000000.0 : 6046139000000.0
        =>
            float(na)
    val

get_net_liquidity_3(simple string component = "", int ts = 0) =>
    float val = switch ts
        1661817600000 => component == "fed" ? 8851436000000.0 : component == "tga" ? 610399000000.0 : component == "rrp" ? 2188975000000.0 : 6052062000000.0
        1661904000000 => component == "fed" ? 8851436000000.0 : component == "tga" ? 627082000000.0 : component == "rrp" ? 2251025000000.0 : 5947986000000.0
        1661990400000 => component == "fed" ? 8826093000000.0 : component == "tga" ? 669911000000.0 : component == "rrp" ? 2173156000000.0 : 5983026000000.0
        1662076800000 => component == "fed" ? 8826093000000.0 : component == "tga" ? 598859000000.0 : component == "rrp" ? 2173413000000.0 : 6053821000000.0
        1662422400000 => component == "fed" ? 8826093000000.0 : component == "tga" ? 574423000000.0 : component == "rrp" ? 2188796000000.0 : 6062874000000.0
        1662508800000 => component == "fed" ? 8826093000000.0 : component == "tga" ? 589596000000.0 : component == "rrp" ? 2206987000000.0 : 6025818000000.0
        1662595200000 => component == "fed" ? 8822401000000.0 : component == "tga" ? 582921000000.0 : component == "rrp" ? 2210466000000.0 : 6029014000000.0
        1662681600000 => component == "fed" ? 8822401000000.0 : component == "tga" ? 581785000000.0 : component == "rrp" ? 2209714000000.0 : 6030902000000.0
        1662940800000 => component == "fed" ? 8822401000000.0 : component == "tga" ? 585000000000.0 : component == "rrp" ? 2218546000000.0 : 6018855000000.0
        1663027200000 => component == "fed" ? 8822401000000.0 : component == "tga" ? 601944000000.0 : component == "rrp" ? 2202719000000.0 : 6017738000000.0
        1663113600000 => component == "fed" ? 8822401000000.0 : component == "tga" ? 599932000000.0 : component == "rrp" ? 2225579000000.0 : 6007248000000.0
        1663200000000 => component == "fed" ? 8832759000000.0 : component == "tga" ? 617997000000.0 : component == "rrp" ? 2176188000000.0 : 6038574000000.0
        1663286400000 => component == "fed" ? 8832759000000.0 : component == "tga" ? 677452000000.0 : component == "rrp" ? 2186833000000.0 : 5968474000000.0
        1663545600000 => component == "fed" ? 8832759000000.0 : component == "tga" ? 692971000000.0 : component == "rrp" ? 2217542000000.0 : 5922246000000.0
        1663632000000 => component == "fed" ? 8832759000000.0 : component == "tga" ? 704998000000.0 : component == "rrp" ? 2238870000000.0 : 5888891000000.0
        1663718400000 => component == "fed" ? 8832759000000.0 : component == "tga" ? 695823000000.0 : component == "rrp" ? 2315900000000.0 : 5805079000000.0
        1663804800000 => component == "fed" ? 8816802000000.0 : component == "tga" ? 690286000000.0 : component == "rrp" ? 2359227000000.0 : 5767289000000.0
        1663891200000 => component == "fed" ? 8816802000000.0 : component == "tga" ? 682027000000.0 : component == "rrp" ? 2319361000000.0 : 5815414000000.0
        1664150400000 => component == "fed" ? 8816802000000.0 : component == "tga" ? 697726000000.0 : component == "rrp" ? 2299011000000.0 : 5820065000000.0
        1664236800000 => component == "fed" ? 8816802000000.0 : component == "tga" ? 705918000000.0 : component == "rrp" ? 2327111000000.0 : 5783773000000.0
        1664323200000 => component == "fed" ? 8816802000000.0 : component == "tga" ? 683943000000.0 : component == "rrp" ? 2366798000000.0 : 5744826000000.0
        1664409600000 => component == "fed" ? 8795567000000.0 : component == "tga" ? 661920000000.0 : component == "rrp" ? 2371763000000.0 : 5761884000000.0
        1664496000000 => component == "fed" ? 8795567000000.0 : component == "tga" ? 658634000000.0 : component == "rrp" ? 2425910000000.0 : 5711023000000.0
        1664755200000 => component == "fed" ? 8795567000000.0 : component == "tga" ? 635994000000.0 : component == "rrp" ? 2252523000000.0 : 5907050000000.0
        1664841600000 => component == "fed" ? 8795567000000.0 : component == "tga" ? 630975000000.0 : component == "rrp" ? 2233616000000.0 : 5930976000000.0
        1664928000000 => component == "fed" ? 8795567000000.0 : component == "tga" ? 617850000000.0 : component == "rrp" ? 2230799000000.0 : 5910404000000.0
        1665014400000 => component == "fed" ? 8759053000000.0 : component == "tga" ? 622131000000.0 : component == "rrp" ? 2232801000000.0 : 5904121000000.0
        1665100800000 => component == "fed" ? 8759053000000.0 : component == "tga" ? 612400000000.0 : component == "rrp" ? 2226950000000.0 : 5919703000000.0
        1665360000000 => component == "fed" ? 8759053000000.0 : component == "tga" ? 611855000000.0 : component == "rrp" ? 2226950000000.0 : 5920248000000.0
        1665446400000 => component == "fed" ? 8759053000000.0 : component == "tga" ? 611855000000.0 : component == "rrp" ? 2222479000000.0 : 5924719000000.0
        1665532800000 => component == "fed" ? 8759053000000.0 : component == "tga" ? 614781000000.0 : component == "rrp" ? 2247206000000.0 : 5896982000000.0
        1665619200000 => component == "fed" ? 8758969000000.0 : component == "tga" ? 583513000000.0 : component == "rrp" ? 2244100000000.0 : 5931356000000.0
        1665705600000 => component == "fed" ? 8758969000000.0 : component == "tga" ? 578283000000.0 : component == "rrp" ? 2222052000000.0 : 5958634000000.0
        1665964800000 => component == "fed" ? 8758969000000.0 : component == "tga" ? 574982000000.0 : component == "rrp" ? 2172301000000.0 : 6011686000000.0
        1666051200000 => component == "fed" ? 8758969000000.0 : component == "tga" ? 651318000000.0 : component == "rrp" ? 2226725000000.0 : 5880926000000.0
        1666137600000 => component == "fed" ? 8758969000000.0 : component == "tga" ? 655230000000.0 : component == "rrp" ? 2241835000000.0 : 5846857000000.0
        1666224000000 => component == "fed" ? 8743922000000.0 : component == "tga" ? 640613000000.0 : component == "rrp" ? 2234071000000.0 : 5869238000000.0
        1666310400000 => component == "fed" ? 8743922000000.0 : component == "tga" ? 635492000000.0 : component == "rrp" ? 2265809000000.0 : 5842621000000.0
        1666569600000 => component == "fed" ? 8743922000000.0 : component == "tga" ? 624584000000.0 : component == "rrp" ? 2242044000000.0 : 5877294000000.0
        1666656000000 => component == "fed" ? 8743922000000.0 : component == "tga" ? 636785000000.0 : component == "rrp" ? 2195616000000.0 : 5911521000000.0
        1666742400000 => component == "fed" ? 8743922000000.0 : component == "tga" ? 659483000000.0 : component == "rrp" ? 2186856000000.0 : 5876751000000.0
        1666828800000 => component == "fed" ? 8723090000000.0 : component == "tga" ? 636327000000.0 : component == "rrp" ? 2152485000000.0 : 5934278000000.0
        1666915200000 => component == "fed" ? 8723090000000.0 : component == "tga" ? 625362000000.0 : component == "rrp" ? 2183290000000.0 : 5914438000000.0
        1667174400000 => component == "fed" ? 8723090000000.0 : component == "tga" ? 621627000000.0 : component == "rrp" ? 2275459000000.0 : 5826004000000.0
        1667260800000 => component == "fed" ? 8723090000000.0 : component == "tga" ? 596470000000.0 : component == "rrp" ? 2200510000000.0 : 5926110000000.0
        1667347200000 => component == "fed" ? 8723090000000.0 : component == "tga" ? 551009000000.0 : component == "rrp" ? 2229861000000.0 : 5896000000000.0
        1667433600000 => component == "fed" ? 8676870000000.0 : component == "tga" ? 552089000000.0 : component == "rrp" ? 2219791000000.0 : 5904990000000.0
        1667520000000 => component == "fed" ? 8676870000000.0 : component == "tga" ? 524883000000.0 : component == "rrp" ? 2230840000000.0 : 5921147000000.0
        1667779200000 => component == "fed" ? 8676870000000.0 : component == "tga" ? 524694000000.0 : component == "rrp" ? 2241317000000.0 : 5910859000000.0
        1667865600000 => component == "fed" ? 8676870000000.0 : component == "tga" ? 530764000000.0 : component == "rrp" ? 2232555000000.0 : 5913551000000.0
        1667952000000 => component == "fed" ? 8676870000000.0 : component == "tga" ? 545285000000.0 : component == "rrp" ? 2237812000000.0 : 5895789000000.0
        1668038400000 => component == "fed" ? 8678886000000.0 : component == "tga" ? 517340000000.0 : component == "rrp" ? 2200586000000.0 : 5960960000000.0
        1668124800000 => component == "fed" ? 8678886000000.0 : component == "tga" ? 510550000000.0 : component == "rrp" ? 2200586000000.0 : 5967750000000.0
        1668384000000 => component == "fed" ? 8678886000000.0 : component == "tga" ? 510550000000.0 : component == "rrp" ? 2165018000000.0 : 6003318000000.0
        1668470400000 => component == "fed" ? 8678886000000.0 : component == "tga" ? 524136000000.0 : component == "rrp" ? 2086574000000.0 : 6068176000000.0
        1668556800000 => component == "fed" ? 8678886000000.0 : component == "tga" ? 482354000000.0 : component == "rrp" ? 2099070000000.0 : 6044196000000.0
        1668643200000 => component == "fed" ? 8625620000000.0 : component == "tga" ? 472185000000.0 : component == "rrp" ? 2114439000000.0 : 6038996000000.0
        1668729600000 => component == "fed" ? 8625620000000.0 : component == "tga" ? 465368000000.0 : component == "rrp" ? 2113413000000.0 : 6046839000000.0
        1668988800000 => component == "fed" ? 8625620000000.0 : component == "tga" ? 469610000000.0 : component == "rrp" ? 2125426000000.0 : 6030584000000.0
        1669075200000 => component == "fed" ? 8625620000000.0 : component == "tga" ? 476764000000.0 : component == "rrp" ? 2103932000000.0 : 6044924000000.0
        1669161600000 => component == "fed" ? 8625620000000.0 : component == "tga" ? 512602000000.0 : component == "rrp" ? 2069174000000.0 : 6039614000000.0
        1669334400000 => component == "fed" ? 8621390000000.0 : component == "tga" ? 492754000000.0 : component == "rrp" ? 2031066000000.0 : 6097570000000.0
        1669593600000 => component == "fed" ? 8621390000000.0 : component == "tga" ? 510532000000.0 : component == "rrp" ? 2054914000000.0 : 6055944000000.0
        1669680000000 => component == "fed" ? 8621390000000.0 : component == "tga" ? 517125000000.0 : component == "rrp" ? 2064377000000.0 : 6039888000000.0
        1669766400000 => component == "fed" ? 8621390000000.0 : component == "tga" ? 506052000000.0 : component == "rrp" ? 2115913000000.0 : 5962611000000.0
        1669852800000 => component == "fed" ? 8584576000000.0 : component == "tga" ? 532791000000.0 : component == "rrp" ? 2050286000000.0 : 6001499000000.0
        1669939200000 => component == "fed" ? 8584576000000.0 : component == "tga" ? 458408000000.0 : component == "rrp" ? 2049763000000.0 : 6076405000000.0
        1670198400000 => component == "fed" ? 8584576000000.0 : component == "tga" ? 434939000000.0 : component == "rrp" ? 2093647000000.0 : 6055990000000.0
        1670284800000 => component == "fed" ? 8584576000000.0 : component == "tga" ? 440836000000.0 : component == "rrp" ? 2111465000000.0 : 6032275000000.0
        1670371200000 => component == "fed" ? 8584576000000.0 : component == "tga" ? 411431000000.0 : component == "rrp" ? 2151549000000.0 : 6019755000000.0
        1670457600000 => component == "fed" ? 8582735000000.0 : component == "tga" ? 410853000000.0 : component == "rrp" ? 2175973000000.0 : 5995909000000.0
        1670544000000 => component == "fed" ? 8582735000000.0 : component == "tga" ? 358794000000.0 : component == "rrp" ? 2146748000000.0 : 6077193000000.0
        1670803200000 => component == "fed" ? 8582735000000.0 : component == "tga" ? 357709000000.0 : component == "rrp" ? 2158517000000.0 : 6066509000000.0
        1670889600000 => component == "fed" ? 8582735000000.0 : component == "tga" ? 370897000000.0 : component == "rrp" ? 2180676000000.0 : 6031162000000.0
        1670976000000 => component == "fed" ? 8582735000000.0 : component == "tga" ? 343699000000.0 : component == "rrp" ? 2192864000000.0 : 6046850000000.0
        1671062400000 => component == "fed" ? 8583413000000.0 : component == "tga" ? 342104000000.0 : component == "rrp" ? 2123995000000.0 : 6117314000000.0
        1671148800000 => component == "fed" ? 8583413000000.0 : component == "tga" ? 448106000000.0 : component == "rrp" ? 2126540000000.0 : 6008767000000.0
        1671408000000 => component == "fed" ? 8583413000000.0 : component == "tga" ? 467544000000.0 : component == "rrp" ? 2134765000000.0 : 5981104000000.0
        1671494400000 => component == "fed" ? 8583413000000.0 : component == "tga" ? 482388000000.0 : component == "rrp" ? 2159408000000.0 : 5941617000000.0
        1671580800000 => component == "fed" ? 8583413000000.0 : component == "tga" ? 450413000000.0 : component == "rrp" ? 2206965000000.0 : 5907033000000.0
        1671667200000 => component == "fed" ? 8564411000000.0 : component == "tga" ? 434922000000.0 : component == "rrp" ? 2222898000000.0 : 5906591000000.0
        1671753600000 => component == "fed" ? 8564411000000.0 : component == "tga" ? 429684000000.0 : component == "rrp" ? 2216348000000.0 : 5918379000000.0
        1672099200000 => component == "fed" ? 8564411000000.0 : component == "tga" ? 431253000000.0 : component == "rrp" ? 2221259000000.0 : 5911899000000.0
        1672185600000 => component == "fed" ? 8564411000000.0 : component == "tga" ? 430977000000.0 : component == "rrp" ? 2293003000000.0 : 5827189000000.0
        1672272000000 => component == "fed" ? 8551169000000.0 : component == "tga" ? 409809000000.0 : component == "rrp" ? 2308319000000.0 : 5833041000000.0
        1672358400000 => component == "fed" ? 8551169000000.0 : component == "tga" ? 412900000000.0 : component == "rrp" ? 2553716000000.0 : 5584553000000.0
        1672704000000 => component == "fed" ? 8551169000000.0 : component == "tga" ? 446685000000.0 : component == "rrp" ? 2188272000000.0 : 5916212000000.0
        1672790400000 => component == "fed" ? 8551169000000.0 : component == "tga" ? 386114000000.0 : component == "rrp" ? 2229542000000.0 : 5891773000000.0
        1672876800000 => component == "fed" ? 8507429000000.0 : component == "tga" ? 379620000000.0 : component == "rrp" ? 2242486000000.0 : 5885323000000.0
        1672963200000 => component == "fed" ? 8507429000000.0 : component == "tga" ? 379653000000.0 : component == "rrp" ? 2208265000000.0 : 5919511000000.0
        1673222400000 => component == "fed" ? 8507429000000.0 : component == "tga" ? 375694000000.0 : component == "rrp" ? 2199121000000.0 : 5932614000000.0
        1673308800000 => component == "fed" ? 8507429000000.0 : component == "tga" ? 385220000000.0 : component == "rrp" ? 2192942000000.0 : 5929267000000.0
        1673395200000 => component == "fed" ? 8507429000000.0 : component == "tga" ? 368000000000.0 : component == "rrp" ? 2199170000000.0 : 5941417000000.0
        1673481600000 => component == "fed" ? 8508587000000.0 : component == "tga" ? 346426000000.0 : component == "rrp" ? 2202989000000.0 : 5959172000000.0
        1673568000000 => component == "fed" ? 8508587000000.0 : component == "tga" ? 310363000000.0 : component == "rrp" ? 2179781000000.0 : 6018443000000.0
        1673913600000 => component == "fed" ? 8508587000000.0 : component == "tga" ? 321572000000.0 : component == "rrp" ? 2093328000000.0 : 6093687000000.0
        1674000000000 => component == "fed" ? 8508587000000.0 : component == "tga" ? 398974000000.0 : component == "rrp" ? 2131678000000.0 : 5958387000000.0
        1674086400000 => component == "fed" ? 8489039000000.0 : component == "tga" ? 377500000000.0 : component == "rrp" ? 2110145000000.0 : 6001394000000.0
        1674172800000 => component == "fed" ? 8489039000000.0 : component == "tga" ? 455623000000.0 : component == "rrp" ? 2090523000000.0 : 5942893000000.0
        1674432000000 => component == "fed" ? 8489039000000.0 : component == "tga" ? 454615000000.0 : component == "rrp" ? 2135499000000.0 : 5898925000000.0
        =>
            float(na)
    val


// @function Gets the Net Liquidity time series for the last 250 trading days. Dates that are not present are represented as na.
// @param component The component of the Net Liquidity function to return. Possible values: 'fed', 'tga', and 'rrp'. (`Net Liquidity` is returned if no argument is supplied).
// @returns The Net Liquidity time series or a component of the Net Liquidity function.
export get_net_liquidity(simple string component = "") =>
    ts = timestamp("UTC-0", year, month, dayofmonth, 0, 0, 0)

    float val = if ts >= 1624320000000 and ts <= 1636502400000
        get_net_liquidity_0(component, ts)
    else if ts >= 1636588800000 and ts <= 1649116800000
        get_net_liquidity_1(component, ts)
    else if ts >= 1649203200000 and ts <= 1661731200000
        get_net_liquidity_2(component, ts)
    else if ts >= 1661817600000 and ts <= 1674432000000
        get_net_liquidity_3(component, ts)
    else
        float(na)

    val

