Skip to content

Latest commit

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

DEXTools chart widget

(This is the public documentation repo of the DEXTools Chart Widget)

The Chart Widget allows websites to display an embedded trading chart for any pool supported by DEXTools.io app. Chart data is updated in real-time, including the current price in USD and trade history.

widget screenshot

Chart display is provided by TradingView

Get your pool/token iframe widget code

  1. First search your favorite token or pool by address, name... using the DEXTools search bar.
search screenshot
  1. Then click the embed option of the DEXTools pair explorer, a pop-up will appear to configure the chart and copy the embed code.
embed screenshot

Quick Example

An iframe based integration example follows:

<!DOCTYPE html><html><head><metacharset="UTF-8"><title>DEXTools Pair Explorer Widget Template</title></head><body><iframeid="dextools-widget"
title="DEXTools Trading Chart"
width="500"
height="400" src="https://www.dextools.io/widget-chart/en/ether/pe-light/0xa29fe6ef9592b5d408cca961d0fb9b1faf497d6d?theme=light&chartType=2&chartResolution=30&drawingToolbars=false"></iframe></body></html>

Common issues and testing

You can test if the IFrame integration works properly with a tool like https://iframetester.com/.

In case of errors showing a Chart in your website, please check your CSP policy for IFrame content https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

Please be aware that USE OF CHART WIDGET IFRAME FROM localhost WON'T WORK, please use a real domain instead.

Customization options

The widget is configured by using the embed wizard, but also manually adjusting the following parts and query parameters of this URL:

https://www.dextools.io/widget-chart/en/<chainId>/pe-light/<pairAddress>?theme=<theme>&chartType=<chartType>&chartResolution=<chartResolution>&drawingToolbars=<drawingToolbars>&tvPlatformColor=<color>&tvPaneColor=<color>&headerColor=<color>&chartInUsd=<chartInUsd>&showTradeHistory=<showTradeHistory>&tradeHistoryColor=<tradeHistoryColor>
ParameterValues
chainIdblockchain ID (see list below)
pairAddressaddress of the pool to display
themedark or light
chartType0 = Bar
1 = Candle
2 = Line
3 = Area
8 = Heikin Ashi
9 = hollow candle
10 = Baseline
chartResolution1 (minute), 3, 5, 15, 30, 60, 120, 240, 720, 1D, 3D, 1W, 1M
drawingToolbarsfalse or true
showTradeHistoryfalse or true
headerColorcustom color for the widget header.
IMPORTANT: should be in hexadecimal format without the #
tvPlatformColorcustom color for the chart background.
IMPORTANT: should be in hexadecimal format without the #
tvPaneColorcustom color for the chart controls background.
IMPORTANT: should be in hexadecimal format without the #
tradeHistoryColorcustom color for the trade history background.
IMPORTANT: should be in hexadecimal format without the #
chartInUsdfalse to show the "Token/<chain reference token>" chart, otherwise (also if this param is not passed) the chart is the "Token/USD" one by default

Supported blockchains

We add support for new blockchains frequently. This is the current list of available blockchains:

BlockchainID
SOLANAsolana
ETHEREUMether
BNBbnb
BASEbase
POLYGONpolygon
PULSEpulse
TONton
ARBITRUMarbitrum
AVALANCHEavalanche
MONADmonad
RONINronin
SUIsui
SONICsonic
TRONtron
CRONOScronos
XRPLxrpl
WORLD CHAINworldchain
OSMOSISosmosis
ABSTRACTabstract
VSCvsc
SONEIUMsoneium
LINEAlinea
OPTIMISMoptimism
ICPicp
HYPER EVMhyperevm
BERA CHAINberachain
X LAYERxlayer
CHILIZchiliz
SHIBARIUMshib
HEDERAhedera
APTOSaptos
MANTLEmantle
UNI CHAINunichain
SHIDOshido
FLAREflare
METISmetis
DOGE CHAINdogechain
ZKSYNCzksync
STORYstory
KAIAkaia
NEARnear
INKink
CELOcelo
PLASMAplasma
SEIsei
XDCxdc
GNOSISgnosis
APE CHAINapechain
IOTA-EVMiotaevm
BLASTblast
INJECTIVEinjective
QUBICqubic
ETHERLINKetherlink
PAW CHAINpawchain
FUSEfuse
U2Uutwou
ODYSSEYodyssey
SCROLLscroll
CRONOS-ZKEVMcronoszkevm
SUPERSEEDsuperseed
OKTC (FORMER OEC)oktc
ARBITRUM NOVAarbitrumnova
BITLAYERbitlayer
ELYSIUMelysium
GRAVITY ALPHAgravityalpha
MODEmode
MANTAmanta
KAVAkava
KUJIRAkujira
POLYGON-ZKEVMpolygonzkevm
UNIT ZEROunits
NIBIRUnibiruevm
ANUBISanubis
TERRAterra
ROBINHOODrobinhood
STABLEstable

About

DEXTools chart widget docs

Resources

Stars

67 stars

Watchers

8 watching

Forks

Releases

Packages

Contributors