Skip to content

hikari reapplication for defi Llama#5789

Open
azkawm wants to merge 11 commits intoDefiLlama:masterfrom
azkawm:master
Open

hikari reapplication for defi Llama#5789
azkawm wants to merge 11 commits intoDefiLlama:masterfrom
azkawm:master

Conversation

@azkawm
Copy link

@azkawm azkawm commented Feb 1, 2026

NOTE

Please enable "Allow edits by maintainers" while putting up the PR.


  • If you would like to add a tvl adapter please submit the PR here.
  1. Once your adapter has been merged, it takes time to show on the UI. If more than 24 hours have passed, please let us know in Discord.
  2. Please fill the form below only if the PR is for listing a new protocol else it can be ignored/replaced with reason/details about the PR
  3. For updating listing info It is a different repo, you can find your listing in this file: https://github.com/DefiLlama/defillama-server/blob/master/defi/src/protocols/data4.ts, you can edit it there and put up a PR
  4. Do not edit/push package.json/package-lock.json file as part of your changes
  5. No need to go to our discord/other channel and announce that you've created a PR, we monitor all PRs and will review it asap

Name (to be shown on DefiLlama):

Hikari Finance

Twitter Link:

https://x.com/hikari_finance

List of audit links if any:

https://hashlock.com/audits/hikari-finance

Website Link:

https://hikari.finance/

Logo (High resolution, will be shown with rounded borders):

KARI Logo.png.zip

Current TVL:

$ 1.185k

Treasury Addresses (if the protocol has treasury)

https://katanascan.com/address/0x2ac7673c3a0370de512a20464a800fa7c53235c3 (Liquidity Pool).

Chain:

Katana

Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama):

DeFi protocol that turns idle liquidity into yield while protecting token value with AUSD-backed floors.

Token address and ticker if any:

0xC2473b16fE99BE558Cd246cC3B610574534EfDB9 and KARI

Category (full list at https://defillama.com/categories) *Please choose only one:

Yield

Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.):

Uniswap TWAP Oracle

Implementation Details: Briefly describe how the oracle is integrated into your project:

Price Feed for AUSD/KARI

Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:

Implementation on the contract to get the price feed.

forkedFrom (Does your project originate from another project):

Uniswap V3's Concentrated Liquidity

methodology (what is being counted as tvl, how is tvl being calculated):

TVL is calculated from the current marketcap of AUSD inside the liquidity pool.
https://katanascan.com/address/0x2ac7673c3a0370de512a20464a800fa7c53235c3

Github org/user (Optional, if your code is open source, we can track activity):
Does this project have a referral program?

No

Summary by CodeRabbit

  • New Features
    • Added fee and revenue tracking for Hikari pool and staking contracts, providing daily metrics for user fees, protocol revenue, total fees, and supply-side revenue.
    • Includes conversion of staking rewards and token-based rewards into daily monetary metrics for improved financial visibility.
    • Applies a consistent revenue-splitting model to present breakdowns between user-facing fees and protocol/supply-side revenue.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 1, 2026

Warning

Rate limit exceeded

@azkawm has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 39 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

A new TypeScript fee/revenue adapter for the Hikari pool and staking contracts on the Katana chain. It ingests on-chain events (STAKED, KATANA_CLAIMED, FEE, REWARD_CLAIMED), maps rewards to USD, applies a fixed revenue-splitting model, and produces daily aggregates for user fees, protocol revenue, total revenue, and supply-side revenue.

Changes

Cohort / File(s) Summary
New Hikari Fee Adapter
fees/hikari.ts
Adds a Katana-chain fee/revenue adapter: contract address constants, event ABIs, log fetch and parsing for staking/pool events, price conversions, revenue-splitting logic (ausd -> totalFees via /0.03; 70% allocation), and exports a SimpleAdapter with metadata and start date.

Sequence Diagram(s)

sequenceDiagram
    participant Adapter as Adapter (fees/hikari.ts)
    participant RPC as Blockchain RPC
    participant Staking as Staking Contract
    participant Pool as Pool Contract
    participant Price as Price Oracle

    Adapter->>RPC: query logs (STAKED, KATANA_CLAIMED, FEE, REWARD_CLAIMED)
    RPC->>Staking: return staking logs
    RPC->>Pool: return pool logs
    Adapter->>Price: request token price for ausd/KATANA
    Price-->>Adapter: return USD prices
    Adapter->>Adapter: convert amounts, apply split (ausd / 0.03, 70% user/revenue), aggregate daily metrics
    Adapter-->>Consumer: expose dailyUserFees, dailyFees, dailyProtocolRevenue, dailyRevenue, dailySupplySideRevenue
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through logs at break of day,
Counting Katana rewards in play,
Converted, split, and rolled each sum,
Daily metrics ready — here they come! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'hikari reapplication for defi Llama' is directly related to the pull request objective of reapplying Hikari Finance as a new adapter to DefiLlama, though it uses informal phrasing.
Description check ✅ Passed The pull request description follows the template structure with most required sections completed, including protocol metadata, chain information, token details, and methodology explanation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@llamabutler
Copy link

