bisonfi: add fees adapter - #8398
Conversation
|
Warning Review limit reached
Next review available in: 2 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches✨ Simplify 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. Comment |
|
The bisonfi.ts adapter exports: |
There was a problem hiding this comment.
@DaniiRix thanks for the PR.
I think this is an incorrect way to estimate fees from spread?
We are just calculating this as trade profits? For eg: ETH was 1800$ in the morning and 2000$ at night , and user sold 1 at morning and bought one at night, doesn't necessarily mean fees was 200$?
Spread should be more about calculating price difference during the trade, but not sure if there is an efficient way?
my bad. what if we fix it to diff the two legs within the same swap instead, so there's no option for price movement? |
Can you please give an example of how it can be done? |
Adds a
fees/bisonfiadapter for BisonFi, a proprietary Solana AMM that earns revenue from bid/ask spread rather than explicit swap fees.Changes
fees/bisonfi.tsusingdex_solana.trades(project = 'bisonfi').sold − boughtper token, valued in USD), matching the methodology used byfees/humidifi.dailyFees = dailyRevenue = dailyProtocolRevenue, withallowNegativeValue: truesince inventory PnL can be negative.Verification