Propagate the liquidity identifier through the network

Issue #154 resolved
Michael Witrant
created an issue

And display the breakdown per identifier in getliquidityinfo.

It may need to be included in a mandatory upgrade.

Comments (7)

  1. Michael Witrant reporter

    Implementation details have been discussed here: https://bitbucket.org/JordanLeePeershares/nubottrading/issue/173/tier-liquidity-details-in-the-nu-client

    The syntax of liquidityinfo will not be changed as it already includes the identifier:

    liquidityinfo <currency> <buyamount> <sellamount> <grantaddress> [<indentifier>]
    

    The identifier can be any string and is an empty string by default. It is propagated as is through the network. Probably limited in size (255 bytes for example) and in the character set (printable ASCII for example).

    The client currently stores one liquidity info per custodian. After the change the client will store one liquidity info per custodian and identifier pair.

    The identifiers will have this syntax (although it's not enforced by the protocol): tier:pair:exchange:sessionid. The list of codes used by NuBot is available here: https://bitbucket.org/JordanLeePeershares/nubottrading/src/333dfc5b9105456678bf188a5dc810a5c27dbd35/NuBot/res/exchanges.json?at=feature/179_exchangefile

    getliquidityinfo will report the identifiers of each custodian address. And the total section will be removed. For example:

    {
      "B5VFcW5FKpyrPMKCQxApcmpnikfMP8sMZy": {
        "1:NBT_BTC:btce:2_BTCNBT_ccedk_0.1.5|1424193501841|788606": {
          "buy": 0.0,
          "sell": 0.0
        },
        "1:NBT_PPC:btce:2_BTCPPC_ccedk_0.1.5|1424193501841|788606": {
          "buy": 0.0,
          "sell": 0.0
        }
      },
      "B5viA2YWcoLBvT8TWJywasQyAT9xkwhmWc": {
        "": {
          "buy": 2023.8632,
          "sell": 11724.5173
        }
      }
    }
    

    A new RPC getliquiditysummary will be added to get interpreted and summarized liquidity info.

    It will try to interpret the tier field and give a breakdown for each tier. The identifier will have to match the regexp ^[0-9]+:. Otherwise the liquidity info won't be listed in any tier.

    Example result:

    {
      "total": {
        "buy": 2023.8632,
        "sell": 11724.5173
      },
      "tier": {
        "1": {
          "buy": 2023.8632,
          "sell": 11724.5173
        },
        "2": {
          "buy": 2023.8632,
          "sell": 11724.5173
        },
      }
    }
    
  2. Log in to comment