The hikari.ts adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts dexs hikari.ts

🦙 Running HIKARI.TS adapter 🦙
---------------------------------------------------
Start Date:	Sat, 31 Jan 2026 05:37:13 GMT
End Date:	Sun, 01 Feb 2026 05:37:13 GMT
---------------------------------------------------

KATANA 👇
Backfill start time: 8/7/2025
Daily fees: 0.00
Daily revenue: 0.00
Daily volume: 0.00
End timestamp: 1769924232 (2026-02-01T05:37:12.000Z)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@dexs/hikari.ts`:
- Around line 28-31: The equality check in logs.forEach comparing log.recipient
to BASELINE_CONTRACT is case-sensitive and can miss matches; update the
comparison to normalize both sides (e.g., toLowerCase()) before comparing so
that log.recipient.toLowerCase() === BASELINE_CONTRACT.toLowerCase() is used,
ensuring dailyFees.add(AUSD_TOKEN, log.amount0) runs for matching addresses;
adjust any related references to BASELINE_CONTRACT or log.recipient comparisons
in this block to use the same normalization.
- Around line 33-37: The volume calculation currently divides swapLog.amount0 by
1e6 and calls dailyVolume.addUSDValue, which bypasses the framework pricing;
instead update the swapLogs.forEach handler to call dailyVolume.add with
AUSD_TOKEN and the absolute raw amount (use Math.abs on swapLog.amount0) so it
matches the fee pattern (dailyFees.add(AUSD_TOKEN, ...)) and lets the framework
handle token decimals and USD conversion; locate the swapLogs.forEach block and
replace the addUSDValue/division logic with dailyVolume.add(AUSD_TOKEN,
Math.abs(swapLog.amount0)).
🧹 Nitpick comments (3)
dexs/hikari.ts (3)

4-6: Minor naming inconsistency.

hikariPool uses camelCase while the other constants use SCREAMING_SNAKE_CASE. Consider renaming to HIKARI_POOL for consistency.


39-43: dailyRevenue references the same object as dailyFees.

Assigning dailyRevenue: dailyFees means both properties reference the same Balances object. If the framework mutates one after return, it will affect the other. If revenue should always equal fees for this protocol, consider creating a separate balances object or cloning.

♻️ Proposed fix: clarify intent with a comment or separate object

If the intent is that revenue equals fees:

+  // Revenue equals 100% of fees for this protocol
   return {
     dailyFees,
     dailyRevenue: dailyFees,
     dailyVolume: dailyVolume,
   };

Or create a separate balances object if independence is needed:

+  const dailyRevenue = options.createBalances();
+  logs.forEach((log) => {
+    if (log.recipient.toLowerCase() === BASELINE_CONTRACT.toLowerCase())
+      dailyRevenue.add(AUSD_TOKEN, log.amount0);
+  });
+
   return {
     dailyFees,
-    dailyRevenue: dailyFees,
+    dailyRevenue,
     dailyVolume: dailyVolume,
   };

53-58: Replace fetch: fetch as any with properly typed fetch implementation.

The as any type cast masks type errors. While CHAIN.KATANA is correctly defined in helpers/chains.ts, the fetch handler should use explicit typing instead of type casting, matching patterns used throughout the codebase (e.g., async functions with FetchOptions parameter or helper functions like getUniV2LogAdapter).

dexs/hikari.ts Outdated
Comment on lines 28 to 31
logs.forEach((log) => {
if (log.recipient === BASELINE_CONTRACT)
dailyFees.add(AUSD_TOKEN, log.amount0);
});
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 | 🔴 Critical

Case-sensitive address comparison will likely fail.

Ethereum addresses returned from event logs may be in different case formats (lowercase or checksummed). The strict equality check log.recipient === BASELINE_CONTRACT will fail if the cases don't match, causing fees to be silently ignored.

🐛 Proposed fix: normalize addresses to lowercase
 logs.forEach((log) => {
-  if (log.recipient === BASELINE_CONTRACT)
+  if (log.recipient.toLowerCase() === BASELINE_CONTRACT.toLowerCase())
     dailyFees.add(AUSD_TOKEN, log.amount0);
 });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
logs.forEach((log) => {
if (log.recipient === BASELINE_CONTRACT)
dailyFees.add(AUSD_TOKEN, log.amount0);
});
logs.forEach((log) => {
if (log.recipient.toLowerCase() === BASELINE_CONTRACT.toLowerCase())
dailyFees.add(AUSD_TOKEN, log.amount0);
});
🤖 Prompt for AI Agents
In `@dexs/hikari.ts` around lines 28 - 31, The equality check in logs.forEach
comparing log.recipient to BASELINE_CONTRACT is case-sensitive and can miss
matches; update the comparison to normalize both sides (e.g., toLowerCase())
before comparing so that log.recipient.toLowerCase() ===
BASELINE_CONTRACT.toLowerCase() is used, ensuring dailyFees.add(AUSD_TOKEN,
log.amount0) runs for matching addresses; adjust any related references to
BASELINE_CONTRACT or log.recipient comparisons in this block to use the same
normalization.

dexs/hikari.ts Outdated
Comment on lines 33 to 37
swapLogs.forEach((swapLog) => {
const amount0 = Number(swapLog.amount0) / 1e6;
if (amount0 > 0) dailyVolume.addUSDValue(amount0);
else dailyVolume.addUSDValue(-amount0);
});
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

🧩 Analysis chain

🏁 Script executed:

# Check how other DEX adapters handle swap volume calculations
rg -n -A5 'addUSDValue' --glob 'dexs/*.ts' | head -100

Repository: DefiLlama/dimension-adapters

Length of output: 5165


🏁 Script executed:

# Check for similar swap patterns with amount0/amount1
rg -n -B2 -A5 'Swap.*amount0.*amount1' --glob 'dexs/*.ts' | head -100

Repository: DefiLlama/dimension-adapters

Length of output: 7132


🏁 Script executed:

# Look at the full hikari.ts file to understand AUSD token configuration
cat dexs/hikari.ts

Repository: DefiLlama/dimension-adapters

Length of output: 1850


🏁 Script executed:

# Check if there are any token configurations or decimal references for AUSD
rg -n 'AUSD\|amount0\|1e6' dexs/hikari.ts

Repository: DefiLlama/dimension-adapters

Length of output: 54


Fix volume calculation to match fee handling and use the framework's token mechanism.

The code divides amount0 by 1e6 and passes it to addUSDValue, but this is inconsistent with how fees are correctly handled using dailyFees.add(AUSD_TOKEN, log.amount0). The swap event's amount0 is a raw contract value, not a USD value—dividing by an arbitrary decimal count does not convert it to USD. This bypasses the framework's pricing mechanism.

Use dailyVolume.add(AUSD_TOKEN, Math.abs(swapLog.amount0)) to match the fee calculation pattern and let the framework handle token decimals and USD conversion properly.

🤖 Prompt for AI Agents
In `@dexs/hikari.ts` around lines 33 - 37, The volume calculation currently
divides swapLog.amount0 by 1e6 and calls dailyVolume.addUSDValue, which bypasses
the framework pricing; instead update the swapLogs.forEach handler to call
dailyVolume.add with AUSD_TOKEN and the absolute raw amount (use Math.abs on
swapLog.amount0) so it matches the fee pattern (dailyFees.add(AUSD_TOKEN, ...))
and lets the framework handle token decimals and USD conversion; locate the
swapLogs.forEach block and replace the addUSDValue/division logic with
dailyVolume.add(AUSD_TOKEN, Math.abs(swapLog.amount0)).

Copy link
Contributor

@noateden noateden left a comment

Choose a reason for hiding this comment

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

hi, why are you counting Uniswap pool swaps as volume for hikari?

@llamabutler
Copy link

The hikari.ts adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts fees hikari.ts

🦙 Running HIKARI.TS adapter 🦙
---------------------------------------------------
Start Date:	Sun, 01 Feb 2026 03:42:08 GMT
End Date:	Mon, 02 Feb 2026 03:42:08 GMT
---------------------------------------------------

KATANA 👇
Backfill start time: 8/7/2025
Daily user fees: 0.00
Daily fees: 0.00
Daily protocol revenue: 0.00
Daily revenue: 0.00
Daily supply side revenue: 0.00
End timestamp: 1770003727 (2026-02-02T03:42:07.000Z)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@fees/hikari.ts`:
- Around line 52-54: The code is passing raw token amounts into
dailyRevenue.addUSDValue by iterating feesLogs and using feeLog.amount0; confirm
whether amount0 is a USD-denominated value (e.g. AUSD with 1:1 peg and proper
decimals) and if not, convert the token amount to USD before calling
dailyRevenue.addUSDValue: look up the token of the Collect event (feeLog token
identifier), normalize decimals for amount0, fetch or compute the token USD
price (use existing pricing helpers or oracle functions), multiply normalized
amount0 by price to get USD, and only then call dailyRevenue.addUSDValue; if
AUSD is guaranteed to be 1:1 ensure decimal normalization is applied instead of
raw amount0.
- Around line 69-75: The returned object leaves dailyFees empty; populate
dailyFees from feesLogs the same way dailyRevenue is derived so fees collected
from Collect events are reported. Locate the processing of feesLogs and the
variables dailyUserFees, dailyRevenue and dailyFees inside the function (where
feesLogs is iterated and dailyRevenue is computed) and add logic to accumulate
per-day fee amounts into dailyFees (mirroring the aggregation used for
dailyRevenue), then return the populated dailyFees alongside dailyUserFees and
dailyRevenue.
🧹 Nitpick comments (3)
fees/hikari.ts (3)

