DEX API

XCADDEX-API

API server for XCAD DEX

The web service exposes these endpoints. You can find the sample data for each endpoint here

Where the result consists of multiple pages ( i.e. where total_pages > 1) use query parameter ?page=n where n = page number e.g. 2

Base Endpoint - /

Returns a string to indicate that the webservice is running Hello xcaddex!

https://rewards-api.xcadnetwork.com/

Get Liquidity - /liquidity

Get the liquidity for all pools at the given timestamp.

https://rewards-api.xcadnetwork.com/liquidity

Parameter
Description

address

The address of the initiator, Bech32 format - Filter by user address

timestamp

The End time, Unix time format (retrieve data from pool begining til this time ) - Filter by time range

Examples

Filter
Example Url

address

http://localhost:3010/liquidity?address=zil144x80aulkm468jxul3twhu2zzfzcjql6suhma5

https://rewards-api.xcadnetwork.com/liquidity?address=zil19e24266mg4pmxzvm24v92c53lfd4kd4cadc6xl

https://rewards-api.xcadnetwork.com/liquidity?address=zil1dmqtvyp3paq08m466mecuya650xhxh3jx3mmyf

time range

http://localhost:3010/liquidity?timestamp=1645142739

https://rewards-api.xcadnetwork.com/liquidity?timestamp=1645142739

Sample Data

Field
Description

pool - XCAD pools

The pool identifier, XCADTokenHash,TokenHash Hex format

pool - Zil pools

The pool identifier, TokenAddress Bech32 format

amount - XCAD Pools

When the pool field contains the XCAD pool identifier this amount is the XCAD amount

amount - Zil Pools

When the pool field contains the Zil pool identifier this amount is the ZIL amount

[
  {
    "pool": "0x153feaddc48871108e286de3304b9597c817b456,0x91228a48aea4e4071b9c6444eb08b021399cff7c",
    "amount": "22772695572179927245436"
  },
  {
    "pool": "0x153feaddc48871108e286de3304b9597c817b456,0x327082dd216ff625748b13e156b9d1a5d3dd41f2",
    "amount": "1220992482759708519932875"
  },
  {
    "pool": "zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y",
    "amount": "9138376730335223996"
  },
  {
    "pool": "zil1xfcg9hfpdlmz2aytz0s4dww35hfa6s0jnjut5f",
    "amount": "2264421000345648490"
  },  
]

Get Weighted Liquidity - /weighted_liquidity

Get the liquidity for all pools in between the given timestamps weighted by duration.

https://rewards-api.xcadnetwork.com/weighted_liquidity

Parameter
Description

address

The address of the initiator, Bech32 format - Filter by user address

from

Start time, Unix time format ( default for until is now) - Filter by time range

until

End time, Unix time format ( if not specify it means now) - Filter by time range

Examples

Filter
Example Url

address

http://localhost:3010/weighted_liquidity?address=zil144x80aulkm468jxul3twhu2zzfzcjql6suhma5

https://rewards-api.xcadnetwork.com/weighted_liquidity?address=zil19e24266mg4pmxzvm24v92c53lfd4kd4cadc6xl

https://rewards-api.xcadnetwork.com/weighted_liquidity?address=zil1dmqtvyp3paq08m466mecuya650xhxh3jx3mmyf

time range

http://localhost:3010/weighted_liquidity?from=1645142739

https://rewards-api.xcadnetwork.com/weighted_liquidity?from=1645142739

https://rewards-api.xcadnetwork.com/weighted_liquidity?from=1645142739&until=1645229139

Sample Data

Field
Description

pool - XCAD pools

The pool identifier, XCADTokenHash,TokenHash Hex format

pool - Zil pools

The pool identifier, TokenAddress Bech32 format

amount - XCAD Pools

When the pool field contains the XCAD pool identifier this amount is the XCAD amount

amount - Zil Pools

When the pool field contains the Zil pool identifier this amount is the ZIL amount

[
  {
    "pool": "zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y",
    "amount": "2995321957559000000000"
  },
  {
    "pool": "0x153feaddc48871108e286de3304b9597c817b456,0x32339fa037f7ae1dfff25e13c6451a80289d61f4",
    "amount": "92733531811541300000000000"
  },
  {
    "pool": "0x153feaddc48871108e286de3304b9597c817b456,0x327082dd216ff625748b13e156b9d1a5d3dd41f2",
    "amount": "1131323861937060000000000000"
  },
]

Get Liquidity Changes - /liquidity_changes

Get all liquidity changes (addition / removal) for all pools.

http://localhost:3010/liquidity_changes

https://rewards-api.xcadnetwork.com/liquidity_changes

Parameter
Description

per_page

The number of records per page (default 10, max 50)

page

The page to retrieve - Paging

address

The address of the initiator, Bech32 format - Filter by user address

pool (ZIL)

The identifier of the pool, Bech32 address for ZIL-ZRC2 pools - Filter by pool

pool (XCAD)

The identifier of the pool, XCADHash,TokenHash for XCAD-ZRC2 pools - Filter by pool

Examples

Filter
Example Url

per_page

http://localhost:3010/liquidity_changes?per_page=50

