[암호화폐] 그것이 알고 싶다!! 스팀피가 왜 입금이 되었을까?

avatar
(Edited)

거래소에 토큰 매도 주문을 낸 후에 거래가 성사되면 본인 계정으로 steemp가 입금이 됩니다. 그런데 어떤 토큰이 얼마에 몇 개가 팔렸는지는 확인을 하려면 별도의 절차가 필요합니다.

이전에는 아래 사이트에서 확인이 가능하였었는데, 요즘은 접속이 잘 안됩니다.
https://steem-engine.rocks

그래서 준비했습니다. 이름하여 "steemp를 준 천사는 누구?" 입니다.


개발한 파이썬 소스는 아래 사이트에서 실행이 가능합니다. who에 원하는 계정을 넣고 위에 있는 "run"을 누르시면 최근 20개 매도 내역을 보실 수 있습니다.
https://repl.it/@zonemultiwhs/steempangel

키체인에서 본 내역과 같은 수량이 나오는 것을 확인할 수 있습니다.


매도된 토큰의 정보를 구하는 과정을 설명합니다.

특정 계정의 특정 토큰에 대한 거래 내역은 아래 함수를 이용하면 얻을 수 있습니다.

rest = api.get_history(who, symbol)

steem-engine에는 매수한 사람 기준으로 트랜잭션이 기록됩니다. 이때 매수 수량에 맞추어 여러 명의 매도 주문이 아래와 같이 함께 기록되어 있습니다.

자료를 자세히 보면 본인이 매도 주문낸 토큰의 정보는 위에 있고, 그 다음에 받을 steemp에 대한 정보가 기록되어 있습니다. 이런 자료를 기반으로 본인에 해당하는 정보를 찾아서 출력해 주는 방법입니다.

    pre_event = {}
    for event in log['events'] :
        if ( event['data']['to'] == me ) :
            # sold token is listed on the previous event
            token_quantity = float(pre_event['data']['quantity'])
            steemp_quantity = float(event['data']['quantity'])

            price = steemp_quantity / token_quantity
            symbol = tr_info ['symbol']
            print("[",format(symbol,"6s"),"]",  format(price,"-10.4f"), format(token_quantity,"-10,.2f"), format(steemp_quantity,"-10,.4f") )
            return steemp_quantity
        pre_event = event

추가로 본인이 거래소에 주문을 낸 것과 steemp로 전환한 것도 이 조건문을 만족합니다. 따라서 이런 경우는 무시합니다.

    if (tx['contract'] == 'steempegged' or tx['sender'] == me) : # steemp 변환 or my order
        return 0

이런 거래 정보는 거래소에서 제공해주어야 할 기본적인 정보라고 생각합니다. 스팀엔진의 성능 개선을 기대해 봅니다.



0
0
0.000
3 comments
avatar

jcar토큰,
8월 구독 보팅입니다.
행복한 8월 되세요. ^^

0
0
0.000
avatar

Thank you for your continued support towards JJM. For each 1000 JJM you are holding, you can get an additional 1% of upvote. 10,000JJM would give you a 11% daily voting from the 700K SP virus707 account.

0
0
0.000
avatar

Hi @tradingideas!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 4.431 which ranks you at #2313 across all Steem accounts.
Your rank has improved 246 places in the last three days (old rank 2559).

In our last Algorithmic Curation Round, consisting of 205 contributions, your post is ranked at #108.

Evaluation of your UA score:
  • Some people are already following you, keep going!
  • The readers like your work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

0
0
0.000