Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b2ba712
feat[ZUP-88]: add support for ethereum mainnet
RyanHolanda Apr 4, 2025
b98ff0c
chore: add slippage check error message
RyanHolanda Apr 5, 2025
6123b8e
fix: images not loading on web
RyanHolanda Apr 5, 2025
eb0641b
fix: image not updating when changing the url
RyanHolanda Apr 5, 2025
2f6ad59
feat: add tvl info in the pool && min tvl filter
RyanHolanda Apr 10, 2025
6f117c8
chore: bump flutter bootstrap version
RyanHolanda Apr 10, 2025
abdc5da
ci: update install dependencies command
RyanHolanda Apr 10, 2025
686d1e1
ci: remove make commands from CI
RyanHolanda Apr 10, 2025
06fccdd
Merge branch 'main' into staging
RyanHolanda Apr 17, 2025
74a219c
docs: add instructions to add a new network in readme
RyanHolanda Apr 17, 2025
d9da377
feat: add scroll mainnet
RyanHolanda Apr 28, 2025
3f6e195
feat: add network to the deposit page path
RyanHolanda Apr 29, 2025
79261a4
feat: add privacy policy + terms and coditions
RyanHolanda Apr 29, 2025
46c7b33
fix: tests
RyanHolanda Apr 29, 2025
2050e71
Merge branch 'main' into staging
RyanHolanda Apr 30, 2025
e1e73a1
feat: add cookies consent
RyanHolanda Apr 30, 2025
175d4d0
Merge branch 'main' into staging
RyanHolanda May 13, 2025
58bbeac
feat: allow crosschain search
RyanHolanda May 16, 2025
0539501
feat: does not allow search by address in all networks
RyanHolanda May 17, 2025
326b85b
fix: user token amount not updating correctly when changing yields
RyanHolanda May 18, 2025
c933415
feat: add base network
RyanHolanda May 20, 2025
7ba9fa6
Merge branch 'main' into staging
RyanHolanda May 23, 2025
afad225
feat: calculate USD price of input asset
RyanHolanda May 26, 2025
b8a83cd
feat: allow uniswap v4
RyanHolanda Jun 11, 2025
396eae9
Update flutter version on CI
RyanHolanda Jun 24, 2025
1827998
fix: wrong token amount appearing when connecting wallet with tokens …
RyanHolanda Jul 6, 2025
a9f3dfd
chore: remove base support
RyanHolanda Jul 14, 2025
1da6c94
bump version
RyanHolanda Jul 14, 2025
1da2f67
Merge branch 'main' into staging
RyanHolanda Jul 14, 2025
add2ab8
Merge branch 'main' into staging
RyanHolanda Jul 14, 2025
1729fc4
feat: add prefixed percentage range buttons
RyanHolanda Jul 15, 2025
fe3e2a1
bump version
RyanHolanda Jul 15, 2025
f733f3a
Merge branch 'main' into staging
RyanHolanda Jul 15, 2025
b211dce
Merge branch 'main' into staging
RyanHolanda Jul 15, 2025
9fcf3e1
feat: add support to filter DEXs
RyanHolanda Jul 19, 2025
4b6cbdc
feat: add bnb chain support (#37)
RyanHolanda Jul 21, 2025
bb05a7c
chore: remove bnb support
RyanHolanda Jul 21, 2025
3536450
fix: uniswap v4 deposits with full amount available not working
RyanHolanda Jul 23, 2025
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
3 changes: 0 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"toolArgs": [
"--dart-define=env=local",
],
"args": [
"--web-experimental-hot-reload"
]
},
{
"name": "Zup App (Web) (Debug)",
Expand Down
3 changes: 3 additions & 0 deletions assets/logos/bnb_chain.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions lib/abis/pancake_swap_infinity_cl_pool_manager.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[
{
"inputs": [
{
"internalType": "PoolId",
"name": "id",
"type": "bytes32"
}
],
"name": "getSlot0",
"outputs": [
{
"internalType": "uint160",
"name": "sqrtPriceX96",
"type": "uint160"
},
{
"internalType": "int24",
"name": "tick",
"type": "int24"
},
{
"internalType": "uint24",
"name": "protocolFee",
"type": "uint24"
},
{
"internalType": "uint24",
"name": "lpFee",
"type": "uint24"
}
],
"stateMutability": "view",
"type": "function"
}
]
10 changes: 7 additions & 3 deletions lib/app/app_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ class _AppPageState extends State<AppPage> with DeviceInfoMixin {
title: AppHeader(height: appBarHeight),
toolbarHeight: appBarHeight,
),
const SliverFillRemaining(
hasScrollBody: false,
child: RouterOutlet(key: Key("screen")),
SliverToBoxAdapter(
child: ConstrainedBox(
constraints: BoxConstraints(minHeight: MediaQuery.of(context).size.height - appBarHeight),
child: const RouterOutlet(
key: Key("screen"),
),
),
),
SliverToBoxAdapter(
child: Padding(
Expand Down
91 changes: 50 additions & 41 deletions lib/app/create/create_page_select_tokens_stage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'dart:async';

import 'package:flutter/material.dart';
import 'package:zup_app/app/app_cubit/app_cubit.dart';
import 'package:zup_app/app/create/widgets/create_page_settings_dropdown.dart';
import 'package:zup_app/app/create/widgets/create_page_settings_dropdown/create_page_settings_dropdown.dart';
import 'package:zup_app/app/create/widgets/exchanges_filter_dropdown_button/exchanges_filter_dropdown_button.dart';
import 'package:zup_app/core/cache.dart';
import 'package:zup_app/core/dtos/token_dto.dart';
import 'package:zup_app/core/injections.dart';
Expand Down Expand Up @@ -100,7 +101,7 @@ class _CreatePageState extends State<CreatePageSelectTokensStage> with DeviceInf
child: Align(
alignment: Alignment.topCenter,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 490, minHeight: 500),
constraints: const BoxConstraints(maxWidth: 490),
child: Align(
alignment: Alignment.topLeft,
child: Column(
Expand All @@ -112,48 +113,56 @@ class _CreatePageState extends State<CreatePageSelectTokensStage> with DeviceInf
style: const TextStyle(fontSize: 14, color: ZupColors.gray),
),
const SizedBox(height: 20),
Row(
children: [
Transform.translate(
offset: const Offset(0, 8),
child: Text(
S.of(context).token0,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14,
color: ZupColors.gray,
SizedBox(
width: double.infinity,
child: Wrap(
runSpacing: 10,
verticalDirection: VerticalDirection.up,
alignment: WrapAlignment.spaceBetween,
children: [
Transform.translate(
offset: const Offset(0, 8),
child: Text(
S.of(context).token0,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14,
color: ZupColors.gray,
),
),
),
),
const Spacer(),
StatefulBuilder(builder: (context, localSetState) {
return Row(
children: [
Badge(
alignment: const Alignment(1.05, -1.05),
smallSize: cache.getPoolSearchSettings().isDefault ? 0 : 6,
backgroundColor: ZupColors.orange,
child: ZupPillButton(
key: const Key("pool-search-settings-button"),
onPressed: (buttonContext) => CreatePageSettingsDropdown.show(
buttonContext,
onClose: () {
if (mounted) {
WidgetsBinding.instance.addPostFrameCallback((_) => localSetState(() {}));
}
},
StatefulBuilder(builder: (context, localSetState) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
const ExchangesFilterDropdownButton(),
const SizedBox(width: 10),
Badge(
alignment: const Alignment(1.05, -1.05),
smallSize: cache.getPoolSearchSettings().isDefault ? 0 : 6,
backgroundColor: ZupColors.orange,
child: ZupMiniButton(
key: const Key("pool-search-settings-button"),
onPressed: (buttonContext) => CreatePageSettingsDropdown.show(
buttonContext,
onClose: () {
if (mounted) {
WidgetsBinding.instance.addPostFrameCallback((_) => localSetState(() {}));
}
},
),
title: S.of(context).createPageSelectTokensStageSearchSettings,
icon: Assets.icons.gear.svg(
height: 18,
colorFilter: const ColorFilter.mode(ZupColors.white, BlendMode.srcIn),
),
),
foregroundColor: ZupColors.gray,
backgroundColor: ZupColors.gray6,
title: "Search settings",
icon: Assets.icons.gear.svg(
height: 18, colorFilter: const ColorFilter.mode(ZupColors.white, BlendMode.srcIn)),
),
),
],
);
})
],
],
);
})
],
),
),
const SizedBox(height: 12),
TokenSelectorButton(
Expand Down Expand Up @@ -191,7 +200,7 @@ class _CreatePageState extends State<CreatePageSelectTokensStage> with DeviceInf
icon: Assets.icons.sparkleMagnifyingglass.svg(),
onPressed: token0SelectorController.selectedToken != null &&
token1SelectorController.selectedToken != null
? () {
? (buttonContext) {
return navigator.navigateToDeposit(
appCubit.selectedNetwork.isAllNetworks
? token0SelectorController.selectedToken!.internalId!
Expand Down
10 changes: 7 additions & 3 deletions lib/app/create/deposit/deposit_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:web3kit/web3kit.dart';
import 'package:zup_app/app/app_cubit/app_cubit.dart';
import 'package:zup_app/core/cache.dart';
import 'package:zup_app/core/dtos/deposit_settings_dto.dart';
import 'package:zup_app/core/dtos/pool_search_filters_dto.dart';
import 'package:zup_app/core/dtos/pool_search_settings_dto.dart';
import 'package:zup_app/core/dtos/yield_dto.dart';
import 'package:zup_app/core/dtos/yields_dto.dart';
Expand Down Expand Up @@ -42,6 +43,7 @@ class DepositCubit extends Cubit<DepositState> with KeysMixin, V3PoolConversorsM

final StreamController<BigInt?> _pooltickStreamController = StreamController.broadcast();
final StreamController<YieldDto?> _selectedYieldStreamController = StreamController.broadcast();
final Duration _poolTickExpiration = const Duration(seconds: 30);

BigInt? _latestPoolTick;
YieldDto? _selectedYield;
Expand All @@ -57,7 +59,7 @@ class DepositCubit extends Cubit<DepositState> with KeysMixin, V3PoolConversorsM
PoolSearchSettingsDto get poolSearchSettings => _cache.getPoolSearchSettings();

void setup() async {
Timer.periodic(const Duration(minutes: 1), (timer) {
Timer.periodic(_poolTickExpiration, (timer) {
if (_pooltickStreamController.isClosed) return timer.cancel();

if (selectedYield != null) getSelectedPoolTick();
Expand All @@ -79,12 +81,14 @@ class DepositCubit extends Cubit<DepositState> with KeysMixin, V3PoolConversorsM
emit(const DepositState.loading());
final yields = _appCubit.selectedNetwork.isAllNetworks
? await _yieldRepository.getAllNetworksYield(
blockedProtocolIds: _cache.blockedProtocolsIds,
token0InternalId: token0AddressOrId,
token1InternalId: token1AddressOrId,
searchSettings: ignoreMinLiquidity ? poolSearchSettings.copyWith(minLiquidityUSD: 0) : poolSearchSettings,
testnetMode: _appCubit.isTestnetMode,
)
: await _yieldRepository.getSingleNetworkYield(
blockedProtocolIds: _cache.blockedProtocolsIds,
token0Address: token0AddressOrId,
token1Address: token1AddressOrId,
network: _appCubit.selectedNetwork,
Expand All @@ -93,7 +97,7 @@ class DepositCubit extends Cubit<DepositState> with KeysMixin, V3PoolConversorsM

if (yields.isEmpty) {
return emit(
DepositState.noYields(minLiquiditySearched: yields.minLiquidityUSD),
DepositState.noYields(filtersApplied: yields.filters),
);
}

Expand Down Expand Up @@ -123,7 +127,7 @@ class DepositCubit extends Cubit<DepositState> with KeysMixin, V3PoolConversorsM

final tick = await _zupSingletonCache.run(
() => _poolService.getPoolTick(selectedYieldBeforeCall!),
expiration: const Duration(minutes: 1),
expiration: _poolTickExpiration - const Duration(seconds: 1),
ignoreCache: forceRefresh,
key: poolTickCacheKey(
network: selectedYield!.network,
Expand Down
Loading
Loading