• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

decentraland / atlas-server / 13264627278

11 Feb 2025 01:09PM UTC coverage: 40.088% (+1.8%) from 38.329%
13264627278

push

github

web-flow
feat: Add trades to tiles (#124)

# Add Off-Chain Trade Prices to Atlas Tiles

## Overview
This PR adds support for displaying off-chain trade prices in the Atlas
map tiles. Previously, the map only showed prices from on-chain orders,
but now it will also display prices from off-chain trades (marketplace
trades), using the most recent price between both sources.

## Changes
- Added new `trades` component to fetch active trades from the
marketplace database
- Modified map component to integrate off-chain trade prices with
existing tile data
- Added price comparison logic to use the most recent price between
on-chain orders and off-chain trades
- Added tests for the new trades component
- Improved logging for better debugging and monitoring

## Technical Details
- Created a new database query to fetch active trades filtered by parcel
and estate categories
- Added `updateTilesWithTrades` function that:
  - Fetches active trades from the database
  - Matches trades with tiles based on contract address and token ID
- Updates tile prices if a trade is more recent than the current
on-chain order
- Integrated trade price updates in both initialization paths (cached
and fresh data)

## Testing
- Added unit tests for the trades component covering:
  - Successful trade fetching
  - Error handling
  - Category filtering
- Manually tested price updates with both on-chain orders and off-chain
trades

## Notes
- The system prioritizes the most recent price between on-chain orders
and off-chain trades
- Trade prices are converted from wei to ETH for display
- All price updates are persisted to S3 for caching

159 of 217 branches covered (73.27%)

Branch coverage included in aggregate %.

167 of 260 new or added lines in 4 files covered. (64.23%)

1485 of 3884 relevant lines covered (38.23%)

5.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/modules/map/component.ts


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc