Skip to content

[feat] LilSwap - Add aggregators and fees adapters#6375

Merged
bheluga merged 14 commits intoDefiLlama:masterfrom
InkCrypto:feat/lilswap-aggregators-fees
Apr 13, 2026
Merged

[feat] LilSwap - Add aggregators and fees adapters#6375
bheluga merged 14 commits intoDefiLlama:masterfrom
InkCrypto:feat/lilswap-aggregators-fees

Conversation

@InkCrypto
Copy link
Copy Markdown
Contributor

@InkCrypto InkCrypto commented Apr 11, 2026

Summary

Adds LilSwap dimension adapters for:

  • Aggregators
  • Fees

Links

Methodology

Volume

Counts the USD notional of all confirmed LilSwap swaps from LilSwap's public daily metrics endpoint, including zero-fee swaps.

Fees

Counts explicit LilSwap fees from confirmed swaps. Zero-fee swaps remain in volume but do not contribute to fees.

Revenue

LilSwap retained explicit swap fees, sourced from LilSwap's public daily metrics and computed as total explicit fees minus the external partner fee share.

ProtocolRevenue

Same as daily revenue, computed from the explicit fee split as dailyFees minus dailySupplySideRevenue.

SupplySideRevenue

External partner fee share sourced from LilSwap's public daily metrics endpoint.


Name (to be shown on DefiLlama):

LilSwap

Twitter Link:

https://x.com/LilSwap_

List of audit links if any:

N/A

Website Link:

https://lilswap.xyz

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

https://app.lilswap.xyz/favicon.png

Current TVL:

N/A (non-custodial; this PR adds dimensions only)

Treasury Addresses (if the protocol has treasury)

N/A

Chain:

Ethereum, BNB Chain, Polygon, Base, Arbitrum, Avalanche, Optimism, Gnosis, Sonic

Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed):
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed):
Short Description (to be shown on DefiLlama):

Non-custodial swap automation for Aave-related position management and token swaps.

Token address and ticker if any:

N/A

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

Aggregator

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

N/A for this PR

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

This PR does not add a TVL adapter. It adds aggregator volume and fees adapters sourced from LilSwap's public daily metrics endpoint.

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

https://docs.llama.fi/list-your-project/other-dashboards

forkedFrom (Does your project originate from another project):

No

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

N/A for this PR. LilSwap is non-custodial and this PR adds dimensions only.

Github org/user (Optional, if your code is open source, we can track activity):

InkCrypto

Does this project have a referral program?

No

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

Caution

Review failed

Pull request was closed or merged during review

Summary by CodeRabbit

  • New Features
    • Added LilSwap daily metrics integration, providing access to daily volume, fees, revenue, supply-side revenue, and protocol revenue data
    • Supports multiple blockchain networks for comprehensive data aggregation
    • Includes detailed methodology documentation explaining fee derivations and revenue calculations

Walkthrough

A new LilSwap adapter module is introduced that fetches daily protocol metrics including volume, fees, revenue, and supply-side revenue. The adapter targets specific blockchain chains via a chain aliases map and requests data from LilSwap's public endpoint, then populates standardized balance containers with the retrieved USD values.

Changes

Cohort / File(s) Summary
LilSwap Adapter
aggregators/lilswap/index.ts
New adapter module for fetching daily metrics. Implements fetch function to request data from LilSwap endpoint, locate records matching requested date, and populate dailyVolume, dailyFees, dailyRevenue, dailyProtocolRevenue, and dailySupplySideRevenue. Includes chain-specific support and comprehensive methodology documentation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

aggregators, fees

🚥 Pre-merge checks | ✅ 4 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Breakdown Methodology Check ❓ Inconclusive Unable to locate the LilSwap fees adapter file in the repository despite extensive searching. Files aggregators/lilswap/index.ts and fees/lilswap/index.ts could not be accessed. Verify that the LilSwap fees adapter file exists and is accessible in the repository, then provide the file path or contents to enable verification of breakdown methodology entries.
Version 2 Required ❓ Inconclusive The lilswap adapter file cannot be found in the repository, and existing adapters do not include explicit version fields in their exports. Locate the lilswap adapter file and verify whether version: 2 must be explicitly exported or if the correct FetchV2 signature pattern satisfies the version 2 requirement.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required format [type] protocol-name - description and accurately describes the PR objective of adding LilSwap aggregators and fees adapters.
Description check ✅ Passed The PR description includes a summary, methodology for all dimensions, and completes most required form fields with relevant information about LilSwap and the dimensions being added.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 50.00%.
Income Statement Compliance ✅ Passed The LilSwap fees adapter correctly implements income statement compliance by mapping dailyFees to Gross Protocol Revenue, dailyRevenue to Gross Profit, and dailySupplySideRevenue to Cost of Funds, with the required relationship properly documented and validated.

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

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

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
Copy Markdown

The lilswap adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts aggregators lilswap

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Thu, 09 Apr 2026 21:42:35 GMT
End Date:	Fri, 10 Apr 2026 21:42:35 GMT
---------------------------------------------------

chain     | Daily volume | Start Time
---       | ---          | ---       
ethereum  | 400.00       | 1/1/2025  
bsc       | 0.00         | 1/1/2025  
polygon   | 846.00       | 1/1/2025  
base      | 11.62 k      | 1/1/2025  
arbitrum  | 106.00       | 1/1/2025  
avax      | 0.00         | 1/1/2025  
optimism  | 0.00         | 1/1/2025  
xdai      | 0.00         | 1/1/2025  
sonic     | 0.00         | 1/1/2025  
Aggregate | 12.97 k      |           

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

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

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Thu, 09 Apr 2026 21:42:43 GMT
End Date:	Fri, 10 Apr 2026 21:42:43 GMT
---------------------------------------------------

chain     | Daily fees | Daily user fees | Daily revenue | Daily protocol revenue | Daily supply side revenue | Start Time
---       | ---        | ---             | ---           | ---                    | ---                       | ---       
ethereum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
bsc       | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
polygon   | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
base      | 10.00      | 10.00           | 9.00          | 9.00                   | 2.00                      | 1/1/2025  
arbitrum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
avax      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
optimism  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
xdai      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
sonic     | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
Aggregate | 10.00      | 10.00           | 9.00          | 9.00                   | 2.00                      |           

Copy link
Copy Markdown
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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@fees/lilswap/index.ts`:
- Around line 21-30: Add a breakdownMethodology object and convert unlabeled
aggregate returns into label-keyed breakdowns: update the adapter's methodology
to include a breakdownMethodology entry that documents every label you will use
(e.g., "explicitFees", "revenueRetained", "supplySide"), then change the value
construction (the place that calls getLilSwapFees and/or where results are
returned in fetch) to populate labeled breakdowns for Fees, Revenue,
ProtocolRevenue, and SupplySideRevenue (use .add() style labels in your internal
construction or equivalent return shape) and ensure fetch still calls
fetchLilSwapDailyMetrics(options) and maps that row through getLilSwapFees to
produce the labeled structure; include descriptions in breakdownMethodology for
each label (even single-source labels) to satisfy repo standards.

In `@helpers/lilswap.ts`:
- Around line 52-75: Add concise JSDoc comments to the three exported helper
functions: fetchLilSwapDailyMetrics, getLilSwapVolume, and getLilSwapFees; for
fetchLilSwapDailyMetrics document the options parameter (type FetchOptions),
explain it may return a LilSwapMetricsRow or null when chain is invalid or data
missing and describe start/end timestamps and chain behavior; for
getLilSwapVolume and getLilSwapFees document that they accept a
LilSwapMetricsRow | null, explain null-safe behavior (returns parsed numeric
metrics, defaulting to 0 or parsed result when row is null/fields missing), and
specify return types (number for getLilSwapVolume and an object with dailyFees,
dailyUserFees, dailyRevenue, dailyProtocolRevenue, dailySupplySideRevenue for
getLilSwapFees).
- Around line 58-60: Remove the cross-chain fallback in the row lookup: change
the assignment that currently uses response.data?.find((entry) =>
entry.chain.toLowerCase() === chain) ?? response.data?.[0] so it only returns
the exact match (e.g., response.data?.find((entry) => entry.chain.toLowerCase()
=== chain) ?? null) and ensure the function returns null when no matching chain
row is found; update the use of the variable row and the final return to reflect
this (no fallback to response.data?.[0]) so metrics are not misattributed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fa0a0761-ba1c-4f82-a377-193705fba43c

📥 Commits

Reviewing files that changed from the base of the PR and between bfe8c54 and c51948f.

📒 Files selected for processing (3)
  • aggregators/lilswap/index.ts
  • fees/lilswap/index.ts
  • helpers/lilswap.ts

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts aggregators lilswap

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Thu, 09 Apr 2026 21:53:12 GMT
End Date:	Fri, 10 Apr 2026 21:53:12 GMT
---------------------------------------------------

chain     | Daily volume | Start Time
---       | ---          | ---       
ethereum  | 400.00       | 1/1/2025  
bsc       | 0.00         | 1/1/2025  
polygon   | 846.00       | 1/1/2025  
base      | 11.62 k      | 1/1/2025  
arbitrum  | 106.00       | 1/1/2025  
avax      | 0.00         | 1/1/2025  
optimism  | 0.00         | 1/1/2025  
xdai      | 0.00         | 1/1/2025  
sonic     | 0.00         | 1/1/2025  
Aggregate | 12.97 k      |           

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

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

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Thu, 09 Apr 2026 21:53:23 GMT
End Date:	Fri, 10 Apr 2026 21:53:23 GMT
---------------------------------------------------

chain     | Daily fees | Daily user fees | Daily revenue | Daily protocol revenue | Daily supply side revenue | Start Time
---       | ---        | ---             | ---           | ---                    | ---                       | ---       
ethereum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
bsc       | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
polygon   | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
base      | 10.00      | 10.00           | 9.00          | 9.00                   | 2.00                      | 1/1/2025  
arbitrum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
avax      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
optimism  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
xdai      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
sonic     | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
Aggregate | 10.00      | 10.00           | 9.00          | 9.00                   | 2.00                      |           

@InkCrypto InkCrypto changed the title Add LilSwap aggregators and fees adapters [feat] LilSwap - Add aggregators and fees adapters Apr 11, 2026
Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@fees/lilswap/index.ts`:
- Around line 17-21: Update the destination-explicit labels in the LABELS
constant and corresponding entries in breakdownMethodology: change the "REVENUE"
value from "LilSwap Retained Fees" to "Explicit Swap Fees To Protocol" and the
"SUPPLY_SIDE" value from "External Fee Share" to "Explicit Swap Fees To External
Partners", and mirror those exact strings wherever breakdownMethodology refers
to the retained-fees / external-fee-share labels so the dailyRevenue and
dailySupplySideRevenue dimensions use source→destination wording; locate and
update the LABELS constant and the breakdownMethodology object to apply these
new strings.

In `@helpers/lilswap.ts`:
- Around line 87-95: The getLilSwapFees function currently returns dailyFees,
dailyRevenue, and dailySupplySideRevenue independently which can produce
inconsistent totals; update getLilSwapFees to compute one value from the others
(e.g., compute dailyRevenue = parseMetric(row?.feesUsd) -
parseMetric(row?.supplySideRevenueUsd)) and set dailyFees =
parseMetric(row?.feesUsd) and dailySupplySideRevenue =
parseMetric(row?.supplySideRevenueUsd), keep dailyUserFees consistent (e.g.,
equal to dailyFees or derived per spec), and add validation that the derived
dailyRevenue is non-negative (throw or return null/error if validation fails) so
the adapter always satisfies the fees mapping contract; use the existing
parseMetric helper and reference getLilSwapFees, parseMetric, and the
LilSwapMetricsRow fields feesUsd and supplySideRevenueUsd when making the
change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 99eca0c5-c584-487f-881f-67f60efdae13

📥 Commits

Reviewing files that changed from the base of the PR and between c51948f and 10fbac3.

