# Tech Overview & Resources

## Overview

Three systems make up the Arbitrum STIP rewards program: 1. Stats; 2. Points; and 3. Rewards.

***tl;dr: stats => points => rewards***

## Stats Subgraph

Gains Network has published a subgraph to track stats & points from on-chain trading events. Both the data and code are public:

***Arbitrum Subgraph*****:** <https://thegraph.com/hosted-service/subgraph/gainsnetwork-org/gtrade-stats-arbitrum>

***GitHub*****:** <https://github.com/GainsNetwork-org/gtrade-stats-subgraph/tree/main/packages/stats-subgraph>

## Graph Client

Gains Network has published a client library to NPM to both interact with raw stats & points, as well as access all rewards data. Rewards are not tracked on the subgraph and instead are computed in real-time through the use of client-side queries. Both the client library and code are public:

***NPM Library*****:** <https://www.npmjs.com/package/@gainsnetwork/graph-client>

***GitHub*****:** <https://github.com/GainsNetwork-org/gtrade-stats-subgraph/tree/main/packages/graph-client>

## Claims Contract

Gains Network has deployed a contract for claiming $ARB rewards. The contract is verified on Arbiscan.&#x20;

***Contract:*** <https://arbiscan.io/address/0x6ac331B603373D0006D72d3a3159B4C35e1006e8#code>

The contract stores a Merkle root and IPFS CID per epoch. The root is used to distribute rewards, and the CID is for data transparency, allowing the community to verify the rewards data independently.

## Weekly Job

Each week a job runs that:

1\. Computes rewards using the graph-client

2\. Generates a Merkle tree&#x20;

3\. Publishes tree to IPFS&#x20;

4\. Submits root & CID to contract

This job is not open source but its output can be fully verified.

## Verification

Each module of the system can be independently verified.

* Trading stats -- code & index can be compared against blockchain events independently&#x20;
* Trading points -- conversion from stats to points can be compared against blockchain events independently&#x20;
* Trading rewards -- graph-client allows anyone to compute rewards for any epoch at any time. This can be compared against the CID and Merkle root on-chain.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gains.trade/gtrade-leveraged-trading/incentives/trading-incentives/tech-overview-and-resources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
