Skip to content
Merged

Perps #489

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
44810c4
Merge pull request #177 from pillarwallet/staging
RanaBug Sep 19, 2024
da50f61
Merge pull request #180 from pillarwallet/staging
IAmKio Sep 23, 2024
95711dc
Merge pull request #182 from pillarwallet/staging
IAmKio Sep 23, 2024
d423411
Merge pull request #186 from pillarwallet/staging
RanaBug Oct 1, 2024
c5d3946
Merge pull request #191 from pillarwallet/staging
RanaBug Oct 9, 2024
c5764c1
Merge pull request #197 from pillarwallet/staging
RanaBug Oct 17, 2024
2cf5fb2
Merge pull request #199 from pillarwallet/staging
RanaBug Nov 4, 2024
4161560
Merge pull request #203 from pillarwallet/staging
RanaBug Dec 4, 2024
3fb9187
Merge pull request #206 from pillarwallet/staging
RanaBug Dec 5, 2024
d44fecc
Merge pull request #208 from pillarwallet/staging
IAmKio Dec 9, 2024
cbf3078
Merge pull request #214 from pillarwallet/staging
RanaBug Dec 10, 2024
17135f5
Merge pull request #216 from pillarwallet/staging
RanaBug Dec 11, 2024
7dc3140
Merge pull request #218 from pillarwallet/staging
RanaBug Dec 11, 2024
e48486c
Merge pull request #221 from pillarwallet/staging
RanaBug Dec 20, 2024
33e6d69
Merge pull request #224 from pillarwallet/staging
RanaBug Jan 9, 2025
3e4c0f1
Merge pull request #227 from pillarwallet/staging
RanaBug Jan 9, 2025
467fa54
Merge pull request #229 from pillarwallet/staging
RanaBug Jan 13, 2025
e5dcece
Merge pull request #267 from pillarwallet/staging
RanaBug Mar 24, 2025
8909306
Merge pull request #272 from pillarwallet/staging
RanaBug Mar 26, 2025
2aa6950
Merge pull request #278 from pillarwallet/staging
IAmKio Apr 1, 2025
643919b
Merge pull request #311 from pillarwallet/staging
RanaBug May 21, 2025
8a9ea7e
Merge pull request #325 from pillarwallet/staging
RanaBug May 30, 2025
ec4a325
Merge pull request #340 from pillarwallet/staging
IAmKio Jun 19, 2025
0b66c9c
Merge pull request #361 from pillarwallet/staging
IAmKio Jul 9, 2025
68cbc2b
Merge pull request #371 from pillarwallet/staging
RanaBug Jul 16, 2025
96eb832
Merge pull request #375 from pillarwallet/staging
IAmKio Jul 29, 2025
ad8ac0f
Merge pull request #380 from pillarwallet/staging
IAmKio Jul 31, 2025
3469b56
Merge pull request #383 from pillarwallet/staging
IAmKio Aug 7, 2025
9eca26f
Merge pull request #389 from pillarwallet/staging
IAmKio Aug 26, 2025
c203d0e
Merge pull request #401 from pillarwallet/staging
IAmKio Sep 24, 2025
100769e
Merge pull request #409 from pillarwallet/staging
RanaBug Sep 24, 2025
7073c51
Merge pull request #415 from pillarwallet/staging
RanaBug Oct 3, 2025
8e7ca5c
Merge pull request #430 from pillarwallet/staging
IAmKio Oct 13, 2025
7f93b3a
Merge pull request #434 from pillarwallet/staging
IAmKio Oct 16, 2025
63ed3f3
Merge pull request #443 from pillarwallet/staging
IAmKio Oct 29, 2025
039f677
Merge pull request #451 from pillarwallet/staging
IAmKio Nov 11, 2025
5ad6251
Merge pull request #457 from pillarwallet/staging
IAmKio Nov 27, 2025
d50d38d
Merge pull request #472 from pillarwallet/staging
IAmKio Dec 9, 2025
1f7b025
Merge pull request #479 from pillarwallet/staging
RanaBug Dec 12, 2025
a6015c1
Merge pull request #481 from pillarwallet/staging
IAmKio Dec 15, 2025
9237fb4
fix(pulse): token selector responsiveness and daily price change data
aldin4u Dec 23, 2025
15a2774
feat: Add Perps trading app with Hyperliquid integration
aldin4u Dec 23, 2025
6f3fb95
refactor: Remove all Supabase references from perps app
aldin4u Dec 23, 2025
6a2f78c
chore: Remove temp files from git tracking
aldin4u Dec 23, 2025
416ed68
Merge pull request #490 from pillarwallet/staging
IAmKio Jan 5, 2026
8029b36
feat(perps): Add sparkline chart, global account storage, and validat…
aldin4u Jan 6, 2026
9c227ad
Merge perp branch updates into perps
aldin4u Jan 6, 2026
c6b97bd
feat(perps): UX/UI improvements based on product design audit
aldin4u Jan 6, 2026
6ba304e
feat(perps): Add mobile-first redesign with responsive detection
aldin4u Jan 6, 2026
8c30b40
feat(perps): Set BTC as default asset and remove status banner
aldin4u Jan 6, 2026
50de434
feat(perps): Enhance AssetSelector with market data and sorting
aldin4u Jan 6, 2026
ac4a4de
fix(perps): Correct AssetSelector API response parsing
aldin4u Jan 6, 2026
7de7959
feat(perps): Add comprehensive market data to chart
aldin4u Jan 6, 2026
69d3b76
refactor(perps): Implement horizontal market data ticker
aldin4u Jan 6, 2026
c0f429a
style(perps): Fix horizontal ticker layout using flexbox
aldin4u Jan 6, 2026
7d9e08d
style(perps): Move market ticker to top-right corner
aldin4u Jan 6, 2026
b9e475b
style(perps): Enforce top-right ticker alignment
aldin4u Jan 6, 2026
60e9c31
revert(perps): Revert mobile-specific view and fix ticker alignment
aldin4u Jan 6, 2026
adafe01
style(perps): Finalize top-right ticker alignment without relative po…
aldin4u Jan 6, 2026
aabc2bd
style(perps): Align ticker to price baseline and reduce polling
aldin4u Jan 6, 2026
0d29cff
fix(perps): Improve ticker alignment and reduce API polling
aldin4u Jan 6, 2026
22abdfe
fix(perps): Final ticker alignment to top-right corner
aldin4u Jan 6, 2026
3629aec
fix(perps): Resolve stacked layout on laptop screens
aldin4u Jan 6, 2026
62c9b65
style(perps): Final typography alignment for header
aldin4u Jan 6, 2026
a40aea7
style(perps): Finalize mobile ticker optimization
aldin4u Jan 6, 2026
20817fb
feat(perps): Implement true JS split for responsive header
aldin4u Jan 6, 2026
055a6fb
fix: refactor asset loading for instant strategy paste
aldin4u Jan 6, 2026
35d5bbc
chore: apply prettier formatting
aldin4u Jan 6, 2026
bcc6853
fix: resolve build OOM by lazy loading pillarx-app in Lobby
aldin4u Jan 6, 2026
8c5c554
fix: resolve package-lock.json conflict by regeneration
aldin4u Jan 6, 2026
d7f0a94
fix: build issues, linting, and regenerate lockfile for deployment
aldin4u Jan 7, 2026
a6fbe25
fix: syntax error in MobilePositionsCard
aldin4u Jan 7, 2026
b16a1e8
fix: move Wrapper definition to fix no-use-before-define lint error
aldin4u Jan 7, 2026
3993187
fix: increase node memory limit for build to 4GB
aldin4u Jan 7, 2026
26d997c
chore: revert unintentional formatting changes to insights app
aldin4u Jan 7, 2026
33b0586
feat: implement click-to-load asset for positions
aldin4u Jan 7, 2026
d1414ff
fix(perps): map raw asset to AssetInfo for click-to-load
aldin4u Jan 7, 2026
ceeec85
fix(perps): robust click-to-load with fallback fetching and price enr…
aldin4u Jan 7, 2026
aa01e7e
refactor(perps): centralized asset selection logic
aldin4u Jan 7, 2026
311e952
fix(perps): restore missing variables in Index.tsx
aldin4u Jan 7, 2026
3f48bb5
feat(perps): implement click-to-load asset with conditional scroll
aldin4u Jan 7, 2026
c8ae0d8
fix(perps): remove duplicate identifier in MobilePositionsCard
aldin4u Jan 7, 2026
bd68cda
fix(tests): mock env var to resolve snapshot mismatch
aldin4u Jan 7, 2026
f11602d
feat(perps): UI refinements and imported account restrictions
aldin4u Jan 7, 2026
78fc7b5
chore: remove unused token logo generation script and constants
aldin4u Jan 7, 2026
d20140b
fix: increase Node.js heap size to 8GB for build
aldin4u Jan 8, 2026
02a37d8
chore: remove test script for Hyperliquid flow
aldin4u Jan 8, 2026
9c7de98
chore: revert unrelated developer-apps changes
aldin4u Jan 8, 2026
966b9f9
chore: revert all non-perps changes to create pure perps branch
aldin4u Jan 8, 2026
53b77ed
refactor(perps): improve type safety, optimization, and bug fixes
aldin4u Jan 8, 2026
f2712f1
feat: implement PIN-based encrypted wallet storage
aldin4u Jan 8, 2026
50c3644
fix(agent): resolve duplicate imports and syntax error
aldin4u Jan 8, 2026
a4af822
fix(agent): remove duplicate function declaration
aldin4u Jan 8, 2026
4e587a6
fix(agent): restore missing closing divs
aldin4u Jan 8, 2026
c9edd49
fix(agent): ensure modals are reachable by moving them out of conditi…
aldin4u Jan 8, 2026
cda6d02
fix(keystore): define missing cache variable
aldin4u Jan 8, 2026
174de53
feat(agent): encrypt imported wallets with PIN
aldin4u Jan 8, 2026
d31fd30
feat(agent): add private key display modal
aldin4u Jan 8, 2026
419ba7a
style(agent): improve PIN input UI and update copy
aldin4u Jan 8, 2026
9991f40
fix(agent): restore useState import
aldin4u Jan 8, 2026
4cd75c0
style(agent): update locked status label
aldin4u Jan 8, 2026
534c3b6
fix(agent): hot-load cache and trigger refresh on creation
aldin4u Jan 8, 2026
c485a25
feat(agent): add settings menu and conditional reveal
aldin4u Jan 8, 2026
1a28c3b
fix(agent): remove duplicate import
aldin4u Jan 8, 2026
480c09c
fix(agent): update state after import
aldin4u Jan 8, 2026
e98e1d0
fix(hyperliquid): fallback to agent balance if main empty
aldin4u Jan 8, 2026
71f3f56
fix(ui): pass fetched agent data to PositionsCard
aldin4u Jan 8, 2026
37628f7
fix(ui): remove duplicate identifier
aldin4u Jan 8, 2026
3a9cc79
fix(ui): re-render positions on external state change
aldin4u Jan 8, 2026
43b03d0
revert(hyperliquid): remove agent fallback logic
aldin4u Jan 8, 2026
d839710
chore(debug): show master address in ui
aldin4u Jan 8, 2026
e81df97
fix(hyperliquid): prioritize agent wallet and propagate active address
aldin4u Jan 8, 2026
ef605f2
fix(hyperliquid): enforce agent usage and link history card
aldin4u Jan 8, 2026
0432f17
fix(hyperliquid): unconditional agent usage
aldin4u Jan 8, 2026
b94b29c
fix(ui): robust position display with fallback metadata
aldin4u Jan 8, 2026
90f8c4e
Implemented local encryption storage and UI fixes
aldin4u Jan 8, 2026
23834ea
feat: Refine Perps agent flow, validation, and UI
aldin4u Jan 8, 2026
e47f8f3
fix(test): mock VITE_SWAP_BUTTON_SWITCH env var in CardSwap test
aldin4u Jan 8, 2026
d866e19
fix(test): use vi.stubEnv for VITE_SWAP_BUTTON_SWITCH mock
aldin4u Jan 8, 2026
0fc70a2
feat: enhance keystore security, refine UI scale and loading states
aldin4u Jan 9, 2026
db30a2e
fix: correct deposit check to use EOA balance and cleanup logs
aldin4u Jan 9, 2026
5a6a330
pushing all the changes done
vignesha22 Jan 9, 2026
8adcbda
Merge branch 'perps' of github.com:pillarwallet/x into perps
vignesha22 Jan 9, 2026
f11477a
Revert "fix: correct deposit check to use EOA balance and cleanup logs"
vignesha22 Jan 9, 2026
97056f2
feat: add perps app to local allowed apps list
vignesha22 Jan 9, 2026
e2a7abd
feat: mandatory pillarx builder approval
aldin4u Jan 10, 2026
425b628
fix(ui): prevent mobile zoom, add copy buttons, autofocus pin
aldin4u Jan 10, 2026
7d338b7
feat(auth): add privy passkey creation to portfolio tile
aldin4u Jan 10, 2026
d5938d6
fix: resolve builder address type mismatch in keystore
aldin4u Jan 10, 2026
9ab23a9
feat: improve mobile PIN input auto-focus
aldin4u Jan 10, 2026
e448eea
fix: resolve invalid builder param type in order payload and dynamic …
aldin4u Jan 10, 2026
ae0f838
fix: correct relative import path for utils/blockchain in client.ts
aldin4u Jan 10, 2026
1e63d6b
feat: separate import account flow using imported private key and eve…
aldin4u Jan 10, 2026
29afd3b
fix: skip builder fee for imported accounts and fix sdk private key u…
aldin4u Jan 10, 2026
adef24d
Fix leverage label visibility and builder fee exemption for imported …
aldin4u Jan 12, 2026
128f99a
Fix deployment build failure by adding .npmrc to prevent git config e…
aldin4u Jan 15, 2026
578c895
Skip patch-package in Cloudflare Pages to prevent git config errors
aldin4u Jan 15, 2026
ce7d078
Remove postinstall script to fix Cloudflare Pages deployment
aldin4u Jan 15, 2026
cf90f30
package lock updated
RanaBug Jan 15, 2026
56c8e4d
fix: implement proper withdraw3 signing with master wallet
aldin4u Jan 19, 2026
48807cb
fix: add type module to package.json for Cloudflare Pages build
aldin4u Jan 19, 2026
da3164d
fix: address 7 CodeRabbit review issues
aldin4u Jan 19, 2026
178abb0
fix: add missing Tailwind tokens and animations
aldin4u Jan 19, 2026
1f13cb9
fix: improve mobile components React best practices
aldin4u Jan 19, 2026
69ff7bc
fix: convert config files to ESM and fix sidebar SSR issue
aldin4u Jan 19, 2026
7506c20
fix(perps): resolve PR #489 comments and build failure
aldin4u Jan 19, 2026
1ab9b85
Revert "fix(perps): resolve PR #489 comments and build failure"
aldin4u Jan 20, 2026
1b4d117
fix(perps): re-export roundToSzDecimals to fix build failure
aldin4u Jan 20, 2026
2d050fd
fix(privy): add validation for VITE_PRIVY_APP_ID to prevent silent fa…
aldin4u Jan 20, 2026
48d4d1e
fix(privy): add fallback to default Privy App ID for production builds
aldin4u Jan 20, 2026
0ceec49
revert: remove hardcoded Privy App ID fallback to test env vars
aldin4u Jan 20, 2026
04acd02
fix(build): revert to staging build script to fix env var handling
aldin4u Jan 20, 2026
ebf4981
style: fix indentation in Main.tsx
aldin4u Jan 20, 2026
eca3b16
fix(signing): add type casts for withdraw primaryType to resolve viem…
aldin4u Jan 20, 2026
f6ccf89
fix(build): re-add NODE_OPTIONS to prevent heap out of memory error
aldin4u Jan 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Disable git operations during npm install to prevent issues in CI/CD environments
# This fixes the git config error during Cloudflare Pages deployment
unsafe-perm=true
ignore-scripts=false

# Configure git to use system config only
git-tag-version=false
Comment on lines +6 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

git-tag-version npm config setting documentation

💡 Result:

Summary: The npm config key git-tag-version (boolean, default: true) controls whether npm version creates a git commit and tag. Set it per-project in .npmrc or globally with npm config set.

Examples:

  • Disable globally: npm config set git-tag-version false. [1][2]
  • Disable per-repo: add git-tag-version=false to the repository's .npmrc. [1][2]

References:

  • npm docs (npm version / config: git-tag-version). [1]
  • Example / discussion (Stack Overflow). [2]

🌐 Web query:

npm install git config errors CI/CD environment solutions

💡 Result:

Here are concise, practical fixes for common "npm install" + git/config errors in CI/CD, with quick actionable commands and references.

  1. Authentication to private Git repos or registries
  • Use CI secrets + project .npmrc: add //registry.npmjs.org/:_authToken=${NPM_TOKEN} and set NPM_TOKEN in CI secrets. [1]
  • For Git-hosted deps, prefer git+https with a token or use SSH keys (deploy key) + ssh-agent in the runner. Example: "pkg": "git+https://<user>:<token>@gitlab.com/group/repo.git#tag" or "git+ssh://[email protected]/group/repo.git#tag". [2][3]
  1. Ensure git auth scheme used by CI (ssh vs https)
  • Rewrite URLs in CI to match available auth: set git config replacement so SSH URLs use HTTPS with CI token:
    git config --global url."https://gitlab-ci-token:[TOKEN]@gitlab.com/".insteadOf "ssh://[email protected]/"
    This lets npm fetch private git deps in pipelines. [4][5]
  1. SSH keys/agent in CI
  • Install private key as secret, start ssh-agent, add key, and ensure known_hosts contains host (or use StrictHostKeyChecking=no carefully). Many CI images need ssh-agent setup before npm install. [3]
  1. npm registry 401 / token scope & expiry
  • Use granular tokens with correct scopes for private registries (read:packages or appropriate scopes). Store token as secret and use project .npmrc with ${ENV_VAR}. Rotate tokens per provider rules. [1][6]
  1. git config user/email & permission scope errors
  • If build steps run as root (sudo), git config may be different. Set required git config in the pipeline before npm install:
    git config --global user.name "CI Bot"
    git config --global user.email "[email protected]"
    Also check git config --global url."https://github.com/".insteadof "ssh://git@github.com/" when needed. [5]
  1. npm client / environment issues
  • Avoid running npm install with sudo; ensure correct user has access to SSH keys and .gitconfig.
  • Upgrade npm if you hit known bugs (some git install bugs fixed in newer npm versions). [5]
  1. Debugging tips (quick)
  • Print effective .npmrc and git config in CI job (mask tokens) to verify injected values.
  • Try cloning the dependency repo manually inside the CI job to isolate git vs npm issues.
  • Check CI provider docs for built‑in token variables (e.g., CI_JOB_TOKEN) and any known registry bugs. [1][6]