📒 Files selected for processing (2)
  • fees/lilswap/index.ts
  • helpers/lilswap.ts

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts aggregators lilswap

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Thu, 09 Apr 2026 22:08:51 GMT
End Date:	Fri, 10 Apr 2026 22:08:51 GMT
---------------------------------------------------

chain     | Daily volume | Start Time
---       | ---          | ---       
ethereum  | 400.00       | 1/1/2025  
bsc       | 0.00         | 1/1/2025  
polygon   | 168.75 k     | 1/1/2025  
base      | 11.62 k      | 1/1/2025  
arbitrum  | 106.00       | 1/1/2025  
avax      | 0.00         | 1/1/2025  
optimism  | 0.00         | 1/1/2025  
xdai      | 0.00         | 1/1/2025  
sonic     | 0.00         | 1/1/2025  
Aggregate | 180.88 k     |           

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

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

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Thu, 09 Apr 2026 22:09:04 GMT
End Date:	Fri, 10 Apr 2026 22:09:04 GMT
---------------------------------------------------

chain     | Daily fees | Daily user fees | Daily revenue | Daily protocol revenue | Daily supply side revenue | Start Time
---       | ---        | ---             | ---           | ---                    | ---                       | ---       
ethereum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
bsc       | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
polygon   | 34.00      | 34.00           | 29.00         | 29.00                  | 5.00                      | 1/1/2025  
base      | 10.00      | 10.00           | 9.00          | 9.00                   | 2.00                      | 1/1/2025  
arbitrum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
avax      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
optimism  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
xdai      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
sonic     | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
Aggregate | 44.00      | 44.00           | 38.00         | 38.00                  | 7.00                      |           

Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@helpers/lilswap.ts`:
- Around line 65-67: The code calls entry.chain.toLowerCase() on external data;
add a defensive type guard before that call in the logic that computes row (the
response from fetchURL as LilSwapMetricsResponse). Ensure you verify entry.chain
is a string (e.g., typeof entry.chain === "string") before calling toLowerCase,
and skip or treat non-strings as non-matching rows so you don't throw; update
the matching expression that compares to the local chain variable (and/or
normalize the local chain once) in the same block to use the guarded,
lower-cased value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e86dde44-2945-4337-bec4-098920b59753

📥 Commits

Reviewing files that changed from the base of the PR and between 10fbac3 and 3809078.

📒 Files selected for processing (2)
  • fees/lilswap/index.ts
  • helpers/lilswap.ts

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts aggregators lilswap

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Thu, 09 Apr 2026 22:17:10 GMT
End Date:	Fri, 10 Apr 2026 22:17:10 GMT
---------------------------------------------------

chain     | Daily volume | Start Time
---       | ---          | ---       
ethereum  | 400.00       | 1/1/2025  
bsc       | 0.00         | 1/1/2025  
polygon   | 168.75 k     | 1/1/2025  
base      | 11.62 k      | 1/1/2025  
arbitrum  | 106.00       | 1/1/2025  
avax      | 0.00         | 1/1/2025  
optimism  | 0.00         | 1/1/2025  
xdai      | 0.00         | 1/1/2025  
sonic     | 0.00         | 1/1/2025  
Aggregate | 180.88 k     |           

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

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

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Thu, 09 Apr 2026 22:17:18 GMT
End Date:	Fri, 10 Apr 2026 22:17:18 GMT
---------------------------------------------------

chain     | Daily fees | Daily user fees | Daily revenue | Daily protocol revenue | Daily supply side revenue | Start Time
---       | ---        | ---             | ---           | ---                    | ---                       | ---       
ethereum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
bsc       | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
polygon   | 34.00      | 34.00           | 29.00         | 29.00                  | 5.00                      | 1/1/2025  
base      | 10.00      | 10.00           | 9.00          | 9.00                   | 2.00                      | 1/1/2025  
arbitrum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
avax      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
optimism  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
xdai      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
sonic     | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
Aggregate | 44.00      | 44.00           | 38.00         | 38.00                  | 7.00                      |           

@InkCrypto
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts aggregators lilswap

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Fri, 10 Apr 2026 00:06:34 GMT
End Date:	Sat, 11 Apr 2026 00:06:34 GMT
---------------------------------------------------

chain     | Daily volume | Start Time
---       | ---          | ---       
ethereum  | 400.00       | 1/1/2025  
bsc       | 0.00         | 1/1/2025  
polygon   | 168.75 k     | 1/1/2025  
base      | 41.33 k      | 1/1/2025  
arbitrum  | 143.98 k     | 1/1/2025  
avax      | 0.00         | 1/1/2025  
optimism  | 0.00         | 1/1/2025  
xdai      | 0.00         | 1/1/2025  
sonic     | 0.00         | 1/1/2025  
Aggregate | 354.46 k     |           

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

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

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Fri, 10 Apr 2026 00:06:49 GMT
End Date:	Sat, 11 Apr 2026 00:06:49 GMT
---------------------------------------------------

chain     | Daily fees | Daily user fees | Daily revenue | Daily protocol revenue | Daily supply side revenue | Start Time
---       | ---        | ---             | ---           | ---                    | ---                       | ---       
ethereum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
bsc       | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
polygon   | 34.00      | 34.00           | 29.00         | 29.00                  | 5.00                      | 1/1/2025  
base      | 13.00      | 13.00           | 11.00         | 11.00                  | 2.00                      | 1/1/2025  
arbitrum  | 34.00      | 34.00           | 29.00         | 29.00                  | 5.00                      | 1/1/2025  
avax      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
optimism  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
xdai      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
sonic     | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
Aggregate | 81.00      | 81.00           | 69.00         | 69.00                  | 12.00                     |           

@InkCrypto InkCrypto marked this pull request as ready for review April 11, 2026 02:37
@InkCrypto
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@helpers/lilswap.ts`:
- Around line 42-47: parseMetric currently treats an empty string as numeric
because Number("") === 0; add an explicit blank-string guard so that if value is
a string and value.trim() === "" the function throws the same Error as
non-finite values. Update parseMetric to check for typeof value === "string" &&
value.trim() === "" before Number(value) and throw new Error(`LilSwap metric
field=${fieldName} is not numeric: ${String(value)}`), and apply the same
blank-string guard pattern to the analogous parsing helper in neony to keep
behavior consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6a19559b-6224-4d53-b5fe-20beb7c60aff

📥 Commits

Reviewing files that changed from the base of the PR and between ce025d0 and 11fed43.

📒 Files selected for processing (2)
  • helpers/lilswap.ts
  • helpers/lilswapConfig.ts

…terns

- Added defensive check in parseMetric to throw on empty/whitespace strings, preventing silent coercion to 0.
- Removed process.env override for BASE_URL to align with standard repository helper patterns.
- Simplified return logic in fetchLilSwapDailyMetrics.
@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts aggregators lilswap

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Fri, 10 Apr 2026 00:58:59 GMT
End Date:	Sat, 11 Apr 2026 00:58:59 GMT
---------------------------------------------------

chain     | Daily volume | Start Time
---       | ---          | ---       
ethereum  | 400.00       | 1/1/2025  
bsc       | 0.00         | 1/1/2025  
polygon   | 168.75 k     | 1/1/2025  
base      | 33.28 k      | 1/1/2025  
arbitrum  | 143.92 k     | 1/1/2025  
avax      | 0.00         | 1/1/2025  
optimism  | 0.00         | 1/1/2025  
xdai      | 0.00         | 1/1/2025  
sonic     | 0.00         | 1/1/2025  
Aggregate | 346.35 k     |           

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

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

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Fri, 10 Apr 2026 00:59:09 GMT
End Date:	Sat, 11 Apr 2026 00:59:09 GMT
---------------------------------------------------

chain     | Daily fees | Daily user fees | Daily revenue | Daily protocol revenue | Daily supply side revenue | Start Time
---       | ---        | ---             | ---           | ---                    | ---                       | ---       
ethereum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
bsc       | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
polygon   | 34.00      | 34.00           | 29.00         | 29.00                  | 5.00                      | 1/1/2025  
base      | 12.00      | 12.00           | 10.00         | 10.00                  | 2.00                      | 1/1/2025  
arbitrum  | 34.00      | 34.00           | 29.00         | 29.00                  | 5.00                      | 1/1/2025  
avax      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
optimism  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
xdai      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
sonic     | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
Aggregate | 80.00      | 80.00           | 68.00         | 68.00                  | 12.00                     |           

@bheluga bheluga self-assigned this Apr 11, 2026
@bheluga
Copy link
Copy Markdown
Member

bheluga commented Apr 11, 2026

@InkCrypto thanks for the PR.
Can i get smart contract addresses of the project?
Also can you try to track volume and fees onchain

@InkCrypto
Copy link
Copy Markdown
Contributor Author

@InkCrypto thanks for the PR. Can i get smart contract addresses of the project? Also can you try to track volume and fees onchain

Hi @bheluga.

LilSwap is non-custodial and does not have a LilSwap-specific smart contract. The app coordinates user-triggered collateral swap and debt swap flows by interacting directly with Aave contracts.

Because of that, providing only the Aave contract addresses would not be enough to attribute volume or fees to LilSwap. Those contracts are public and can be used by anyone, so onchain activity from those addresses alone would include transactions unrelated to our app.

Our attribution source is the transaction set generated through LilSwap itself. Since day 1, we have persisted the transaction hashes for every transaction routed through the app, and our metrics endpoint is derived from that execution history.

If helpful, we can share sample transaction hashes or more detail about how we attribute volume and fees from that dataset.

@bheluga
Copy link
Copy Markdown
Member

bheluga commented Apr 11, 2026

@InkCrypto thanks for the PR. Can i get smart contract addresses of the project? Also can you try to track volume and fees onchain

Hi @bheluga.

LilSwap is non-custodial and does not have a LilSwap-specific smart contract. The app coordinates user-triggered collateral swap and debt swap flows by interacting directly with Aave contracts.

Because of that, providing only the Aave contract addresses would not be enough to attribute volume or fees to LilSwap. Those contracts are public and can be used by anyone, so onchain activity from those addresses alone would include transactions unrelated to our app.

Our attribution source is the transaction set generated through LilSwap itself. Since day 1, we have persisted the transaction hashes for every transaction routed through the app, and our metrics endpoint is derived from that execution history.

If helpful, we can share sample transaction hashes or more detail about how we attribute volume and fees from that dataset.

Yes , plz provide an example transaction hash, we can then decide what to be done

@InkCrypto
Copy link
Copy Markdown
Contributor Author

Yes , plz provide an example transaction hash, we can then decide what to be done

Here is a small sample of confirmed transactions routed through LilSwap across multiple chains. These are persisted in our execution history and are part of the dataset used by our metrics endpoint.

These are examples of transactions attributed through the execution history recorded by LilSwap itself.

If another format would be easier for validation, please let me know.

@llamabutler
Copy link
Copy Markdown

The lilswap adapter exports:

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

🦙 Running LILSWAP adapter 🦙
---------------------------------------------------
Start Date:	Sun, 12 Apr 2026 08:04:00 GMT
End Date:	Mon, 13 Apr 2026 08:04:00 GMT
---------------------------------------------------

chain     | Daily fees | Daily user fees | Daily revenue | Daily protocol revenue | Daily supply side revenue | Start Time
---       | ---        | ---             | ---           | ---                    | ---                       | ---       
ethereum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
bsc       | 3.00       | 3.00            | 2.00          | 2.00                   | 0.00                      | 1/1/2025  
polygon   | 3.00       | 3.00            | 3.00          | 3.00                   | 0.00                      | 1/1/2025  
base      | 13.00      | 13.00           | 11.00         | 11.00                  | 2.00                      | 1/1/2025  
arbitrum  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
avax      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
optimism  | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
xdai      | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
sonic     | 0.00       | 0.00            | 0.00          | 0.00                   | 0.00                      | 1/1/2025  
Aggregate | 19.00      | 19.00           | 16.00         | 16.00                  | 2.00                      |           

@bheluga bheluga merged commit 675c110 into DefiLlama:master Apr 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants