{"action":"created","issue":{"url":"https://api.github.com/repos/OmniLayer/omnicore/issues/359","repository_url":"https://api.github.com/repos/OmniLayer/omnicore","labels_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/359/labels{/name}","comments_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/359/comments","events_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/359/events","html_url":"https://github.com/OmniLayer/omnicore/pull/359","id":147937888,"number":359,"title":"Add A Fee Caching/Distribution System","user":{"login":"zathras-crypto","id":5633351,"avatar_url":"https://avatars.githubusercontent.com/u/5633351?v=3","gravatar_id":"","url":"https://api.github.com/users/zathras-crypto","html_url":"https://github.com/zathras-crypto","followers_url":"https://api.github.com/users/zathras-crypto/followers","following_url":"https://api.github.com/users/zathras-crypto/following{/other_user}","gists_url":"https://api.github.com/users/zathras-crypto/gists{/gist_id}","starred_url":"https://api.github.com/users/zathras-crypto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zathras-crypto/subscriptions","organizations_url":"https://api.github.com/users/zathras-crypto/orgs","repos_url":"https://api.github.com/users/zathras-crypto/repos","events_url":"https://api.github.com/users/zathras-crypto/events{/privacy}","received_events_url":"https://api.github.com/users/zathras-crypto/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OmniLayer/omnicore/labels/consensus","name":"consensus","color":"e11d21"},{"url":"https://api.github.com/repos/OmniLayer/omnicore/labels/status:%20in%20progress","name":"status: in progress","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/OmniLayer/omnicore/milestones/2","html_url":"https://github.com/OmniLayer/omnicore/milestones/0.0.10.1","labels_url":"https://api.github.com/repos/OmniLayer/omnicore/milestones/2/labels","id":1464009,"number":2,"title":"0.0.10.1","description":"Issues that need to be solved for release of v0.0.10.1.","creator":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":38,"state":"open","created_at":"2015-12-16T22:12:47Z","updated_at":"2016-05-21T14:06:24Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2016-04-13T03:37:36Z","updated_at":"2016-05-22T02:32:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OmniLayer/omnicore/pulls/359","html_url":"https://github.com/OmniLayer/omnicore/pull/359","diff_url":"https://github.com/OmniLayer/omnicore/pull/359.diff","patch_url":"https://github.com/OmniLayer/omnicore/pull/359.patch"},"body":"This PR serves to add the concept of fees to the Omni Layer.  \r\n\r\nThe main additions are:\r\n* A fee caching system to enable an accumulation of fees within the protocol but not held by any address until such time as a distribution is triggered\r\n* A fee distribution system to distribute the contents of a fee cache proportionally amongst all holders of the Omni token\r\n* A fee history system to enable data retrieval about completed fee distributions\r\n\r\nThe main consensus affecting changes are:\r\n* Code to slice 0.05% of trades of non-Omni pairs and move the tokens to the fee cache\r\n* Code to trigger fee distribution once the fee cache reaches 0.001% of the total tokens for that property (arbitrary value, we can change with ```OMNICORE_FEE_THRESHOLD``` in ```rules.h```)\r\n\r\nThe testing is done via a regtest script (```test/test_fees.sh```) however this requires disabling Dev Omni and recompiling to run the tests.  I was hoping the testing guys (@msgilligan @dexX7) might be able to advise on converting to the boost unit test framework instead.\r\n\r\n**Please note:  this is not yet ready for merging, there are still a few TODOs left including setting this up for activation, it's primarily to start the review process**\r\n\r\nThe RPC calls made available with this PR are as follows:\r\n\r\n**omni_getfeeshare**\r\nUse this call to query what percentage of fees a particular address will receive at that time.  Supply an address parameter to query any address, or do not supply parameters to query the wallet.\r\n```\r\nomni_getfeeshare [ address ]\r\n\r\nReturns the percentage share of fees distribution applied to the wallet (default) or address (if supplied).\r\n\r\nArguments:\r\n1. address              (string, optional) retrieve the fee share for the supplied address\r\n\r\nResult:\r\n[                       (array of JSON objects)\r\n  {\r\n    \"propertyid\" : nnnnnnn,        (number) the property id\r\n    \"cachedfees\" : \"n.nnnnnnnn\",   (string) the amount of fees cached for this property\r\n  },\r\n  ...\r\n]\r\n```\r\n\r\n**omni_getfeecache**\r\nUse this call to determine the current value of the fee cache.  Without parameters it will display all properties with non-zero fee caches.  Supply a property ID to display the fee cache for a specific property.\r\n\r\n```\r\nomni_getfeecache [ propertyid ]\r\n\r\nReturns the amount of fees cached for distribution.\r\n\r\nArguments:\r\n1. propertyid           (number, optional) filter the results on this property id\r\n\r\nResult:\r\n[                       (array of JSON objects)\r\n  {\r\n    \"propertyid\" : nnnnnnn,        (number) the property id\r\n    \"cachedfees\" : \"n.nnnnnnnn\",   (string) the amount of fees cached for this property\r\n  },\r\n...\r\n]\r\n```\r\n\r\n**omni_getfeetrigger**\r\nUse this call to query at what value the fee cache will trigger distribution for a given property.  Supply a property ID to filter on a specific ID.\r\n\r\n```\r\nomni_getfeetrigger [ propertyid ]\r\n\r\nReturns the amount of fees required in the cache to trigger distribution.\r\n\r\nArguments:\r\n1. propertyid           (number, optional) filter the results on this property id\r\n\r\nResult:\r\n[                       (array of JSON objects)\r\n  {\r\n    \"propertyid\" : nnnnnnn,        (number) the property id\r\n    \"feetrigger\" : \"n.nnnnnnnn\",   (string) the amount of fees required to trigger distribution\r\n  },\r\n  ...\r\n]\r\n```\r\n\r\n**omni_getfeedistribution**\r\nUse this call to obtain specifics about a particular fee distribution.  Supply the fee distribution ID as parameter (note: each time a fee distribution is triggered, it is given a unique ID).\r\n\r\n```\r\nomni_getfeedistribution distributionid\r\n\r\nGet the details for a fee distribution.\r\n\r\nArguments:\r\n1. distributionid           (number, required) the distribution to obtain details for\r\n\r\nResult:\r\n{\r\n  \"distributionid\" : n,          (number) the distribution id\r\n  \"propertyid\" : n,              (number) the property id of the distributed tokens\r\n  \"block\" : n,                   (number) the block the distribution occurred\r\n  \"amount\" : \"n.nnnnnnnn\",       (string) the amount that was distributed\r\n  \"recipients\": [                (array of JSON objects) a list of recipients\r\n    {\r\n      \"address\" : \"address\",          (string) the address of the recipient\r\n      \"amount\" : \"n.nnnnnnnn\"         (string) the amount of fees received by the recipient\r\n    },\r\n    ...\r\n  ]\r\n}\r\n```\r\n\r\n**omni_getfeedistributions**\r\nUse this call to list all the fee distributions that have been executed for a given property.\r\n```\r\nomni_getfeedistributions propertyid\r\n\r\nGet the details of all fee distributions for a property.\r\n\r\nArguments:\r\n1. propertyid           (number, required) the property id to retrieve distributions for\r\n\r\nResult:\r\n[                       (array of JSON objects)\r\n  {\r\n    \"distributionid\" : n,          (number) the distribution id\r\n    \"propertyid\" : n,              (number) the property id of the distributed tokens\r\n    \"block\" : n,                   (number) the block the distribution occurred\r\n    \"amount\" : \"n.nnnnnnnn\",       (string) the amount that was distributed\r\n    \"recipients\": [                (array of JSON objects) a list of recipients\r\n      {\r\n        \"address\" : \"address\",          (string) the address of the recipient\r\n        \"amount\" : \"n.nnnnnnnn\"         (string) the amount of fees received by the recipient\r\n      },\r\n      ...\r\n    ]\r\n  },\r\n  ...\r\n]\r\n ```"},"comment":{"url":"https://api.github.com/repos/OmniLayer/omnicore/issues/comments/220810931","html_url":"https://github.com/OmniLayer/omnicore/pull/359#issuecomment-220810931","issue_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/359","id":220810931,"user":{"login":"zathras-crypto","id":5633351,"avatar_url":"https://avatars.githubusercontent.com/u/5633351?v=3","gravatar_id":"","url":"https://api.github.com/users/zathras-crypto","html_url":"https://github.com/zathras-crypto","followers_url":"https://api.github.com/users/zathras-crypto/followers","following_url":"https://api.github.com/users/zathras-crypto/following{/other_user}","gists_url":"https://api.github.com/users/zathras-crypto/gists{/gist_id}","starred_url":"https://api.github.com/users/zathras-crypto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zathras-crypto/subscriptions","organizations_url":"https://api.github.com/users/zathras-crypto/orgs","repos_url":"https://api.github.com/users/zathras-crypto/repos","events_url":"https://api.github.com/users/zathras-crypto/events{/privacy}","received_events_url":"https://api.github.com/users/zathras-crypto/received_events","type":"User","site_admin":false},"created_at":"2016-05-22T02:32:12Z","updated_at":"2016-05-22T02:32:12Z","body":"> Currently fees are distributed to Omni holders, whether it's main or test tokens. I think it would be better, if both systems are seperated, and Test Omni holders receive test tokens, and actual Omni holders only receive main ecosystem tokens. What do you think?\r\n\r\nAgreed, good suggestion dude - I've made the amendments here https://github.com/OmniLayer/omnicore/pull/359/commits/5abe8571a7941debd2bb7ba2960af47befd04d78"}}
{"actor":{"display_login":"zathras-crypto"}}