https://rewards-api.xcadnetwork.com/liquidity_changes?per_page=50

page

http://localhost:3010/liquidity_changes?page=2

https://rewards-api.xcadnetwork.com/liquidity_changes?page=2

address

http://localhost:3010/liquidity_changes?address=zil144x80aulkm468jxul3twhu2zzfzcjql6suhma5

https://rewards-api.xcadnetwork.com/liquidity_changes?address=zil19e24266mg4pmxzvm24v92c53lfd4kd4cadc6xl

https://rewards-api.xcadnetwork.com/liquidity_changes?address=zil1dmqtvyp3paq08m466mecuya650xhxh3jx3mmyf

pool (ZIL)

http://localhost:3010/liquidity_changes?pool=zil1zlypy5aemcs8expcrsx28jz09523j2x8l0qy4s

https://rewards-api.xcadnetwork.com/liquidity_changes?pool=zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y

pool (XCAD)

http://localhost:3010/liquidity_changes?pool=0x17c81253b9de207c98381c0ca3c84f2d151928c7,0xd534e4e0ea00d72c8ab5641e80234af531238650

https://rewards-api.xcadnetwork.com/liquidity_changes?pool=0x153feaddc48871108e286de3304b9597c817b456,0x818ca2e217e060ad17b7bd0124a483a1f66930a9

Sample Data

Field
Description

token_address - XCAD pools

The pool identifier, XCADTokenHash,TokenHash Hex format

token_address - Zil pools

The pool identifier, TokenAddress Bech32 format

change_amount - XCAD Pools

The amount of Liquidity added or removed (negative value). For XCAD Pool this is XCAD amount

chnage_amount - Zil Pools

The amount of Liquidity added or removed (negative value). For Zil Pool this is ZIL amount

{
  "records": [
    {
      "id": "02d1a143-3bca-4dc0-8993-efe52668466d",
      "transaction_hash": "0x5c23e40e526ed6efecfe32a738fbfe02c221ab1d1205013977fd07214811b1d7",
      "event_sequence": 0,
      "block_height": 1839016,
      "block_timestamp": "2022-02-22T23:26:56",
      "initiator_address": "zil1cm5gdpjmxpklsk4xl5vdd5dl4qxk54zdw42wr5",
      "token_address": "0x153feaddc48871108e286de3304b9597c817b456,0x327082dd216ff625748b13e156b9d1a5d3dd41f2",
      "change_amount": "1899725039668223963",
      "token_amount": "48506596480279736",
      "zil_amount": "3170000000000000000"
    },
    {
      "id": "1fcc658f-d676-4f81-8f15-54b2e55ebb27",
      "transaction_hash": "0xde5c8e9a0af21dafd66a520966e8dffde62493105dc25d6806ac161b07775595",
      "event_sequence": 0,
      "block_height": 1839013,
      "block_timestamp": "2022-02-22T23:25:22",
      "initiator_address": "zil1zqludyach87rsyws0xvg5ykezskx755acm75em",
      "token_address": "0x153feaddc48871108e286de3304b9597c817b456,0x327082dd216ff625748b13e156b9d1a5d3dd41f2",
      "change_amount": "-102722667580690969907",
      "token_amount": "2623384467386187972",
      "zil_amount": "171375631666888515959"
    },
    {
      "id": "1dccbe22-3483-415a-87b3-8d46a3abe931",
      "transaction_hash": "0xbbd946a3438fd4348be7ba088920a3b3ea8b693c6373821f6cd96b5b15cb32b9",
      "event_sequence": 0,
      "block_height": 1838907,
      "block_timestamp": "2022-02-22T22:25:02",
      "initiator_address": "zil1p2p3prgh6tps9h33s7nla2syutgguf7uxj2t7y",
      "token_address": "zil1xfcg9hfpdlmz2aytz0s4dww35hfa6s0jnjut5f",
      "change_amount": "-17946389635926607",
      "token_amount": "2764474143521074434",
      "zil_amount": "13033805276919787"
    },	
    {
      "id": "3f501bdc-6326-4953-92b1-1ff6ae30b23c",
      "transaction_hash": "0x4a8fade9431774d61b36790a693c5f9b31812cc59fcd3d41c8cb7ce25879d4f0",
      "event_sequence": 0,
      "block_height": 1838905,
      "block_timestamp": "2022-02-22T22:23:55",
      "initiator_address": "zil1z9jfmymh3rpzu6q4m48amdtmtj7pwu4n4j44ce",
      "token_address": "zil1xfcg9hfpdlmz2aytz0s4dww35hfa6s0jnjut5f",
      "change_amount": "2019334857095445911",
      "token_amount": "307991960640581258031",
      "zil_amount": "1481153282696132300"
    },	
  ],
  "total_pages": 2356
}

Get Volumne - /volume

Get the swap volume in XCAD / token and Zil / tokens for the given period for all pools.

https://rewards-api.xcadnetwork.com/volume

Parameter
Description

address

The address of the initiator, Bech32 format - Filter by user address

from

Start time, Unix time format ( default for until is now) - Filter by time range

until

End time, Unix time format ( if not specify it means now) - Filter by time range

