Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
Decentralized Exchanges (DEX)
Prediction Markets
Securities and Futures
On-chain & Custom

Sets the deadline of swap transactions, or queries it.

exchange.IO(k)
exchange.IO(k, seconds)

Examples

Set the transaction deadline and query the current value.

javascript
function main() { exchange.IO("deadline", 300) Log("Deadline:", exchange.IO("deadline"), "seconds") }

Returns

TypeDescription

number

Returns the current transaction deadline in seconds.

Arguments

NameTypeRequiredDescription

k

string

Yes

Fixed as deadline, which sets or queries the transaction deadline.

seconds

number

No

Transaction validity period in seconds. Valid range is 10–86400 and the default is 120. If this parameter is omitted, the current value is queried.

See Also

Remarks

If a swap transaction is not confirmed on-chain before the deadline, it is reverted when executed. This prevents a transaction that has been pending for a long time from being filled after a large price move.

The KyberSwap exchange object passes the deadline to KyberSwap when the swap transaction is built; transactions built by 1inch carry no deadline, so the setting has no effect on swaps of a OneInch exchange object.