References

  • Use private packages in CI/CD (npm docs). [1]
  • Installing private GitHub/GitLab deps (Stack Overflow / advice for git+https & tokens). [2][7]
  • GitLab CI: ssh vs https auth for git dependencies (GitLab issue / examples using git config rewrite). [3][4]
  • Stack Overflow: git config insteadOf and npm/git install fixes. [5]
  • CircleCI / provider notes on 401 and token policies (token scope/rotation). [6]

If you want, tell me: (a) your CI provider (GitHub Actions / GitLab / CircleCI / Jenkins / other), (b) whether you prefer SSH or token-based HTTPS, and I’ll give you an exact pipeline snippet to fix it.


🌐 Web query:

npm config settings disable git operations during install

💡 Result:

Short answer — two practical ways:

  1. Force offline (no network/git calls):
  • npm install --offline
  • or npm config set offline true
    (uses npm’s offline mode which prevents network requests). [1]
  1. Prevent npm from invoking the git binary:
  • npm config set git /bin/false (on Windows set to a nonexistent path or a harmless executable)
    This makes npm’s configured git command fail, so git-based installs will not run. Note: packages that specify git URLs will then fail to install. [2]

Sources:
[1] npm config docs — offline/prefer-offline.
[2] npm config docs — git (command to use for git operations).


Update the .npmrc comment to accurately reflect git-tag-version=false.

The comment "Configure git to use system config only" is misleading. The git-tag-version=false setting only prevents npm from creating a git commit and tag during the npm version command. It does not affect npm install operations or git configuration usage.

If this was added to address git config errors during npm install (as suggested in the PR objectives), this setting won't help. Update the comment to clarify the actual purpose: "Disable automatic git tag creation during version bumps" or similar.

🤖 Prompt for AI Agents
In @.npmrc around lines 6 - 7, The comment above the git-tag-version=false
setting is misleading; change it to accurately state its effect (it disables
automatic git commit/tag creation during npm version bumps). Update the comment
that precedes git-tag-version=false to something like "Disable automatic git
commit and tag creation during npm version bumps" so it correctly documents the
purpose of the git-tag-version=false config.

118 changes: 118 additions & 0 deletions Builders codes/fetch_builder_data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
const https = require('https');
const fs = require('fs');
const lz4js = require('lz4js');

const builderAddress = '0x5e1d081488a5e746c1a13bf92103c1b9ee5962a2';
// 2026-01-12 is today. Let's check 12, 11, 10.
const dates = ['20260112', '20260111', '20260110', '20260109'];

async function fetchAndProcess(date) {
const url = `https://stats-data.hyperliquid.xyz/Mainnet/builder_fills/${builderAddress}/${date}.csv.lz4`;
// console.log(`Fetching ${url}...`);

return new Promise((resolve) => {
https.get(url, (res) => {
if (res.statusCode !== 200) {
// console.log(`No data for ${date} (Status: ${res.statusCode})`);
resolve(null);
return;
}

const chunks = [];
res.on('data', chunk => chunks.push(chunk));
res.on('end', () => {
const buffer = Buffer.concat(chunks);
try {
const decompressed = lz4js.decompress(buffer);
const csv = Buffer.from(decompressed).toString('utf8');
resolve({ date, csv });
} catch (e) {
console.error(`Error decompressing ${date}:`, e.message);
resolve(null);
}
});
res.on('error', () => resolve(null));
});
});
Comment on lines +13 to +36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Missing error handler on the request object.

The https.get call returns a request object that can emit errors (e.g., DNS failures, connection refused). Currently only response-level errors are handled, but request-level errors would leave the promise hanging.

Proposed fix
     return new Promise((resolve) => {
-        https.get(url, (res) => {
+        const req = https.get(url, (res) => {
             if (res.statusCode !== 200) {
                 // console.log(`No data for ${date} (Status: ${res.statusCode})`);
                 resolve(null);
                 return;
             }

             const chunks = [];
             res.on('data', chunk => chunks.push(chunk));
             res.on('end', () => {
                 const buffer = Buffer.concat(chunks);
                 try {
                     const decompressed = lz4js.decompress(buffer);
                     const csv = Buffer.from(decompressed).toString('utf8');
                     resolve({ date, csv });
                 } catch (e) {
                     console.error(`Error decompressing ${date}:`, e.message);
                     resolve(null);
                 }
             });
             res.on('error', () => resolve(null));
         });
+        req.on('error', () => resolve(null));
     });
🤖 Prompt for AI Agents
In @Builders codes/fetch_builder_data.js around lines 13 - 36, The Promise can
hang because errors emitted by the request returned from https.get are not
handled; capture the request object returned by https.get(...) (the value
currently not stored) and attach a 'error' listener on it that resolves null
(and optionally logs the error) so DNS/connection-level failures don't leave the
promise unresolved; keep the existing response error handling on the 'res'
object and ensure you only resolve once in either the response end/error
handlers or the request 'error' handler.

}

function parseCSV(csv) {
const lines = csv.trim().split('\n');
const headers = lines[0].split(',');
const data = [];
for (let i = 1; i < lines.length; i++) {
const values = lines[i].split(',');
const row = {};
headers.forEach((h, index) => {
row[h] = values[index];
});
data.push(row);
}
return data;
}

async function main() {
const results = [];
for (const date of dates) {
const result = await fetchAndProcess(date);
if (result) {
results.push(result);
}
}

if (results.length === 0) {
console.log("No builder referral data found for the last 3-4 days.");
return;
}

console.log("Builder Code Referrals (Last available data):");
let totalFees = 0;
const uniqueUsers = new Set();
const dailyStats = {};

results.forEach(({ date, csv }) => {
const records = parseCSV(csv);
let dailyFees = 0;
let dailyUsers = new Set();

records.forEach(r => {
const fee = parseFloat(r.builder_fee || 0);
dailyFees += fee;
totalFees += fee;
if (r.user) {
uniqueUsers.add(r.user);
dailyUsers.add(r.user);
}
});

dailyStats[date] = {
fees: dailyFees,
users: dailyUsers.size,
transactions: records.length
};
});

console.table(dailyStats);
console.log(`\nTotal Builder Fees: ${totalFees.toFixed(6)} USDC`);
console.log(`Total Unique Users: ${uniqueUsers.size}`);

console.log("\nUser Breakdown:");
const userBreakdown = {};
results.forEach(({ csv }) => {
const records = parseCSV(csv);
records.forEach(r => {
if (r.user) {
if (!userBreakdown[r.user]) {
userBreakdown[r.user] = 0;
}
userBreakdown[r.user] += parseFloat(r.builder_fee || 0);
}
});
});

Object.entries(userBreakdown).forEach(([user, fee]) => {
console.log(`User: ${user}, Total Fee: ${fee.toFixed(6)} USDC`);
});
}

main();
14 changes: 14 additions & 0 deletions Builders codes/node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Builders codes/node_modules/lz4js/.eslintrc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Builders codes/node_modules/lz4js/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Builders codes/node_modules/lz4js/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions Builders codes/node_modules/lz4js/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading