BlockPo / BlockPo-to-Tradelayer

Incubation Repo for the TradeLayer protocol, 0.2.0
http://www.tradelayer.org
Other
8 stars 8 forks source link

Funding History RPC #128

Open patrickdugan opened 4 years ago

patrickdugan commented 4 years ago

Get funding history for contract id n between blocks X and Y.

Returns a JSON like this:

{ contractid: n collateralid: 2 results: [ {block: z, rate: 0.00012}, {block:z+24, rate: -0.0023} ...] }

patrickdugan commented 1 year ago

This is still true

patrickdugan commented 1 year ago

GetContractFundingHistory should go back to the beginning of the contract but that's a lot of hour periods... the neat thing to do would be to have a startBlock parameter and just return 500 periods by default.

GetAddressFundingHistory should give this but for all the funding payments to the address.

Since this is non-consensus changing and it helps people do taxes with LevelDB serving as tracker, we can ship without these but golly we could really use them sometime in the first quarter or second quarter at least (testing derivatives perp funding). We can also squint and test funding based on incremental token balance changes.