Examples

Filter
Example Url

address

http://localhost:3010/volume?address=zil144x80aulkm468jxul3twhu2zzfzcjql6suhma5

https://rewards-api.xcadnetwork.com/volume?address=zil19e24266mg4pmxzvm24v92c53lfd4kd4cadc6xl

https://rewards-api.xcadnetwork.com/volume?address=zil1dmqtvyp3paq08m466mecuya650xhxh3jx3mmyf

time range

http://localhost:3010/volume?from=1645142739

https://rewards-api.xcadnetwork.com/volume?from=1645142739

http://localhost:3010/volume?from=1645142739&until=1645229139

https://rewards-api.xcadnetwork.com/volume?from=1645142739&until=1645229139

Sample Data

Field
Description

pool - XCAD pools

The pool identifier, XCADTokenHash,TokenHash Hex format

pool - Zil pools

The pool identifier, TokenAddress Bech32 format

in_zil_amount

The amount of XCAD or ZIL input to the swap, this field is overloaded, for XCAD pools it means XCAD, for Zils pool it means ZIL

out_token_amount

The amount of token output from the swap

out_zil_amount ls

The amount of XCAD or ZIL output from the swap, this field is overloaded, for XCAD pools it means XCAD, for Zils pool it means ZIL

in_token_amount

The amount token input to the swap

[
  {
    "pool": "0x153feaddc48871108e286de3304b9597c817b456,0x91228a48aea4e4071b9c6444eb08b021399cff7c",
    "in_zil_amount": "216192254610003348822258",
    "out_token_amount": "235590795124",
    "out_zil_amount": "183025551924071092142878",
    "in_token_amount": "195449117527"
  },  
  {
    "pool": "zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y",
    "in_zil_amount": "19175128191820234377",
    "out_token_amount": "207253250971555541842088",
    "out_zil_amount": "20021483677358733886",
    "in_token_amount": "219221209507998102310328"
  }
]

Get Swaps - /swaps

Get the swaps for all pools.

https://rewards-api.xcadnetwork.com/swaps

Parameter
Description

per_page

The number of records per page (default 10, max 50)

page

The page to retrieve - Paging

address

The address of the initiator, Bech32 format - Filter by user address

pool

The identifier of the pool, Bech32 address for ZIL-ZRC2 pools - Filter by pool

pool

The identifier of the pool, XCADHash,TokenHash for XCAD-ZRC2 pools - Filter by pool

is_incoming

The swap direction, true for Sell, false for Buy - Filter by Sell or Buy

Examples

Filter
Example Url

per_page

http://localhost:3010/swaps?per_page=50

https://rewards-api.xcadnetwork.com/swaps?per_page=50

page

http://localhost:3010/swaps?page=2

https://rewards-api.xcadnetwork.com/swaps?page=2

address

http://localhost:3010/swaps?address=zil144x80aulkm468jxul3twhu2zzfzcjql6suhma5

https://rewards-api.xcadnetwork.com/swaps?address=zil19e24266mg4pmxzvm24v92c53lfd4kd4cadc6xl

https://rewards-api.xcadnetwork.com/swaps?address=zil1dmqtvyp3paq08m466mecuya650xhxh3jx3mmyf

pool (ZIL)

http://localhost:3010/swaps?pool=zil1zlypy5aemcs8expcrsx28jz09523j2x8l0qy4s

https://rewards-api.xcadnetwork.com/swaps?pool=zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y

pool (XCAD)

http://localhost:3010/swaps?pool=0x17c81253b9de207c98381c0ca3c84f2d151928c7,0xd534e4e0ea00d72c8ab5641e80234af531238650

https://rewards-api.xcadnetwork.com/swaps?pool=0x153feaddc48871108e286de3304b9597c817b456,0x818ca2e217e060ad17b7bd0124a483a1f66930a9

Sell

http://localhost:3010/swaps?is_incoming=true

https://rewards-api.xcadnetwork.com/swaps?is_incoming=true

Buy

http://localhost:3010/swaps?is_incoming=false

https://rewards-api.xcadnetwork.com/swaps?is_incoming=false

Sample Data

Field
Description

token_address - XCAD pools

The pool identifier, XCADTokenHash,TokenHash Hex format

token_address - Zil pools

The pool identifier, TokenAddress Bech32 format

zil_amount

The amount of XCAD or ZIL, this field is overloaded, for XCAD pools it means XCAD, for Zils pool it means ZIL

token_amount

The amount of token

is_sending_zil

The Swap Direction true means XCAD or ZIL is the input to the swap, false means XCAD or ZIL is the output