11-18: Remove unused event definitions.

SWAP_EVENT and UNSTAKED_EVENT are defined but never used in the fetch function. Consider removing them to reduce confusion about what events the adapter actually processes.

🧹 Proposed cleanup
-const SWAP_EVENT =
-  "event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick)";
-
 const STAKED_EVENT =
   "event Staked(address user, uint256 amount, address pool, uint256 time)";

-const UNSTAKED_EVENT =
-  "event Unstaked(address user, uint256 amount, address pool, uint256 time, uint256 matureTime)";
-
 const REWARD_CLAIMED_EVENT =

32-35: Remove unused log fetch.

stakedLogs is fetched but never used in the function. This is a wasted RPC call and dead code.

🧹 Proposed cleanup
-  const stakedLogs = await options.getLogs({
-    target: hikariStaking,
-    eventAbi: STAKED_EVENT,
-  });
-
   const katanaLogs = await options.getLogs({

89-89: Avoid as any type cast.

Casting to any bypasses TypeScript's type safety and can mask legitimate type errors. If there's a type mismatch with the expected fetch function signature, consider fixing the return type or using a more specific type assertion.

Comment on lines +52 to +54
feesLogs.forEach((feeLog) => {
dailyRevenue.addUSDValue(feeLog.amount0);
});
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

Verify amount0 is actually a USD value.

addUSDValue() expects a value denominated in USD, but amount0 from the Collect event is the raw token amount collected (likely in token decimals). If the collected token is not a USD-pegged stablecoin with 1:1 value, this will produce incorrect revenue figures.

Consider whether you need to convert amount0 to USD using token pricing, or if AUSD is indeed 1:1 pegged with appropriate decimal handling.

🤖 Prompt for AI Agents
In `@fees/hikari.ts` around lines 52 - 54, The code is passing raw token amounts
into dailyRevenue.addUSDValue by iterating feesLogs and using feeLog.amount0;
confirm whether amount0 is a USD-denominated value (e.g. AUSD with 1:1 peg and
proper decimals) and if not, convert the token amount to USD before calling
dailyRevenue.addUSDValue: look up the token of the Collect event (feeLog token
identifier), normalize decimals for amount0, fetch or compute the token USD
price (use existing pricing helpers or oracle functions), multiply normalized
amount0 by price to get USD, and only then call dailyRevenue.addUSDValue; if
AUSD is guaranteed to be 1:1 ensure decimal normalization is applied instead of
raw amount0.

Comment on lines +69 to +75
return {
dailyUserFees,
dailyFees,
dailyProtocolRevenue: dailyUserFees,
dailyRevenue,
dailySupplySideRevenue,
};
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

dailyFees is never populated.

dailyFees is initialized on line 28 but never has any values added to it. It's returned empty, which means the adapter will always report 0 for daily fees despite the methodology claiming to track "Fees collected from the Hikari pool's Concentrated Liquidity."

Was this intentional, or should dailyFees be populated from feesLogs similar to dailyRevenue?

🐛 Possible fix if dailyFees should mirror dailyRevenue from Collect events
   feesLogs.forEach((feeLog) => {
+    dailyFees.addUSDValue(feeLog.amount0);
     dailyRevenue.addUSDValue(feeLog.amount0);
   });
🤖 Prompt for AI Agents
In `@fees/hikari.ts` around lines 69 - 75, The returned object leaves dailyFees
empty; populate dailyFees from feesLogs the same way dailyRevenue is derived so
fees collected from Collect events are reported. Locate the processing of
feesLogs and the variables dailyUserFees, dailyRevenue and dailyFees inside the
function (where feesLogs is iterated and dailyRevenue is computed) and add logic
to accumulate per-day fee amounts into dailyFees (mirroring the aggregation used
for dailyRevenue), then return the populated dailyFees alongside dailyUserFees
and dailyRevenue.

@llamabutler
Copy link

The hikari.ts adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts fees hikari.ts

🦙 Running HIKARI.TS adapter 🦙
---------------------------------------------------
Start Date:	Sun, 01 Feb 2026 03:47:42 GMT
End Date:	Mon, 02 Feb 2026 03:47:42 GMT
---------------------------------------------------

KATANA 👇
Backfill start time: 8/7/2025
Daily user fees: 0.00
Daily fees: 0.00
Daily protocol revenue: 0.00
Daily revenue: 0.00
Daily supply side revenue: 0.00
End timestamp: 1770004061 (2026-02-02T03:47:41.000Z)

@azkawm
Copy link
Author

azkawm commented Feb 2, 2026

hi, why are you counting Uniswap pool swaps as volume for hikari?

hello I readjust and resubmit it as Yield Platforms, sorry for the hassle. Kindly see and correct it if you need necessary detail

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@fees/hikari.ts`:
- Around line 66-69: The code is dividing katanaLog.tokens by 1e6 before calling
dailySupplySideRevenue.add, but add expects raw token amounts (the framework
normalizes decimals), so remove the manual normalization; pass katanaLog.tokens
(or Number(katanaLog.tokens)) directly to
dailySupplySideRevenue.add(KATANA_TOKEN, ...) inside the katanaLogs.forEach loop
to match how rewardClaimedLog.ausd is passed.
🧹 Nitpick comments (3)
fees/hikari.ts (3)

12-19: Unused event definitions: SWAP_EVENT and UNSTAKED_EVENT.

These event ABIs are defined but never used anywhere in the code. If they're not needed for the current implementation, consider removing them to reduce dead code. If they're intended for future use, this may indicate incomplete implementation.

🧹 Remove unused event definitions
-const SWAP_EVENT =
-  "event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick)";
-
 const STAKED_EVENT =
   "event Staked(address user, uint256 amount, address pool, uint256 time)";

-const UNSTAKED_EVENT =
-  "event Unstaked(address user, uint256 amount, address pool, uint256 time, uint256 matureTime)";
-

33-36: stakedLogs is fetched but never used.

The logs are retrieved from the staking contract but are never processed or used in any calculations. This is either dead code (unnecessary RPC call) or indicates missing logic to incorporate staking data into the metrics.

🧹 Remove unused fetch if not needed
-  const stakedLogs = await options.getLogs({
-    target: hikariStaking,
-    eventAbi: STAKED_EVENT,
-  });
-

57-64: Fee calculation logic is undocumented and potentially confusing.

The calculation assumes rewardClaimed is 3% of totalFees, then allocates 70% to user fees. This reverse-engineering of fees from rewards is non-obvious and should be documented:

 rewardClaimedLogs.forEach((rewardClaimedLog) => {
   const rewardClaimed = Number(rewardClaimedLog.ausd) / 1e6;
+  // Reward claimed represents 3% of total fees; back-calculate total fees
   const totalFees = rewardClaimed / 0.03;
+  // 70% of total fees are attributed to users
   const userFees = totalFees * 0.7;

Also verify: is the 0.03 (3%) and 0.7 (70%) split documented in Hikari's fee structure?

@llamabutler
Copy link

The hikari.ts adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts fees hikari.ts

🦙 Running HIKARI.TS adapter 🦙
---------------------------------------------------
Start Date:	Sun, 01 Feb 2026 03:53:32 GMT
End Date:	Mon, 02 Feb 2026 03:53:32 GMT
---------------------------------------------------

KATANA 👇
Backfill start time: 8/7/2025
Daily user fees: 0.00
Daily fees: 0.00
Daily protocol revenue: 0.00
Daily revenue: 0.00
Daily supply side revenue: 0.00
End timestamp: 1770004411 (2026-02-02T03:53:31.000Z)

@azkawm azkawm requested a review from noateden February 2, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants