Skip to content

Instantly share code, notes, and snippets.

Avatar

hmatejx hmatejx

View GitHub Profile
@hmatejx
hmatejx / get_inter_exchange_payments.sql
Created Feb 17, 2019
xRapid - get inter-exchange payments
View get_inter_exchange_payments.sql
WITH
Ledgers AS (
SELECT LedgerIndex, CloseTime, CloseTimeTimestamp
FROM xrpledgerdata.fullhistory.ledgers
),
Transactions AS (
SELECT Account, Destination, SourceTag, DestinationTag, Fee, TransactionType, AmountXRP / 1000000 as Amount, LedgerIndex, TransactionResult,
CASE
WHEN Account IN ("rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1", "rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX", "rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv", "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", " rUobSiUpYH2S97Mgb4E7b7HuzQj2uzZ3aD") THEN "Bitstamp"
WHEN Account IN ("rPVMhWBsfF9iMXYj3aAzJVkPDTFNSyWdKy", "rE3sV9KSWeSiaAapsZGcSDfiFRSshK8Bqj") THEN "Bittrex"
@hmatejx
hmatejx / process_inter_exchange_payments.sql
Last active Feb 17, 2019
xRapid - process inter-exchange payments
View process_inter_exchange_payments.sql
WITH step1 AS (
SELECT
CloseTime AS Time, CloseTimeTimestamp AS Timestamp, LedgerIndex, Account, Destination, SourceTag, DestinationTag, Fee, Amount,
CONCAT(xSource, "->", xDestination) AS xLeg, xSource, xDestination
FROM xRapid.InterExchange),
step2 AS (
SELECT
Time, Timestamp, LedgerIndex, Account, Destination, SourceTag, DestinationTag, Fee, Amount, xLeg, xSource, xDestination,
LEAD(Amount, 1, 0) OVER (PARTITION BY xLeg, DestinationTag ORDER BY LedgerIndex DESC) AS leadAmount,
LEAD(Timestamp, 1, 0) OVER (PARTITION BY xLeg, DestinationTag ORDER BY LedgerIndex DESC) AS leadTimestamp,
@hmatejx
hmatejx / xRapid_exchange_addresses.txt
Last active Feb 17, 2019
xRapid partner exchange addresses
View xRapid_exchange_addresses.txt
Bitstamp: rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1, rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX, rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv, rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B, rUobSiUpYH2S97Mgb4E7b7HuzQj2uzZ3aD
Bittrex: rPVMhWBsfF9iMXYj3aAzJVkPDTFNSyWdKy, rE3sV9KSWeSiaAapsZGcSDfiFRSshK8Bqj
Bitso: rG6FZ31hDHN1K5Dkbma3PSB5uVCuVVRzfn, rHZaDC6tsGN2JWGeXhjKL6664RNCq5hu4B, raXLsnnJVaLMDixEoXHXe56WQXKczbD8ub, rGfGdVYLDSbji5mqfMvdpx4c8JyyfqVFgf, rfEu1Wnr7LxStoFx8DBdzgr8M16FBUbH3K, rLSn6Z3T8uCxbcd1oxwfGQN1Fdn5CyGujK
Coins.ph: rU2mEJSLqBRkYLVTv55rFTgQajkLTnT6mA
View keybase.md

Keybase proof

I hereby claim:

  • I am hmatejx on github.
  • I am hmatejx (https://keybase.io/hmatejx) on keybase.
  • I have a public key ASDB6OK7bnkPenG7Zq30JV4aJFOIDDQPkYZriMacP7KNIwo

To claim this, I am signing this object:

You can’t perform that action at this time.