{
  "records": [
    {
      "id": "a92fca1d-09ae-4cee-be87-79975321e3ca",
      "transaction_hash": "0xd8096b08985567919362ac35101b9b75bd6d561fa9f558318d9842b429ba1daa",
      "event_sequence": 4,
      "block_height": 1839073,
      "block_timestamp": "2022-02-22T23:56:31",
      "initiator_address": "zil1r2vyx39k3xpzh59qr6dew6483n7kca4jsdh0y0",
      "token_address": "0x153feaddc48871108e286de3304b9597c817b456,0x818ca2e217e060ad17b7bd0124a483a1f66930a9",
      "token_amount": "752840569",
      "zil_amount": "253505679541101571451",
      "is_sending_zil": false
    },
    {
      "id": "c0ca4ec9-f298-46ff-9475-079b95b3286c",
      "transaction_hash": "0xd26455d88e53f2859f21a49e38007086fcff024019dbb27440fdb59d91c71876",
      "event_sequence": 0,
      "block_height": 1839069,
      "block_timestamp": "2022-02-22T23:54:28",
      "initiator_address": "zil1r2vyx39k3xpzh59qr6dew6483n7kca4jsdh0y0",
      "token_address": "0x153feaddc48871108e286de3304b9597c817b456,0xa845c1034cd077bd8d32be0447239c7e4be6cb21",
      "token_amount": "26420968549984361",
      "zil_amount": "222000000000000000000",
      "is_sending_zil": true
    },
	{
      "id": "61b5b132-0456-4deb-bae7-6b5f0d0c6037",
      "transaction_hash": "0xd23e0da5324e0ecc72816ab5b69cecf763ed060e57d6c3f26ec23a57186dc2ff",
      "event_sequence": 0,
      "block_height": 1839053,
      "block_timestamp": "2022-02-22T23:46:08",
      "initiator_address": "zil1veqvw6jwqg4dx7nq37xlp352wtrwsdqf58jtzl",
      "token_address": "zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y",
      "token_amount": "319985525995252600000",
      "zil_amount": "23644779119793852",
      "is_sending_zil": false
    },
    {
      "id": "6e8e2984-069d-4960-9fea-917baa149040",
      "transaction_hash": "0xf2d649c86e03e5eae532384e2cdf4bc7200e5049c3a8ad6204549ed27a5bea02",
      "event_sequence": 0,
      "block_height": 1839015,
      "block_timestamp": "2022-02-22T23:26:23",
      "initiator_address": "zil1ujjs97guqfe3qvl6v79754u8cz9jq6nwcjyj2y",
      "token_address": "zil1xfcg9hfpdlmz2aytz0s4dww35hfa6s0jnjut5f",
      "token_amount": "10683120613429174793",
      "zil_amount": "52187000000000000",
      "is_sending_zil": true
    }    	
  ],
  "total_pages": 4891
}

Get Transactions - /transactions

Get transactions for all pools. Transactions include swaps and liquidity changes.

http://localhost:3010/transactions

https://rewards-api.xcadnetwork.com/transactions

Parameter
Description

per_page

The number of records per page (default 10, max 50)

page

The page to retrieve - Paging

address

The address of the initiator, Bech32 format - Filter by user address

pool

The identifier of the pool, Bech32 address for ZIL-ZRC2 pools - Filter by pool

pool

The identifier of the pool, XCADHash,TokenHash for XCAD-ZRC2 pools - Filter by pool

is_incoming

The swap direction, true for Sell, false for Buy - Filter by Sell or Buy

Examples

Filter
Example Url

per_page

http://localhost:3010/transactions?per_page=50

https://rewards-api.xcadnetwork.com/transactions?per_page=50

page

http://localhost:3010/transactions?page=2

https://rewards-api.xcadnetwork.com/transactions?page=2

address

http://localhost:3010/transactions?address=zil144x80aulkm468jxul3twhu2zzfzcjql6suhma5

https://rewards-api.xcadnetwork.com/transactions?address=zil19e24266mg4pmxzvm24v92c53lfd4kd4cadc6xl

https://rewards-api.xcadnetwork.com/transactions?address=zil1dmqtvyp3paq08m466mecuya650xhxh3jx3mmyf

pool (ZIL)

http://localhost:3010/transactions?pool=zil1zlypy5aemcs8expcrsx28jz09523j2x8l0qy4s

https://rewards-api.xcadnetwork.com/transactions?pool=zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y

pool (XCAD)

http://localhost:3010/transactions?pool=0x17c81253b9de207c98381c0ca3c84f2d151928c7,0xd534e4e0ea00d72c8ab5641e80234af531238650

https://rewards-api.xcadnetwork.com/transactions?pool=0x153feaddc48871108e286de3304b9597c817b456,0x818ca2e217e060ad17b7bd0124a483a1f66930a9

Sell

http://localhost:3010/transactions?is_incoming=true

https://rewards-api.xcadnetwork.com/transactions?is_incoming=true

Buy

http://localhost:3010/transactions?is_incoming=false

https://rewards-api.xcadnetwork.com/transactions?is_incoming=false

Sample Data

Field
Description

token_address - XCAD pools

The pool identifier, XCADTokenHash,TokenHash Hex format

token_address - Zil pools

The pool identifier, TokenAddress Bech32 format

tx_type

Transaction type "liquidity" or "swap"

tx_type = liquidity

change_amount - XCAD Pools

The amount of Liquidity added or removed (negative value). For XCAD Pool this is XCAD amount

chnage_amount - Zil Pools

The amount of Liquidity added or removed (negative value). For Zil Pool this is ZIL amount

tx_type = swap

zil_amount

The amount of XCAD or ZIL, this field is overloaded, for XCAD pools it means XCAD, for Zils pool it means ZIL

token_amount

The amount of token

swap0_is_sending_zil

The Swap Direction true means XCAD or ZIL is the input to the swap, false means XCAD or ZIL is the output

{
  "records": [
    {
      "id": "9db7fae4-e1d6-48af-a18b-67eadc7db861",
      "transaction_hash": "0xa5b8ab43f56505b4da8c0fd0f29525b5056aa387f1fcf8cfa18e0279c66da629",
      "block_height": 1839100,
      "block_timestamp": "2022-02-23T00:14:42",
      "initiator_address": "zil12fdttt64vugplr0va2fwf6s6rgcr4tfkjzs7lp",
      "token_address": "0x153feaddc48871108e286de3304b9597c817b456,0x818ca2e217e060ad17b7bd0124a483a1f66930a9",
      "token_amount": "1969562005",
      "zil_amount": "661999999938870600000",
      "tx_type": "liquidity",
      "swap0_is_sending_zil": null,
      "swap1_token_address": null,
      "swap1_token_amount": null,
      "swap1_zil_amount": null,
      "swap1_is_sending_zil": null,
      "change_amount": "409877248895224023573"
    },
    {
      "id": "cda06f8e-7228-4457-aff0-043657b4607e",
      "transaction_hash": "0xba4bbeb46c99aa55d0e559378ec4db9c192db147faf509fb2e55ce96008648a3",
      "block_height": 1839098,
      "block_timestamp": "2022-02-23T00:09:42",
      "initiator_address": "zil1htevvmh6l2rmstx0ck0wjv4m2yldq3ydanmmsw",
      "token_address": "0x153feaddc48871108e286de3304b9597c817b456,0x327082dd216ff625748b13e156b9d1a5d3dd41f2",
      "token_amount": "1632761875114123500",
      "zil_amount": "107327494437575159824",
      "tx_type": "swap",
      "swap0_is_sending_zil": false,
      "swap1_token_address": null,
      "swap1_token_amount": null,
      "swap1_zil_amount": null,
      "swap1_is_sending_zil": null,
      "change_amount": null
    },
    {
      "id": "53c37dfa-1fde-4b26-aae1-da2b85a085a0",
      "transaction_hash": "0x6a7c941c7a794b13ea77c2b2b5fff1cc7a52ff219bbe73237a2d1d154f954385",
      "block_height": 1839077,
      "block_timestamp": "2022-02-22T23:58:34",
      "initiator_address": "zil1emeq6fr6u6dulnk7lvxlugrpfke0agd56unz9w",
      "token_address": "zil1xfcg9hfpdlmz2aytz0s4dww35hfa6s0jnjut5f",
      "token_amount": "17094640464660267594",
      "zil_amount": "84000000000000000",
      "tx_type": "liquidity",
      "swap0_is_sending_zil": null,
      "swap1_token_address": null,
      "swap1_token_amount": null,
      "swap1_zil_amount": null,
      "swap1_is_sending_zil": null,
      "change_amount": "113291266032870917"
    },
    {
      "id": "61b5b132-0456-4deb-bae7-6b5f0d0c6037",
      "transaction_hash": "0xd23e0da5324e0ecc72816ab5b69cecf763ed060e57d6c3f26ec23a57186dc2ff",
      "block_height": 1839053,
      "block_timestamp": "2022-02-22T23:46:08",
      "initiator_address": "zil1veqvw6jwqg4dx7nq37xlp352wtrwsdqf58jtzl",
      "token_address": "zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y",
      "token_amount": "319985525995252600000",
      "zil_amount": "23644779119793852",
      "tx_type": "swap",
      "swap0_is_sending_zil": false,
      "swap1_token_address": null,
      "swap1_token_amount": null,
      "swap1_zil_amount": null,
      "swap1_is_sending_zil": null,
      "change_amount": null
    }	
  ],
  "total_pages": 7249
}

Get Distribution Info - /distribution/info

Get details about all active distributions. This info is coming from the config.yml

https://rewards-api.xcadnetwork.com/distribution/info

Sample Data

[
  {
    "name": "dXCAD Rewards",
    "reward_token_symbol": "dXCAD",
    "reward_token_address_hex": "0x327082dd216ff625748b13e156b9d1a5d3dd41f2",
    "distributor_name": "XCADDistributor",
    "distributor_address_hex": "0x96c300ce0697e3524190943cd05681d7abe7c1ca",
    "developer_address": "zil19sj3nn6cwxxkeplcxduvazr3ggvc48t34vehmn",
    "emission_info": {
      "epoch_period": 86400,
      "tokens_per_epoch": "268000000000000000000",
      "tokens_for_retroactive_distribution": "0",
      "retroactive_distribution_cutoff_time": 0,
      "distribution_start_time": 1640894400,
      "total_number_of_epochs": 120,
      "initial_epoch_number": 0,
      "developer_token_ratio_bps": 0,
      "trader_token_ratio_bps": 0
    },
    "incentivized_pools": {
      "0x153feaddc48871108e286de3304b9597c817b456,0x54ae64e2092749fb8d25470ffc1d4d6a19c6f2ab": 6,
      "0x153feaddc48871108e286de3304b9597c817b456,0xbf79e16872fad92c16810ddd2a7b9b6858c7b756": 14,
      "0x153feaddc48871108e286de3304b9597c817b456,0x818ca2e217e060ad17b7bd0124a483a1f66930a9": 276,
      "zil1xfcg9hfpdlmz2aytz0s4dww35hfa6s0jnjut5f": 30,
      "zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y": 13
    }
  }
]

Distribution Data Generation - /distribution/generate/{id}

Generate the rewards distribution data for the given Distributor.

This needs to run at the end of each epoch to generate data for that epoch and save it to the database

id: is the index into the list of distributor configurations in the config.yml file it is 0 indexed - first config is number 0

https://rewards-api.xcadnetwork.com/distribution/generate/0

Sample Data

The data returned is simply the root of the generated Merkle tree.

"e4bb6517a1e981b5bab05990a74a2226bc41493fda74e73cb731dc28c6a402ff" 

Get Distribution Data for Epoch - /distribution/data/{distributor_address}/{epoch_number}

Get distribution information for a given epoch

https://rewards-api.xcadnetwork.com/distribution/data/{DistributorHash}/{epoch_number}

Route Parameter
Description

distributor_address

The distribution contract address in hex.

epoch_number

The epoch number to get data for. ( number between 0 and total_epochs

Parameter
Description

address

The address of the initiator, Bech32 format - Filter by user address

Filter
Example Url

http://localhost:3010/distribution/data/0x4a28a0b3d3fc98a52fc128e3cd40c77a88da696e/0

https://rewards-api.xcadnetwork.com/distribution/data/0x96c300ce0697e3524190943cd05681d7abe7c1ca/0

https://rewards-api.xcadnetwork.com/distribution/data/0x96c300ce0697e3524190943cd05681d7abe7c1ca/1

address

https://rewards-api.xcadnetwork.com/distribution/data/0x96c300ce0697e3524190943cd05681d7abe7c1ca/1?address=zil19e24266mg4pmxzvm24v92c53lfd4kd4cadc6xl

https://rewards-api.xcadnetwork.com/distribution/data/0x96c300ce0697e3524190943cd05681d7abe7c1ca/1?address=zil1dmqtvyp3paq08m466mecuya650xhxh3jx3mmyf

Sample Data

Field
Description

distributor_address

The address of the rewards distributor smart contract, Hex format

epoch_number

The epoch number that this data applies to

address_bech32

The address of the user to be rewarded, Bech32 format

address_hex

The address of the user to be rewarded, Hex format

amount

The amount of token to reward this user for this epoch, the reward token is defined Distribution Info

proof

The Merkle branch for this user's reward for this epoch. Each node is separated by a space ' '.

The first node is he hash of the users address and the rewards amount ( the leaf), the last node is the Merkle root.

Removing the leaf and the root, all the remaining nodes is the Merkle proof that can used to claim the rewards from the distributor smart contract

[
  {
    "id": "03dce258-d5bb-42a3-a8a5-5cd48e629c0f",
    "distributor_address": "0x96c300ce0697e3524190943cd05681d7abe7c1ca",
    "epoch_number": 0,
    "address_bech32": "zil102e2dqgts7jh0rf9ge39ftvxludpydd367587c",
    "address_hex": "7ab2a6810b87a5778d25466254ad86ff1a1235b1",
    "amount": "7055978046801212",
    "proof": "59e5a7c893c29db6c8b05c6d508d435c2aefec8946671e7f5ae2b2f7d0e761c2 59107cd42eeacc2388507391ae0be9cf561e7394896c94223ea6af2ef04b2e4a b3f9704bff00307b79fd3872c3c92c06e4d39724085a4e25fe00d59734926b58 c9385b0ca9cdbc2937e382d40dcded0bd8fb6e1fa3e7b15242e031b3ea3dc2da 023bd1a5c9161e59a90ddb1793983b9f9680296250fc0bdc1a897bfe2c065435 5568a6bec86cbcc9cbeca3b25c7e386dba865049b9df96b913290a4b038d6e0e 80b0fd60b6554504a3f1de1498212052bdaac513dd4996078f0ce9b7c8be7733 ea863e688364587a63c570bc74b96234f0e0a798d5f59d88d70bb5cedc7076c5 3b44dcc864677b4bebd8ea2c39e39dbdb88c50e1a1befc1a75a10662aa2fe405"
  },
  {
    "id": "aabc5097-897c-43d1-8530-91ee98f626a9",
    "distributor_address": "0x96c300ce0697e3524190943cd05681d7abe7c1ca",
    "epoch_number": 0,
    "address_bech32": "zil105s7u3r430z8vp83jan2jp69cwkktf7tu64mgd",
    "address_hex": "7d21ee44758bc47604f19766a90745c3ad65a7cb",
    "amount": "47538305206084449",
    "proof": "384643fe9d2aee7ef0d79b5ec1f38616dab58dbd4d3e3f3342d666b5b8732eb5 37bebd2b657dbc072cc067570cbc42d8e59677249b6d9e4909a2573108bd2119 65a9946fec50bb8316c43e887cc19ef8a06ab73776d4d4599c25d2d95536f145 dd0b96f99a3ece0e912c239ed47efa2d450a3b6a4e0118c90fa435296b5ea329 9e8ec1ed483c771f99c32879f96846767aa9fe5b195143cd7d6f49730bcf58e7 b5e363d5347a99955d92b3e220202c4eddc4df0f762239391f8a3247a8020347 4235e530a32771f921c521375706afd82ad92f130329837f2cc8c4b72cf38268 66e8cbef5e8cad44fcbbe30e7f4b5b84fc20e54574d447593c0cded02ab2cd8e 58febf1a5458bb36d0d16664f144e91550e4ec801fe24a68e4e676081bbd056b a5ae4da110f1fd2ccd869abb993f0d10e3add6bce39558e34f6c48bc7b1ff015 3b44dcc864677b4bebd8ea2c39e39dbdb88c50e1a1befc1a75a10662aa2fe405"
  },
  {
    "id": "fb05055d-39a4-4142-b54d-40488e737e7f",
    "distributor_address": "0x96c300ce0697e3524190943cd05681d7abe7c1ca",
    "epoch_number": 0,
    "address_bech32": "zil10csj7eyl5n2tpcwazlxqwcnju49zhl5cy7v0fz",
    "address_hex": "7e212f649fa4d4b0e1dd17cc076272e54a2bfe98",
    "amount": "7903048185520445",
    "proof": "719480e7625af09d5bbabff3ff439ba03cf0ca966f2729ef8ebae8ef40ee4edd 723642443913096efd87430d809776fa3b3f08a69cd4ee121b78fd177479581b ad46405cb6289f4f98956e51d997a10b564dacd458d683ce9b84e2669a2c18fa 12e01fc4e0aaef68dc923325be95425bee0e371a142f40971297f2d116891aba 99d77a63e566b199e5644a74620c1e8c267d14e88046c21f1482121aa9f468b5 adef4d49fd5ba8a02017b955ddec1eaf58793ce50af9dfbad45ab377c4926f62 1e853ec418e5cc17549347c6511e3a43a7d4494f2b4b88fe0ba98cbb693624ab 76017d6cccd284763ed599c6e0623536292295af068296510b7629831ec2e6d1 e23da9c808536ed31fc3c0a1d8e90b3bd2a2e2fbc4c8e3671604df482ecbf392 ea863e688364587a63c570bc74b96234f0e0a798d5f59d88d70bb5cedc7076c5 3b44dcc864677b4bebd8ea2c39e39dbdb88c50e1a1befc1a75a10662aa2fe405"
  }
]   

Get Estimated Distribution Amount - /distribution/estimated_amounts/{user_address}

Get the estimated amount of rewards for the current epochs for all distribution for the given address. Given a user address return list of Pools and Estimated reward amount for the current epoch

https://rewards-api.xcadnetwork.com/distribution/estimated_amounts/BECH32Address

Route Parameter
Description

user_address

The address of the initiator, Bech32 format - Filter by user address

Filter
Example Url

address

http://localhost:3010/distribution/estimated_amounts/zil144x80aulkm468jxul3twhu2zzfzcjql6suhma5

https://rewards-api.xcadnetwork.com/distribution/estimated_amounts/zil19e24266mg4pmxzvm24v92c53lfd4kd4cadc6xl

https://rewards-api.xcadnetwork.com/distribution/estimated_amounts/zil1dmqtvyp3paq08m466mecuya650xhxh3jx3mmyf

Sample Data

ObjectKey
Description

"0x96c300ce0697e3524190943cd05681d7abe7c1ca"

Adddress of the Reward Distributor Smart Contract

"zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y"

ZIL pool, in this example ZIL-XCAD pool

135535305328410623

Amount of token reward for this user from ZIL-XCAD pool

"0x153feaddc48871108e286de3304b9597c817b456,0x818ca2e217e060ad17b7bd0124a483a1f66930a9"

XCAD ppol, in this example XCAD-zUSDT pool

309029689620617248

Amount of token reward for this user from XCAD-zUSDT pool

json
{
  "0x96c300ce0697e3524190943cd05681d7abe7c1ca": {
    "zil1z5l74hwy3pc3pr3gdh3nqju4jlyp0dzkhq2f5y": "135535305328410623",
    "0x153feaddc48871108e286de3304b9597c817b456,0x818ca2e217e060ad17b7bd0124a483a1f66930a9": "309029689620617248"
  }
}

Get Distribution Data for Address - /distribution/claimable_data/{user_address}

Get unclaimed distributions for the given address. Return data is required for making reward claims.

http://rewards-api.xcadnetwork.com/distribution/claimable_data/zil150uv303w8ttzcml8w200ptzq957637wel8p8ev

Route Parameter
Description

user_address

The address of the initiator, Bech32 format - Filter by user address

Filter
Example Url

address

http://localhost:3010/distribution/claimable_data/zil144x80aulkm468jxul3twhu2zzfzcjql6suhma5

https://rewards-api.xcadnetwork.com/distribution/claimable_data/zil19e24266mg4pmxzvm24v92c53lfd4kd4cadc6xl

https://rewards-api.xcadnetwork.com/distribution/claimable_data/zil1dmqtvyp3paq08m466mecuya650xhxh3jx3mmyf

Sample Data

Field
Description

distributor_address

The address of the rewards distributor smart contract, Hex format

epoch_number

The epoch number that this data applies to

address_bech32

The address of the user to be rewarded, Bech32 format

address_hex

The address of the user to be rewarded, Hex format

amount

The amount of token to reward this user for this epoch, the reward token is defined Distribution Info

proof

The Merkle branch for this user's reward for this epoch. Each node is separated by a space ' '.

The first node is he hash of the users address and the rewards amount ( the leaf), the last node is the Merkle root.

Removing the leaf and the root, all the remaining nodes is the Merkle proof that can used to claim the rewards from the distributor smart contract

TODO: get sample data

[
  {
    "id": "b00668f9-6396-48ea-a2af-a44c45fab440",
    "distributor_address": "0x4a28a0b3d3fc98a52fc128e3cd40c77a88da696e",
    "epoch_number": 2234,
    "address_bech32": "zil150uv303w8ttzcml8w200ptzq957637wel8p8ev",
    "address_hex": "a3f8c8be2e3ad62c6fe7729ef0ac402d3da8f9d9",
    "amount": "196646889",
    "proof": "0a2c29922304883accb6e0222d7d75e5055e8323eea06504edb5a2352349c387 ddf9fc4e8f35b3246cedeb7d5db9f9e95176d94879828d36d770a8135bda7341 2b2443add7dce1c67617a289a3f4c1657747681f2f08bed331b137fc033245b7"
  }
]

Get Claims - /claims

Get all claims, optionally filtered by address and/or distributor address

Get records of rewards claims the users made

https://rewards-api.xcadnetwork.com/claims

Parameter
Description

per_page

The number of records per page (default 10, max 50)

page

The page to retrieve - Paging

address

The address of the initiator, Bech32 format - Filter by user address

distr_address

The Reward Distribuitor address, TODO: WhichFromat? Bech32 address - Fillter by distributor address

epoch_number

The epoch number - Filter by epoch

Examples

Filter
Example Url

per_page

http://localhost:3010/claims?per_page=50

https://rewards-api.xcadnetwork.com/claims?per_page=50

page

http://localhost:3010/claims?page=2

https://rewards-api.xcadnetwork.com/claims?page=2

address

http://localhost:3010/claims?address=zil144x80aulkm468jxul3twhu2zzfzcjql6suhma5

https://rewards-api.xcadnetwork.com/claims?address=zil19e24266mg4pmxzvm24v92c53lfd4kd4cadc6xl

https://rewards-api.xcadnetwork.com/claims?address=zil1dmqtvyp3paq08m466mecuya650xhxh3jx3mmyf

distr_address

http://localhost:3010/claims?distr_address=TODO:

https://rewards-api.claims.com/liquidity_changes?distr_address=TODO:

epoch_number

http://localhost:3010/claims?epoch_number=0

https://rewards-api.xcadnetwork.com/claims?epoch_number=0

Sample Data

{
  "records": [
    {
      "id": "e6094bff-653e-4737-8763-befeabeda0c5",
      "transaction_hash": "0x98657d7622018e240d05247a3aa3ed04dbae059ed6c9eb686d366f13aad88ed2",
      "event_sequence": 1,
      "block_height": 1708008,
      "block_timestamp": "2022-01-01T20:26:51",
      "initiator_address": "zil1pwwnmu3f3cmzsyh5pf0wd9n6sqflp2zja54nxc",
      "distributor_address": "0x96c300ce0697e3524190943cd05681d7abe7c1ca",
      "epoch_number": 0,
      "amount": "95260256782170537"
    },
    {
      "id": "144dc375-9926-48dd-a0ea-3f91533b0b37",
      "transaction_hash": "0x3e8a38dd33a9347176a7b914948dfd2eba8bd43bfcd21c6c7ac7813b99ca6e65",
      "event_sequence": 1,
      "block_height": 1708731,
      "block_timestamp": "2022-01-02T03:14:33",
      "initiator_address": "zil19zumdajkufmmkfjs9l6lu0f2rjw8s4zvnvcnn3",
      "distributor_address": "0x96c300ce0697e3524190943cd05681d7abe7c1ca",
      "epoch_number": 0,
      "amount": "294263020546928219"
    },
    {
      "id": "4f1f54d8-b808-41b9-951f-1cb51959f813",
      "transaction_hash": "0x202960fe1dd766b4afaed455080e0c8d5c8b3edbbbc4de706f4d32bbdd9dbd8c",
      "event_sequence": 2,
      "block_height": 1711925,
      "block_timestamp": "2022-01-03T10:31:09",
      "initiator_address": "zil1e2tlevwfx6u7ngzvl23ud2hq80cjnmqtyakamh",
      "distributor_address": "0x96c300ce0697e3524190943cd05681d7abe7c1ca",
      "epoch_number": 0,
      "amount": "7095585319843868"
    }    
  ],
  "total_pages": 5474
}

Last updated